# How to get the same output as in TUGBoat article “Tracing paragraphs”?

Recently I began to read a very interesting TUGBoat article "Tracing paragraphs" by Udo Wermuth.

There is the example-1 from the article (with header and footer added by logic considerations):

\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
\settabs 3 \columns \+&&End of example:\cr
\end


The log file in the article indicates that \nine... fonts are used, so I added \ninepoint macro from manmac.tex. Compilation failed, and I started to grep things on which it failed one by one in manmac.tex and add them to the example. Then dvi file matched what is in the article. But log file still did not match. I had to add \hyphenation{col-umns} because this word is not hyphenated by default in plain TeX.

Then log file started to match perfectly up to line 38. This is line 38 from article vs my run:

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

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


From this moment an up till the end the numbers started to differ wildly.

How to get the same output as in the example-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}

• There is a very large macro file associated with this article; I haven't had time to explore it thoroughly. What I have confirmed, however, is that the file tugboat.sty is input, and this in turn inputs tugboat.cmn, which contains the hyphenation exception \hyphenation{col-umns}, a word that has caused problems in the past. tugboat.sty also defines \ninepoint. This file is included in TeX Live, so you should be able to start by inputting it and see if anything changes. – barbara beeton Jun 10 at 2:15
• @barbarabeeton Indeed, using \input tugboat.sty and \ninepoint fixes it! But one has to install texlive-publishers package (in Debian). How to factor out the necessary changes from tugboat.sty to make the output match the article using only plain TeX? I need to know what is the cause of difference of the numbers. (I wonder how an author who uses plain TeX over 30 years could write an article which relies on huge external libraries, without explaining anything.) – Igor Liferenko Jun 10 at 2:48
• @IgorLiferenko Maybe you should grep tugboat.sty and tugboat.cmn for all parameters that can influence the computation of demerits, such as \emergencystretch... – frougon Jun 10 at 6:00
• I'm not sure what you mean by huge external libraries''. I wrote this article for TUGboat and they require that I use their macro files. I haven't mentioned tugboat.sty or tugboat.cmn and their version numbers (the current files have a different version number than those that I used back then) because I thought that is obvious as all journals have their macros. I don't know what packages Debian has but the tugboat.* files are available on CTAN. – Udo Wermuth Jun 10 at 8:11
• To your question: I didn't expect that anyone runs this example under plain TeX as the 9pt font is explicitly mentioned in the text so it cannot be executed without activating these fonts. You get the output if you change your copy of manmac's \ninepoint to use scriptfonts of 7pt not 6pt. Tugboat has its own \ninepoint macro. OK I just see that David Carlisle has written an answer. And a Thank you that you find the article interesting. – Udo Wermuth Jun 10 at 8:14

The main difference is that the \ninepoint you defined was using a 6pt script size, but tugboat uses 7pt, copying a few more tugboat definitions gives

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


from a modified document

\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

\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
\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
`