如何获得与 TUGBoat 文章“追踪段落”相同的输出?

如何获得与 TUGBoat 文章“追踪段落”相同的输出?

最近我开始阅读一篇非常有趣的 TUGBoat 文章“追踪段落”经过乌多·沃穆特

这是文章中的示例 1(出于逻辑考虑添加了页眉和页脚):

\pretolerance=100
\tolerance=200
\hsize=225.0pt
\tracingparagraphs=1
\noindent
Note: {\sl pretolerance\/} is \the\pretolerance\
and {\sl tolerance\/} is \the\tolerance, the
{\it hsize\/} is~\the\hsize.

This is a nonsense text to serve as a
constructed example that shows all kind of trace
lines. It contains~inline mathematics and text in
columns. The formula $2\times 2^2 = 8$ is simple
mathematics as well as formula $\root3 \of 8 = 2$
or what do you think? Now a declaration or
definition for a three columns tabbing
environment is made.
\settabs 3 \columns \+&&End of example:\cr
\end

文章中的日志文件表明\nine...使用了字体,因此我添加了\ninepoint曼麦克。编译失败,我开始grep逐一检查失败的地方,manmac.tex并将它们添加到示例中。然后dvi文件匹配了文章中的内容。但log文件仍然不匹配。我不得不添加,\hyphenation{col-umns}因为这个单词在纯 TeX 中默认没有连字符。

然后log文件开始完美匹配直到第 38 行。这是文章与我的运行的第 38 行:

@\penalty via @@5 b=10 p=500 d=250400

@\penalty via @@5 b=8 p=500 d=250324

从此刻起直到最后,数字开始出现巨大差异。

如何获得与示例 1 相同的输出?


这是我添加的附加标题:

\font\ninerm=cmr9
\font\sixrm=cmr6
\font\ninei=cmmi9
\font\sixi=cmmi6
\font\ninesy=cmsy9
\font\sixsy=cmsy6
\font\nineit=cmti9
\font\ninesl=cmsl9
\font\ninebf=cmbx9
\font\sixbf=cmbx6
\font\ninett=cmtt9
\newskip\ttglue

\def\ninepoint{\def\rm{\fam0\ninerm}%
  \textfont0=\ninerm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm
  \textfont1=\ninei \scriptfont1=\sixi \scriptscriptfont1=\fivei
  \textfont2=\ninesy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  \def\it{\fam\itfam\nineit}%
  \textfont\itfam=\nineit
  \def\sl{\fam\slfam\ninesl}%
  \textfont\slfam=\ninesl
  \def\bf{\fam\bffam\ninebf}%
  \textfont\bffam=\ninebf \scriptfont\bffam=\sixbf
   \scriptscriptfont\bffam=\fivebf
  \def\tt{\fam\ttfam\ninett}%
  \textfont\ttfam=\ninett
  \tt \ttglue=.5em plus.25em minus.15em
  \normalbaselineskip=11pt
  \def\MF{{\manual hijk}\-{\manual lmnj}}%
  \let\sc=\sevenrm
  \let\big=\ninebig
  \setbox\strutbox=\hbox{\vrule height8pt depth3pt width0pt}%
  \normalbaselines\rm}
\ninepoint
\hyphenation{col-umns}

答案1

主要区别在于,\ninepoint您定义的是使用 6pt 脚本大小,但拖船使用 7pt,复制更多拖船定义可得到

@\penalty via @@5 b=10 p=500 d=250400

来自修改后的文档

\catcode`\@=11
%\input tugboat.sty
%\input tugboat.cmn
\font\ninerm=cmr9
\font\sixrm=cmr6
\font\ninei=cmmi9
\font\sixi=cmmi6
\font\ninesy=cmsy9
\font\sixsy=cmsy6
\font\nineit=cmti9
\font\ninesl=cmsl9
\font\ninebf=cmbx9
\font\sixbf=cmbx6
\font\ninett=cmtt9
\newskip\ttglue

\def\@additionsto#1{\expandafter\the\csname @addsto\string#1\endcsname}
\expandafter\newtoks\csname @addsto\string\ninepoint\endcsname

\newbox\struttbox
\def\strutt{\relax\ifmmode\copy\struttbox\else\unhcopy\struttbox\fi}

\def\setttglue{%
  \edef\@thefont{\the\font}%  to restore this font after the setting
  \tt \ttglue=.5em plus .25em minus .15em
  \@thefont}

\def\ninepoint{\normalbaselineskip=11pt
  \abovedisplayskip=2.5pt plus 2.5pt minus 1pt
  \belowdisplayskip=2.5pt plus 2.5pt minus 1pt
  \abovedisplayshortskip=0pt plus 2.5pt
  \belowdisplayshortskip=1pt plus 2.5pt minus 1pt
  \def\rm{\fam\z@\ninerm}%
  \textfont\z@=\ninerm \scriptfont\z@=\sevenrm
  \def\oldstyle{\fam\@ne\ninei}%
  \textfont\@ne=\ninei \scriptfont\@ne=\seveni
  \textfont\tw@=\ninesy \scriptfont\tw@=\sevensy
  \def\it{\fam\itfam\nineit}%
  \textfont\itfam=\nineit
  \def\sl{\fam\slfam\ninesl}%
  \textfont\slfam=\ninesl
  \def\bf{\fam\bffam\ninebf}%
  \textfont\bffam=\ninebf \scriptfont\bffam=\sevenbf
  \def\smc{\ninesmc}%
  \def\SMC{\eightrm}%
  \font\manual=logo9
  \font\manualsl=logosl10 at 9pt
  \def\tt{\ninett}%
        \setttglue
  \setbox\strutbox=\hbox{\vrule height 6.75pt depth 2.25pt width\z@}%
  \setbox\struttbox=\hbox{\vrule height 7.75pt depth 3.25pt width\z@}%
  \normalbaselines \rm
  \@additionsto\ninepoint }
\ninepoint
\hyphenation{col-umns}




\newskip\ttglue
\ninepoint

\pretolerance=100
\tolerance=200
\hsize=225.0pt
\tracingonline1
\tracingparagraphs=1

%\tracingall
\noindent
Note: {\sl pretolerance\/} is \the\pretolerance\
and {\sl tolerance\/} is \the\tolerance, the
{\it hsize\/} is~\the\hsize.

This is a nonsense text to serve as a
constructed example that shows all kind of trace
lines. It contains~inline mathematics and text in
columns. The formula $2\times 2^2 = 8$ is simple
mathematics as well as formula $\root3 \of 8 = 2$
or what do you think? Now a declaration or
definition for a three columns tabbing
environment is made.
\settabs 3 \columns \+&&End of example:\cr
\end

答案2

回想起来,对于 Udo 的示例,我们显然应该关闭 tugboat.sty 的连字异常(以及可能影响换行的任何其他功能)。我们都没有想到这一点。抱歉。

相关内容