PageWidth

PageWidth

是输出流和单元的一个选项,指定文本每行所允许的宽度.

更多信息

  • 输出流可能设置是:
  • Infinity无限宽度(不分行)
    n明确的字符宽度
  • SetOptions[stream,PageWidth->val] 重设对一个打开流允许的行宽度.
  • 单元的可能设置是:
  • WindowWidth屏幕上窗口的宽度
    PaperWidth当输出时页的宽度
    n以打印机点给出的明确宽度
  • PageWidth->WindowWidth 允许每行使用显示窗口的完全宽度,考虑 CellMargins 的设置.
  • 单元的 PageWidth 设置设置所有单元元素的边界,包括 CellMarginsCellFrameCellFrameLabels. 它不包括为单元括号分配的空间.
  • PageWidth->UpTo[n] 等价于 PageWidth->WindowWidthPageWidth->n 之中较小的一个.
  • 如果有效的 PageWidth 小于窗口的宽度,单元内容的对齐由 Alignment 选项控制.

范例

打开所有单元关闭所有单元

基本范例  (2)

对于输出流,设置 PageWidth 为 60 位字符的宽度:

对于输出流,设置 PageWidth 为 30 位字符的宽度:

比较得到的两个文件:

删除临时文件:

创建一个具有固定宽度的输出单元:

This is a bit of text

范围  (4)

设置固定页宽:

Four score and seven years ago, our fathers brought forth upon this continent a new nation: conceived in liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war...testing whether that nation, or any nation so conceived and so dedicated. . .

设置使用窗口全宽的宽度:

Four score and seven years ago, our fathers brought forth upon this continent a new nation: conceived in liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war...testing whether that nation, or any nation so conceived and so dedicated. . .

设置宽度为默认打印机的纸宽:

Four score and seven years ago, our fathers brought forth upon this continent a new nation: conceived in liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war...testing whether that nation, or any nation so conceived and so dedicated. . .

如果窗口变窄,将宽度设为 600 个点或更窄:

Four score and seven years ago, our fathers brought forth upon this continent a new nation: conceived in liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war...testing whether that nation, or any nation so conceived and so dedicated. . .

属性和关系  (3)

PageWidth 单元设置包括由 CellMargins 消耗的水平空间:

This is a bit of textThis is a bit of textThis is a bit of textThis is a bit of text

PageWidth 影响 CellFrame 的宽度和 CellFrameLabels 的位置:

This is a bit of textThis is a bit of textThis is a bit of textThis is a bit of text

Alignment 确定受过窄的 PageWidth 影响的单元如何对齐:

abc
Wolfram Research (1988),PageWidth,Wolfram 语言函数,https://reference.wolfram.com/language/ref/PageWidth.html (更新于 2020 年).

文本

Wolfram Research (1988),PageWidth,Wolfram 语言函数,https://reference.wolfram.com/language/ref/PageWidth.html (更新于 2020 年).

CMS

Wolfram 语言. 1988. "PageWidth." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2020. https://reference.wolfram.com/language/ref/PageWidth.html.

APA

Wolfram 语言. (1988). PageWidth. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/PageWidth.html 年

BibTeX

@misc{reference.wolfram_2024_pagewidth, author="Wolfram Research", title="{PageWidth}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/PageWidth.html}", note=[Accessed: 17-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_pagewidth, organization={Wolfram Research}, title={PageWidth}, year={2020}, url={https://reference.wolfram.com/language/ref/PageWidth.html}, note=[Accessed: 17-November-2024 ]}