屏幕截图中的文本描述了第 1 页上的问题,第 2 页上的问题不同。第 3 页显示了插入页码的“正确”方法。但我不想这样做 - 我想使用\pagereference
s。我尝试插入几个\dontleavehmode
s,但没有帮助。
请解释我在第 1 页和第 2 页上做错了什么。
\showframe
\setuppapersize[A6][A5,landscape] \setuparranging[2SIDE]
\starttext
\startsection [title=First section heading]
\pagereference[pageref1]
There is a small gap between the left side of the frame and the start of this sentence. It should not be there.
\page
\startsection [title=Second section heading]
\pagereference[pageref2]
The whitespace between the section heading and the start of this text is bigger than on page 1.
\stopsection
\page
\startsection [title=Third section heading, reference=pageref3]
This has no problems, but I don't want to specify the reference this way.
\stopsection
\stoptext
答案1
在第 1 页上, 后面有一个空白行,\pagereference
排版为一个空格。在第 2 页上,两个空白行排版为\par
,即一个新段落。
为了解决这个问题,我们可以定义一个新的\pagereference
,忽略它后面的空格/新行:
\showframe
\setuppapersize[A6][A5,landscape] \setuparranging[2SIDE]
\protected\def\newpagereference[#1]{\pagereference[#1]\futureexpandisap\relax\relax\relax}
\starttext
\startsection [title=First section heading]
\newpagereference[pageref1]
There is a small gap between the left side of the frame and the start of this sentence. It should not be there.
\page
\startsection [title=Second section heading]
\newpagereference[pageref2]
The whitespace between the section heading and the start of this text is bigger than on page 1.
\stopsection
\page
\startsection [title=Third section heading, reference=pageref3]
This has no problems, but I don't want to specify the reference this way.
\stopsection
\stoptext
这使用了一个新的 LuaMetaTeX 原语,\futureexpandisap
它扩张s 以下字符和我忽略s步伐And页词组。