最小工作示例(MWE)

最小工作示例(MWE)

最小工作示例(MWE)

\starttypescript [serif] [storybody]
  \definefontsynonym [Serif] [name:couriernew]
\stoptypescript

\definetypeface[story] [rm] [serif] [storybody] [default]
\setupbodyfont[story]

\setupinterlinespace[line=32pt]

\setuplayout[
  backspace=.75in,
  leftmargin=\zeropoint,
  rightmargindistance=\zeropoint,
  rightmargin=1.25in,
]

\setupalign[hz,hanging,nothyphenated,]
\setuptolerance[stretch,tolerant,]
\setupindenting[yes, 5em, first]

\showframe

\starttext
  \startbodymatter
Architected as a sentinel of capitalism, Skopós orchestrated the future. 
Every day its vast array of power-devouring, refrigerator-sized towers
would crunch through several yottabytes of data.
  \stopbodymatter
\stoptext

输出

MWE 产生以下内容:

保证金溢出

请注意有些词语如何顺利地流入边缘。

期望输出

添加手动换行符可将边距视为硬边:

手动换行

代码:

\starttypescript [serif] [storybody]
  \definefontsynonym [Serif] [name:couriernew]
\stoptypescript

\definetypeface[story] [rm] [serif] [storybody] [default]
\setupbodyfont[story]

\setupinterlinespace[line=32pt]

\setupalign[hz,hanging,nothyphenated,]
\setuptolerance[stretch,tolerant,]
\setupindenting[yes, 5em, first]

\showframe

\starttext
  \startbodymatter
Architected as a sentinel of capitalism, Skopós orchestrated the future. 
Every day its vast array of\\power-devouring, refrigerator-sized towers
would crunch through several yottabytes of data.
  \stopbodymatter
\stoptext

问题

在整个文本中添加手动换行符以确保页边距不受干扰,这会使内容和演示混为一谈。在我的特定情况下,我生成了两个不同的 PDF:一份手稿和一本电子书。两者的字体、标题、分页符和其他样式完全不同。此外,手动换行符不稳定 - 如果我更改了某个段落,我必须重新评估其手动换行符(如果有)。

添加手动换行符也会破坏电子书的格式,因为手稿和电子书都是从同一个 markdown 源生成的。也就是说,单一来源驱动两种类型的 PDF。

问题

如何强制 ConTeXt 尊重右边距作为硬限制无需使用连字符?我不介意右侧留出太多空间。(如果绝对必要,右侧边距可以重叠 1em。)

另一种表述方式是:如何保证页面周围有 1 英寸的边框,而没有连字符?

答案1

尝试flushleft

\starttypescript [serif] [storybody]
  \definefontsynonym [Serif] [name:couriernew]
\stoptypescript

\definetypeface[story] [rm] [serif] [storybody] [default]
\setupbodyfont[story]

\setupinterlinespace[line=32pt]

\setuplayout[
  backspace=.75in,
  leftmargin=\zeropoint,
  rightmargindistance=\zeropoint,
  rightmargin=1.25in,
]

\setupalign[flushleft,hz,nothyphenated,]
\setuptolerance[stretch,verytolerant,]
\setupindenting[yes, 5em, first]

\showframe

\starttext
  \startbodymatter
Architected as a sentinel of capitalism, Skopós orchestrated the future.
Every day its vast array of power-devouring, refrigerator-sized towers
would crunch through several yottabytes of data.
  \stopbodymatter
\stoptext

在此处输入图片描述

相关内容