显示行中空白的拉伸/收缩

显示行中空白的拉伸/收缩

是否有选项或软件包可以显示 TeX 为对齐每行所做的拉伸或收缩量?如果没有,如何实现?

它看起来应该像草稿选项放置在过满行旁边的黑条,但宽度会根据拉伸或收缩的量而变化。左边距收缩,右边距拉伸。可能还会显示可用的拉伸和收缩量。

我经常插入换行符\\并重新编译只是为了看到这一点,同时微调布局。

答案1

如果你可以从 pdfLaTeX 切换到 LuaLaTeX,那么你可能希望这样做,以便能够lua-visual-调试包。顾名思义,它提供了各种简洁的视觉线索,说明固定和可变长度的空格(TeX 术语中的“胶水”)出现的位置、显式字距插入的位置以及文本的哪些行具有平均、宽松和紧密的字间距(用灰色、蓝色和粉红色条标记)。

在此处输入图片描述

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures={TeX,Common}]{EB Garamond}
\usepackage{lua-visual-debug,lipsum}
\usepackage{microtype}
\author{Peter Christen Asbjørnsen and Jørgen Moe}
\title{Dapplegrim}
\date{1890}
\frenchspacing
\begin{document}
\maketitle

Once on a time there was a rich couple who had twelve sons; but the youngest when he was grown up said he wouldn't stay any longer at home, but be off into the world to try his luck. His father and mother said he did very well at home, and had better stay where he was. But no, he couldn't rest; away he must and would go. So at last they gave him leave. And when he had walked a good bit, he came to a king's palace, where he asked for a place, and got it.

Now the daughter of the king of that land had been carried off into the hill by a Troll, and the king had no other children; so he and all his land were in great grief and sorrow, and the king gave his word that any one who could set her free should have the Princess and half the kingdom. But there was no one who could do it, though many tried.

So when the lad had been there a year or so, he longed to go home again and see his father and mother, and back he went; but when he got home his father and mother were dead, and his brothers had shared all that the old people owned between them, and so there was nothing left for the lad.

``Shan't I have anything at all, then, out of father's and mother's goods?'' said the lad.

``Who could tell you were still alive, when you went gadding and wandering about so long?'' said his brothers. ``But all the same; there are twelve mares up on the hill which we haven't yet shared among us; if you choose to take them for your share, you're quite welcome.''
\end{document}

答案2

添加\showoutput到您的文档,然后显示输出的符号表示

文本行通常看起来像

..\vbox(548.5+0.0)x390.0, glue set 360.12822fil
...\hbox(8.33331+2.33331)x390.0, glue set 0.5529
...\hbox(8.33331+2.33331)x390.0, glue set - 0.191
...\hbox(8.33331+2.33331)x390.0, glue set - 0.3458
...\hbox(8.33331+2.33331)x390.0, glue set - 0.07698
...\hbox(8.33331+2.33331)x390.0, glue set - 0.43228
...\hbox(8.33331+2.33331)x390.0, glue set 139.01372fil

它是您感兴趣的粘合设置值。注意,这是粘合拉伸的因子的度量,而不是没有拉伸的文本的自然宽度之间的差异,尽管后者也可以通过查看框内容来计算。

相关内容