%!TEX TS-program = xetex %!TEX encoding = UTF-8 Unicode % ##################################### % Fonts used: % Latin Modern -- included in TeX Live and other distros % DejaVu Sans % https://dejavu-fonts.github.io/ % Mediaeval Caps % http://www.1001fonts.com/mediaeval-caps-font.html % Kleist Fraktur % http://www.1001fonts.com/kleist-fraktur-font.html % Deutche Zierschrift % http://www.dafont.com/deutsche-zierschrif.font % EB Garamond % https://bitbucket.org/georgd/eb-garamond/downloads/ % Symbola % https://dn-works.com/ufas/ % ##################################### \input eplain \enablehyperlinks \def\xrefpageword{} \beginpackages \usepackage{url} \usepackage{color} \usepackage{graphicx} \endpackages \input navigator \special{pdf: docview << /PageMode /UseOutlines >>} %++++++++++++++++++++++++++++++++++++++ % page layout \pdfpagewidth 156mm \pdfpageheight 234mm \hsize 100mm %\vsize 161mm % unadjusted \vsize %\vsize 175mm \vsize 490pt \voffset -5.4mm \output{\ifodd\pageno\hoffset -7.4mm\else\hoffset 12.6mm\fi\global\footno=0\plainoutput} % to adjust the space between the header and the text block \def\makeheadline{\vbox to 0pt{\vskip-22.5pt \line{\vbox to8.5pt{}\the\headline}\vss}\nointerlineskip} % to adjust the space between the footer and the text block \def\makefootline{\baselineskip24pt\lineskiplimit0pt\line{\the\footline}} %++++++++++++++++++++++++++++++++++++++ \tolerance 1414 \hbadness 1414 \hyphenpenalty 500 \finalhyphendemerits 7500 \emergencystretch 5pt \hfuzz 0.3pt \vfuzz=\hfuzz % paragraph spacing \parskip 0pt \parindent 1.2em \baselineskip 12pt \frenchspacing % line break macro; like `\\' in LaTeX or
in HTML \def\nl{\hfil\break} % for forcing a page break within a paragraph; like \pagebreak in LaTeX \def\pagebreak{\vadjust{\eject}} % like \newpage (or \clearpage?) in LaTeX; could be used e.g. for the end of a chapter \def\newpage{\vfill\eject} \def\unindent {% \setbox0=\lastbox} \def\vp {% \everypar{\unindent\everypar{}}} \def\centre{\parindent0pt\leftskip=0pt plus 1fil\rightskip=0pt plus 1fil \parfillskip=0pt\parskip=0pt\obeylines} \def\redrule{\bigskip \special{color push rgb 1 0 0} \hrule height.5pt depth.5pt \special{color pop} \bigskip\vp} \font\rm="[lmroman10-regular]:mapping=tex-text" at 10pt \font\it="[lmroman10-italic]:mapping=tex-text" at 10pt \font\bf="[lmroman10-bold]:mapping=tex-text" at 10pt \font\tt="[lmmono10-regular]" at 10pt \font\sc="[lmromancaps10-regular]:mapping=tex-text" at 10pt \font\scw="[lmromancaps10-regular]:letterspace=6,mapping=tex-text" at 10pt \font\eight="[lmroman8-regular]:mapping=tex-text" at 8pt \font\eightsc="[lmromancaps10-regular]:mapping=tex-text" at 8pt \font\eightscw="[lmromancaps10-regular]:letterspace=6,mapping=tex-text" at 8pt \font\rmw="[lmroman10-regular]:letterspace=6,mapping=tex-text" at 10pt \font\gara="EB Garamond 12 Regular:-clig,-calt,mapping=tex-text" at 10pt \font\sans="DejaVu Sans" at 7.5pt \font\sansb="DejaVu Sans/B" at 7.5pt %\font\sym="Segoe UI Symbol" at 10pt \font\sym="Symbola" at 10pt \font\Rm="[lmroman10-regular]:mapping=tex-text" at 12pt \font\ninerm="[lmroman8-regular]:mapping=tex-text" at 9pt \font\nineit="[lmroman8-italic]:mapping=tex-text" at 9pt \font\ninebf="[lmroman8-bold]:mapping=tex-text" at 9pt \font\ninesc="[lmromancaps10-regular]:mapping=tex-text" at 9pt \font\ninett="[lmmono8-regular]:mapping=tex-text" at 9pt % 9pt font environment for use in margin notes \def\ninepoint{\def\rm{\ninerm}\def\it{\nineit}\def\bf{\ninebf}\def\sc{\ninesc}\def\tt{\ninett} \normalbaselineskip=10pt% \setbox\strutbox=\hbox{\vrule height7.083pt depth2.917pt width0pt}% \normalbaselines\rm} % macro for the TeX space symbol % copied from gentle.tex \font\plaintt=cmtt10 at 10pt \def\sp{{\plaintt\char32{}}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % marginalia macro from: % http://tug.org/pipermail/tex-eplain/2008-June/000595.html % \marginalia macro \def\raggedleft{\spaceskip=.3333em \xspaceskip=.5em \parfillskip=0pt \leftskip=0pt plus\hsize} \def\lmarginaliabox#1{% \vtop to 0pt{% \raggedright\baselineskip10pt \hsize=.9in \parindent=0pt #1 \vss }} \def\rmarginaliabox#1{% \vtop to 0pt{% \raggedright\baselineskip10pt \hsize=.9in \parindent=0pt #1 \vss }} \newskip\inmarginspacing \inmarginspacing=1em \def\strutdepth{\dp\strutbox} \newcount\marginalno \marginalno0 \def\marginalpage#1#2{% \expandafter\gdef\csname marginalpage#1\endcsname{#2}} \let\protect\relax %\newread\auxin %\newwrite\auxout %\openin\auxin\jobname.aux %\ifeof\auxin % \let\noaux=1 % \immediate\openout\auxout\jobname.aux % \immediate\closeout\auxout %\else % \let\noaux=0 % \closein\auxin %\fi %\input \jobname.aux \readauxfile \outer\def\bye{% \par\vfill\supereject % \ifx\noaux1 % \newlinechar=`\^^J % \message{^^J(Run TeX a second time to resolve marginal note placing)}% % \fi \end } %\immediate\openout\auxout \jobname.aux \def\protect{\noexpand\protect\noexpand} \def\marginalia#1{% \strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \vss \global\advance\marginalno1 % \edef\writeit{\write\auxout{% \edef\writeit{\write\auxfile{% \protect\marginalpage {\number\marginalno}% {\noexpand\number\count0}}}% \writeit \expandafter\ifodd0\csname marginalpage\number\marginalno\endcsname % odd page stuff here \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces \lmarginaliabox{{\ninepoint #1}}}% \else % even page stuff here \llap{\ignorespaces \rmarginaliabox{{\ninepoint #1}}\hskip\inmarginspacing}% \fi \baselineskip=\strutdepth \null }}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % fnotesym % unicode version \def\fnsymbol#1{% % #1 is between 1 and 9 inclusive \ifcase#1\or *\or†\or‡\or§\or¶\or ‖\or**\or††\or‡‡ \fi} \catcode`\@=11 %\font\footnotesize="EB Garamond 12 Regular:-clig,-calt,mapping=tex-text" at 8pt \font\eightrm="[lmroman8-regular]:mapping=tex-text" at 8pt \font\eightit="[lmroman8-italic]:mapping=tex-text" at 8pt \font\eightbf="[lmroman8-bold]:mapping=tex-text" at 8pt \font\eighttt="[lmmono8-regular]:mapping=tex-text" at 8pt % extended definition of \footnotesize \def\footnotesize{\def\rm{\eightrm}\def\it{\eightit}\def\bf{\eightbf}\def\tt{\eighttt} \normalbaselineskip=10pt \setbox\strutbox=\hbox{\vrule height7pt depth3pt width\z@}% \normalbaselines\rm} \font\footnumberfont="[lmroman8-regular]:mapping=tex-text" at 8pt \newcount\footno \footno=0 \def\footnote{\global\advance\footno by 1 \ifnum\footno>9 \global\footno=1 \fi \let\@sf=\empty% \ifhmode\edef\@sf{\spacefactor=\the\spacefactor}\/\fi% \fnsymbol{\the\footno}\@sf\vfootnote} \long\def\vfootnote#1{\insert\footins\bgroup\footnotesize\noindent \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox% top baseline for broken footnotes \splitmaxdepth\dp\strutbox\floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip {\footnumberfont\fnsymbol{\the\footno}\penalty10000\hskip.5em}\strut#1\futurelet\next\fo@t} \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t \else\let\next\f@t\fi \next} \def\f@@t{\bgroup\aftergroup\@foot\let\next} \def\f@t{\@foot} \def\@foot{\strut\egroup} \def\footstrut{\vbox to\splittopskip{}} \skip\footins=\bigskipamount % space added when footnote is present \count\footins=1000 % footnote magnification factor (1 to 1) \dimen\footins=.8\vsize % maximum footnotes per page \catcode`\@=12 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\footnoterule{} \overfullrule0pt %%%%%%%%%%%%%%%%%%%%%%% % START OF DOCUMENT %%%%%%%%%%%%%%%%%%%%%%% \rm \outline{0}{Alignment} \null\vskip3\baselineskip \centerline{\Rm Alignment} \vskip\baselineskip \noindent Plain \TeX\ has macros to centre, left align and right align text:\medskip \verbatim \def\line{\hbox to\hsize} \def\leftline#1{\line{#1\hss}} \def\rightline#1{\line{\hss#1}} \def\centerline#1{\line{\hss#1\hss}} |endverbatim\medskip \noindent These macros centre, or left align or right align a {\it line}. \centerline{If you try to set a line of text that is wider than the measure with {\tt\string\centerline} it will run it off the edges of the page} \noindent (If you try to set a line of text that is wider than the measure with {\tt\string\centerline} it will run it off the edges of the page.) \marginalia{{\tt\string\centerline}, centering macros\vskip\baselineskip Side notes in this document are set with the \href{http://tug.org/pipermail/tex-eplain/2008-June/000595.html}{\tt\string\marginalia} macro}Here is a multiline equivalent of {\tt\string\centerline} that I found on the internet:\medskip \verbatim \def\centre{\parindent0pt\leftskip=0pt plus 1fil \rightskip=0pt plus 1fil \parfillskip=0pt\parskip=0pt\obeylines} |endverbatim\medskip It could be used in a heading macro if the headings are quite long, or where the measure is narrow, e.g. in multi-column setting:\medskip \verbatim \def\heading#1{\goodbreak\bigskip {\centre\Rm\spaceskip.4em#1\par} \nobreak\smallskip\nobreak\vp} |endverbatim\medskip The purpose of {\tt\string\goodbreak} before the text and {\tt\string\nobreak} after it is to avoid the situation where a heading comes by itself at the bottom of a page with its text following on the next page. (It is saying `please do a page break before the heading, not after it'.) The {\tt\string\vp} macro suppresses the paragraph indent immediately after the heading. I've also found a more concise centering macro on page 34 of \href{http://www.ruhr-uni-bochum.de/TeX/einfuehrung-in-tex.pdf}{\it Einführung in \TeX}: \medskip \verbatim \def\zentrierung{\obeylines\everypar{\hfil} \parindent=0pt} |endverbatim\medskip \noindent \marginalia{\tt\string\obeylines}{\tt\string\obeylines} makes each line of input a paragraph. {\tt\string\parindent}{\tt=\break0pt} removes the paragraph indent. \verbatim\everypar{\hfil}|endverbatim\ means that every paragraph-line will have horizontal fill pushing in from the left. But by default every paragraph already has \verbatim\parfillskip=0pt plus 1fil|endverbatim\ to fill up the last line of the paragraph. So every one line paragraph set by this macro has horizontal fill to the left and to the right of it, with the result that the lines are centered. If you were to put \verbatim\parfillskip=0pt|endverbatim\ in this macro the lines would be right justified. (Which would be the same as using \verbatim{\obeylines\everypar{\hfill}...|endverbatim\qquad {\tt\string\hfill} is a stronger horizontal fill than {\tt\string\hfil}.) \medskip \def\zentrierung{\obeylines\everypar{\hfil}\parindent=0pt} {\zentrierung Gott segne Kupfer, Druck und jedes andere vervielfältigende Mittel, so daß das Gute, was einmal da war, nicht wieder zu Grunde gehen kann. }\smallskip \rightline{Johann Wolfgang Goethe\quad} \medskip \outline{1}{raggedright, raggedleft} \marginalia{{\tt\string\raggedright}}For left aligning text longer than a line Plain has the {\tt\string\raggedright} macro: \medskip \verbatim \def\raggedright{\rightskip\z@ plus2em \spaceskip.3333em \xspaceskip.5em\relax} |endverbatim \medskip \noindent {\tt\string\z@} is a Plain \TeX\ abbreviation for 0 or 0pt. \marginalia{{\tt\string\raggedleft}}There is also a {\tt\string\raggedleft} (from the {\tt\string\marginalia} macro): % http://tug.org/pipermail/tex-eplain/2008-June/000595.html \medskip \verbatim \def\raggedleft{\spaceskip=.3333em \xspaceskip=.5em \parfillskip=0pt \leftskip=0pt plus\hsize} |endverbatim\medskip \outline{1}{Setting verse} The {\tt\string\obeylines} command used as part of the centering macros above can also be used to set verse. I centered the longest line of this poem with {\tt\string\centerline}, then I used {\tt\string\leftskip} to push the whole poem rightwards so that it is centered on that longest line. {\tt\string\parindent} is set to {\tt 0pt} to remove the paragraph indent.\medskip \centerline{\Rm The Second Coming}\smallskip {\obeylines\parindent0pt\leftskip2.78em Turning and turning in the widening gyre The falcon cannot hear the falconer; Things fall apart; the centre cannot hold; Mere anarchy is loosed upon the world, The blood-dimmed tide is loosed, and everywhere The ceremony of innocence is drowned; The best lack all conviction, while the worst Are full of passionate intensity. \vskip\baselineskip% lineskip Surely some revelation is at hand; Surely the Second Coming is at hand. The Second Coming! Hardly are those words out When a vast image out of Spiritus Mundi Troubles my sight: somewhere in sands of the desert A shape with lion body and the head of a man, A gaze blank and pitiless as the sun, Is moving its slow thighs, while all about it Reel shadows of the indignant desert birds. The darkness drops again; but now I know That twenty centuries of stony sleep Were vexed to nightmare by a rocking cradle, And what rough beast, its hour come round at last, Slouches towards Bethlehem to be born? } \smallskip \rightline{W. B. Yeats\quad} \medskip \noindent longest line: \centerline{Troubles my sight: somewhere in sands of the desert}\bigskip Somewhat similarly to {\tt\string\obeylines}, the {\tt\string\obeyspaces} command makes \TeX\ take account of each \marginalia{{\tt\string\obeyspaces}}indvidual space character. Normally \TeX, like HTML, collapses more than one space character down into one:\footnote{This applies to the ASCII space U+0020, and No-break Space U+00A0. There are other spaces in Unicode to which this does not apply.} \smallskip {\obeyspaces I ' m a l l s p a c e d o u t.\par} I'm alright really. \redrule \outline{1}{settabs} \marginalia{{\tt\string\settabs}}For more complicated kinds of alignment \TeX\ has the {\tt\string\settabs} command and the {\tt\string\halign} and {\tt\string\valign} commands Here is an example of an alignment made with {\tt\string\settabs}: \medskip \settabs 4\columns \+ one & two & three & four\cr \+eins & zwei & drei & vier\cr \medskip \noindent First you issue a {\tt\string\settabs} command that specifies how \TeX\ should divide the available horizontal space into columns. \verbatim\settabs 4\columns|endverbatim\ divides the {\tt\string\hsize} into four equal columns. Then each row of the actual table consists of the {\tt\string\+} control sequence followed by a list of entries separated by ampersands. The end of a row is indicated by {\tt\string\cr}. The other way of using {\tt\string\settabs} is to write a template line, putting the widest entry for each column of the table in that position of the template, e.g. for this table the first line has the widest entries, so it is also used as template. \medskip % from page 92 of Einführung in TeX % there needs to be an additional ampersand before \cr for \hfill to work in this example \settabs\+sorting algorithm\quad & 100 elements & 200 elements & 500 elements &\cr \+sorting algorithm\quad & 100 elements & 200 elements & 500 elements &\cr \+ bubble sort & \hfill 250 & \hfill 1000 & \hfill 10000 &\cr \+ insertion sort & \hfill 200 & \hfill 400 & \hfill 3000 &\cr \+ selection sort & \hfill 110 & \hfill 260 & \hfill 2000 &\cr \+ shell sort & \hfill 70 & \hfill 250 & \hfill 700 &\cr \+ heap sort & \hfill 50 & \hfill 100 & \hfill 300 &\cr \+ quicksort & \hfill 40 & \hfill 60 & \hfill 200 &\cr \medskip If you want more control over how the columns or rows of a table appear and vertical or horizontal rules you need {\tt\string\halign} or {\tt\string\valign}. \outline{1}{halign} \marginalia{{\tt\string\halign}}% {\tt\string\halign} is kind of similar to {\tt\string\settabs} but the template line gives you much more control over how the table is typeset. The {\tt\#} is used to represent the contents of the columns, and the {\tt\&} the divisions between the columns. If you want a column to be in a particular font it's easier to put the font command in the template. You can also use {\tt\string\hfil} to align the text of the columns~-- \medskip \halign{\strut #\quad&#\hfil\cr \verbatim#\hfil|endverbatim & Text is left aligned \cr \verbatim\hfil#|endverbatim & Text is right aligned \cr \verbatim\hfil#\hfil|endverbatim & Text is centered\cr} \medskip The columns automatically expand to the width of the widest entry e.g.\nl \verbatim \halign{\it#\hfil&#&#&\bf#&#&#&\hfil\tt#\hfil\cr abc & d & e & f & g & h & i\cr a & b & c & d & e & f & ghj\cr} |endverbatim \noindent produces: \halign{\it#\hfil&#&#&\bf#&#&#&\hfil\tt#\hfil\cr abc & d & e & f & g & h & i\cr a & b & c & d & e & f & ghj\cr} Space before an ampersand in the template is taken account of, but space after it seems not to be: \eject \verbatim \halign{# &#&#&#& #\cr a&b&c&d&e\cr} |endverbatim \noindent makes\smallskip \halign{# &#&#&#& #\cr a&b&c&d&e\cr} \medskip \noindent So if you find a really long template hard to read, you can divide it up cell by cell by pressing carriage return after the ampersands. Deleting the spaces in front of the ampersand in {\it all} the rows of the table also seems to get rid of spaces between the affected columns, but generally you want there to be spaces between the columns. Usually when I create a table I put spaces on either side of {\tt\&} and then use the tab key to even out the {\tt\&}s, to make the input easier to read. If you know in advance how many columns and rows your table will have, you can write the template and space the amperands in the rows with the tab key: \medskip \verbatim \halign{#&#&#&#&#&#&#\cr & & & & & & \cr & & & & & & \cr} |endverbatim \medskip \noindent (If you run \TeX\ now it will just produce an empty {\tt\string\halign}.) Now you can can set the template for each column and fill in the blanks in the table: \medskip \verbatim \halign{\it#\hfil&#&#&\bf#&#&#&\hfil\tt#\hfil\cr abc & d & e & f & g & h & i \cr a & b & c & d & e & f & ghj \cr} |endverbatim \medskip \noindent This is slightly easier to read than the first attempt. If you have an alignment which is made up of the same template repeated an unspecified number of times you can use {\tt\&\&} to repeat the template information as often as it is needed: \verbatim \halign{\it#&&\it#\cr a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&...\cr} |endverbatim \noindent makes\smallskip \halign{\it#&&\it#\cr a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&...\cr} \outline{1}{tabskip} \marginalia{{\tt\string\tabskip}}The {\tt\string\tabskip} command allows you to set the glue between columns of a {\tt\string\halign} (or rows of a {\tt\string\valign}). If you set {\tt\string\tabskip} globally outside of a {\tt\string\halign} there will be the same space between all the columns of the table and to the left and right of the table. In the first line of letters below, \verbatim\tabskip0pt plus 1fil|endverbatim\ has been set this way. This is equivalent to having a {\tt\string\hfil} between the columns and on either side of the alignment. In the second line, \verbatim\tabskip0pt plus 1fil|endverbatim\ has been set within the {\tt\string\halign} and only takes effect after the first column. This and \verbatim\tabskip0pt|endverbatim\ set in the last column, means that this alignment has no space to the left and right of it: \smallskip {\tabskip0pt plus 1fil \halign to\hsize{\strut#&#&#&#&#&#&#&#&#\cr a & b & c & d & e & f & g & h & i\cr} } \halign to\hsize{\strut\tabskip0pt plus 1fil#&#&#&#&#&#&#&#&#\tabskip0pt\cr a & b & c & d & e & f & g & h & i\cr} \smallskip \noindent \verbatim\halign to\hsize|endverbatim\ creates an alignment that fills the entire width of the text block. \medskip \outline{1}{ruled tables} \marginalia{ruled tables}% Some examples of ruled tables: {\tt\string\halign}s (i--iv) and a {\tt\string\valign} (v). \medskip % These four \haligns are contained in an outer \halign % like this: % \halign{#&#&#&#\cr % \vtop{\halign{}}&\vtop{\halign{}}& % \vtop{\halign{}}&\vtop{\halign{}}\cr} {\offinterlineskip \halign to \hsize{\strut\tabskip0pt plus 1fil#&#&#&#\tabskip0pt\cr% outer \halign \vbox{ \halign{\strut% (i) \vrule\hbox to1.2em{\ #\hfil}&% template for first column \vrule\hbox to1.2em{\ #\hfil}&% template for second column \vrule\hbox to1.2em{\ #\hfil}\vrule\cr% template for third column \multispan3\strut\hfil (i)\hfil\cr \noalign{\vskip3pt} \noalign{\hrule} a & b & c \cr% first row \noalign{\hrule} d & e & f \cr% second row \noalign{\hrule} g & h & i \cr% third row \noalign{\hrule} }} & \vbox{ \halign{\strut% (ii) \vrule\hbox to1.2em{\ #\hfil}&% template for first column \vrule\hbox to1.2em{\ #\hfil}&% template for second column \vrule\hbox to1.2em{\ #\hfil}\vrule\cr% template for third column \multispan3\strut\hfil (ii)\hfil\cr \noalign{\vskip3pt} \noalign{\hrule} a & b & c \cr% first row \omit\vrule&\multispan1\hrulefill&\omit\vrule\cr d & e & f \cr% second row \multispan1\hrulefill&\omit&\multispan1\hrulefill\cr g & h & i \cr% third row \noalign{\hrule} } } & \vbox{ \halign{\strut% (iii) \vrule#&% vertical rule \hbox to1.2em{\ #\hfil}&% template for first column \vrule#&% vertical rule \hbox to1.2em{\ #\hfil}&% template for second column \vrule#&% vertical rule \hbox to1.2em{\ #\hfil}&% template for third column #\vrule\cr% vertical rule \multispan7\strut\hfil (iii)\hfil\cr \noalign{\vskip3pt} \noalign{\hrule} & a && b && c &\cr% first row \noalign{\hrule} & d && e && f &\cr% second row \noalign{\hrule} & g && h && i &\cr% third row \noalign{\hrule} } } & \vbox{ \halign{\strut% (iv) \vrule#&% vertical rule \hbox to1.2em{\ #\hfil}&% template for first column \vrule#&% vertical rule \hbox to1.2em{\ #\hfil}&% template for second column \vrule#&% vertical rule \hbox to1.2em{\ #\hfil}&% template for third column #\vrule\cr% vertical rule \multispan7\strut\hfil (iv)\hfil\cr \noalign{\vskip3pt} \noalign{\hrule} & a && b && c &\cr% first row \omit\vrule& &\multispan3\hrulefill& &\cr & d && e && f &\cr% second row \multispan3\hrulefill&\omit&\multispan3\hrulefill\cr & g && h && i &\cr% third row \noalign{\hrule} } } \cr} } {\strut\vfil(v)\vskip3pt \hsize1.2em\parindent0pt \offinterlineskip \valign{ \hrule#&% horizontal rule \ #\strut&% template for first row \hrule#&% horizontal rule \ #\strut&% template for second row \hrule#&% horizontal rule \ #\strut&% template for third row #\hrule\cr% horizontal rule \noalign{\vrule} & a && d && g &\cr% first column \noalign{\vrule} & b && e && h &\cr% second column \noalign{\vrule} & c && f && i &\cr% third column \noalign{\vrule} } } \medskip In a {\tt\string\halign} continuous horizontal rules are created by placing \verbatim\noalign{\hrule}|endverbatim\ above and below the table and between the rows of the table. Vertical rules are created row by row by putting {\tt\string\vrule} in the template. You also need to have a {\tt\string\strut} in the template to space the rows properly and to make the {\tt\string\vrule}s continuous. When I first started doing ruled tables I made the template like in (i) and (ii), putting the {\tt\string\vrule}s in the same cells as the text: \smallskip \verbatim \halign{\strut\vrule#&\vrule#&\vrule#\vrule\cr |endverbatim\smallskip \noindent This works fine if there are only continuous horizontal lines in the table, but if for some reason you need non-continuous horizontal lines, e.g. in (ii), it does not work very well. The only way to avoid the nicks in the second and fourth vertical rule in (ii) is to write the table so that each {\tt\string\vrule} has its own cell: \smallskip \verbatim \halign{\strut \vrule#&#&\vrule#&#&\vrule#&#&#\vrule\cr |endverbatim\smallskip In the method used in (i) and (ii) I counted the columns and for every $n$ columns there were $n$ {\tt\#}s and $n-1$ {\tt\&}s in each input line (the same as for an unruled table). In the method used in (iii) and (iv) I counted the vertical rules and for every $n$ vertical rules there were $2n-2$ {\tt\&}s and $2n-1$ {\tt\#}s. Or, if you count the columns with text in them, for $n$ columns there are $2n$ {\tt\&}s and $2n+1$ {\tt\#}s. Here is a pseudocode input line showing were the vertical rules go: \smallskip {\obeyspaces\tt \vrule\& \&\vrule\& \&\vrule\& \&\vrule\string\cr }\smallskip Another advantage of giving each {\tt\string\vrule} its own cell is that if you use {\tt\string\tabskip} to space out the cells it is applied on both sides of the {\tt\string\vrule}: \smallskip \halign{\strut\tabskip.25em \vrule#& #& \vrule#& #& \vrule#& #& \vrule#& #& \vrule#& #& \vrule#& #& \vrule#& #& \vrule#& #& \vrule#& #& \vrule# \tabskip0pt\cr \noalign{\hrule} & 1&& 2&& 3&& 4&& 5&& 6&& 7&& 8&& 9&\cr \noalign{\hrule} } \smallskip \noindent If you put the {\tt\string\vrule} in the same cell as the text it is not: \smallskip \halign{\strut\tabskip.25em \vrule#& \vrule#& \vrule#& \vrule#& \vrule#& \vrule#& \vrule#& \vrule#& \vrule#\vrule \tabskip0pt\cr \noalign{\hrule} 1& 2& 3& 4& 5& 6& 7& 8& 9\cr \noalign{\hrule} } \smallskip The lines with the non-continuous {\tt\string\hrule}s in them are kind of hard to figure out. They have an {\tt\string\omit} in them and {\tt\string\multispan} and {\tt\string\hrulefill} to get a {\tt\string\hrule} over multiple cells. {\tt\string\offinterlineskip} being in force means that they only take up the {\tt height} of a {\tt\string\hrule} (0.4pt by default). I started with a normal input line and modified it to suit: \smallskip \verbatim & && && &\cr \omit\vrule& &\multispan3\hrulefill& &\cr |endverbatim\smallskip I followed the example given in {\it Einführung in \TeX}, pp. 106–107. See also \href{http://texdoc.net/texmf-dist/doc/plain/texbytopic/TeXbyTopic.pdf}{\it\TeX\ by Topic}, 25.4.4. If you want non-continuous vertical lines in a {\tt\string\halign}, all you have to do is put {\tt\string\omit} in the cell where you don't want a {\tt\string\vrule}. {\tt\string\valign} is a bit like {\tt\string\halign} turned sideways: the lines terminated by {\tt\string\cr} go down the way instead of across. You have to use {\tt\string\hsize} to specify the width of the columns, otherwise the first column will likely take up the entire measure. You can do that for the whole table like this: \verbatim {\hsize1.2em\parindent0pt \valign{} } |endverbatim In the {\tt\string\valign} the vertical rules are continuous, created by putting \verbatim\noalign{\vrule}|endverbatim\ in the same places as \verbatim\noalign{\hrule}|endverbatim\ in the {\tt\string\halign}, and the horizontal lines are created column by column by putting {\tt\string\hrule}s in the template. In the {\tt\string\valign} you also need to put a {\tt\string\strut} in each of the cells of the template to make the letters align properly. In the {\tt\string\halign}s I used the \verbatim\hbox to1.2em{}|endverbatim\ construction to equalize the widths of the {\tt\string\halign}s and the {\tt\string\valign}. \medskip A table with non-continuous horizontal and vertical lines, from {\it The Loom of Language}: \vskip-\bigskipamount % from `The Loom of Language' by Frederick Bodmer % p. 293 % https://archive.org/details/in.ernet.dli.2015.126692/page/n305/mode/2up % a macro to \smash and \lower text % the first parameter is the amount to lower the text % expressed in terms of \baselineskip, the second is the % text itself \def\smlower#1#2{\smash{\lower#1\baselineskip\hbox{#2}}} \def\head#1{\vtop{\vskip-5pt\vfil\centre\hsize 11.5mm#1\strut\vfil}} $$\vbox{ \setbox\strutbox=\hbox{\vrule height11.5pt depth6.5pt width0pt} \offinterlineskip \baselineskip18pt% needed for the \smlower macro to work \def\eightpoint{\def\rm{\eight}\def\sc{\eightsc}\rm} \eightpoint \halign{\eightpoint\strut #&% I deleted the first and last \vrule of the table % to copy the style of the book \hbox to12mm{#\hfil}&% text column \vrule#&% vertical rule \hbox to12mm{\sc#\hfil}& \vrule#& \hbox to12mm{\sc#\hfil}& \vrule#& \hbox to12mm{\sc#\hfil}& \vrule#& \hbox to12mm{\sc#\hfil}& \vrule#& \hbox to12mm{\sc#\hfil}& \vrule#& \hbox to12mm{\sc#\hfil}& \vrule#& \hbox to12mm{\sc#\hfil}& #\cr %& && && && && && && && &\cr% blank input line used in constructing the table \noalign{\hrule} & && \head{masc. sing.} && \head{neuter sing.} && \head{femin. sing.} && \head{plural} && \head{masc.} && \head{neuter} && \head{femin.} &\cr \noalign{\hrule} & \ Nomin. && \ der && \smlower{.5}{\ das} && \multispan3\sc\hfil \smlower{.5}{die}\hfil && \multispan3\sc\ ein && \smlower{.5}{\ eine} &\cr \omit&\multispan4\hrulefill& && &\omit& &&\multispan2\hrulefill && &\cr & \ Acc. && \ den && && &\omit& && \ einen && && &\cr \noalign{\hrule} & \ Gen. && \multispan3\sc\hfil des\hfil && \multispan3\sc\hfil der\hfil && \multispan3\sc\ eines && \smlower{.5}{\ einer} &\cr \omit&\multispan5\hrulefill& && \multispan7\hrulefill& &\cr & \ Dat. && \multispan3\sc\hfil dem\hfil && && \ den && \multispan3\sc\ einem && &\cr \noalign{\hrule} } }$$ \medskip A table of the 16 possible truth functions of two binary variables (from \href{https://en.wikipedia.org/wiki/Truth_table}{Wikipedia}): \medskip % `notgets': `Converse nonimplication' \def\notgets{\hbox{$\kern2pt\not\kern-2pt\gets$}} % enclosing a \halign in $$\vbox{}$$ is a trick to centre it horizontally % and put some space above and below it % `$$' and `$$' put it in display math mode, but the \vbox % excerpts it from math typesetting rules $$\vbox{\vskip-\baselineskip \setbox\strutbox=\hbox{\vrule height10.5pt depth3.5pt width0pt} \offinterlineskip \halign{\strut \vrule#& \ \hfil #\hfil& \vrule#& \ \hfil#\hfil& \vrule\kern1.2pt\vrule#& \ \hfil#\hfil& \vrule#& \ \hfil#\hfil& \vrule#& \ \hfil#\hfil& \vrule#& \ \hfil#\hfil& \vrule#& \ \hfil#\hfil& \vrule#& \ \hfil#\hfil& \vrule#& \ \hfil#\hfil& \vrule#& \ \hfil#\hfil& #\vrule\cr %& && && && && && && && && && &\cr% blank input line \noalign{\hrule} &\it p && \it q && F$^0$ && NOR$^1$ && \notgets$^2$ && $\neg$p$^3$ && $\not\to$$^4$ && $\neg$q$^5$ && XOR$^6$ && NAND$^7$&\cr\noalign{\hrule} &T && T && F && F && F && F && F && F && F && F &\cr\noalign{\hrule} &T && F && F && F && F && F && T && T && T && T &\cr\noalign{\hrule} &F && T && F && F && T && T && F && F && T && T &\cr\noalign{\hrule} &F && F && F && T && F && T && F && T && F && T &\cr\noalign{\hrule} &\multispan3\hfil Com\hfil && \sym✓ && \sym✓ && && && && && \sym✓ && \sym✓ &\cr\noalign{\hrule} &\multispan3\hfil L id \hfil && && && F && && && && F && &\cr\noalign{\hrule} &\multispan3\hfil R id \hfil && && && && && F && && F && &\cr\noalign{\hrule} \noalign{\vskip12pt}\noalign{\hrule} &\it p && \it q && AND$^8$ && XNOR$^9$ && q$^{10}$ && $\to^{11}$ && p$^{12}$ && $\gets^{13}$ && OR$^{14}$ && T$^{15}$&\cr\noalign{\hrule} &T && T && T && T && T && T && T && T && T && T &\cr\noalign{\hrule} &T && F && F && F && F && F && T && T && T && T &\cr\noalign{\hrule} &F && T && F && F && T && T && F && F && T && T &\cr\noalign{\hrule} &F && F && F && T && F && T && F && T && F && T &\cr\noalign{\hrule} &\multispan3\hfil Com\hfil && \sym✓ && \sym✓ && && && && && \sym✓ && \sym✓ &\cr\noalign{\hrule} &\multispan3\hfil L id \hfil && T && T && T,F && T && && && F && &\cr\noalign{\hrule} &\multispan3\hfil R id \hfil && T && T && && && T,F && T && F && &\cr\noalign{\hrule} } }$$ \medskip The superscript numbers in the first line of the table refer to the first column of the wide table below. I used \verbatim\setbox\strutbox=\hbox{\vrule height10.5pt depth3.5pt width0pt}|endverbatim\ to space out the rows of these tables. This makes {\tt\string\strut} in these tables slightly taller than it would normally be ({\tt height=8.5pt} is the default Plain \TeX\ setting). Roughly the same effect could be achieved by putting \verbatim\noalign{\vskip2pt}|endverbatim\ between the rows of the table. This would work fine in a table without vertical rules, but causes gaps between the {\tt\string\vrule}s in tables with vertical rules. Extending the {\tt\string\strut}s ensures that there are no gaps in the vertical rules. \medskip % This table turned out to be wider than the measure (\hsize) % of this document. % I put it in a \vbox and used the \moveleft command to try % and centre it in the total page width \moveleft1em\vbox{ \font\rm=cmr8% I made this table a bit smaller by resetting \rm% the roman font and the Math Symbol font to 8pt \font\eightsy=cmsy8 \textfont2=\eightsy %\setbox\strutbox=\hbox{\vrule height10.5pt depth3.5pt width0pt} \offinterlineskip \halign{\strut \vrule#& \ \hfil#& \tabskip.25em\vrule#& \ #\hfil& \vrule#& \ #\hfil& \vrule#& \ #\hfil& \vrule#& \ #\hfil& \vrule#\tabskip0pt\cr %& && && && && &\cr% blank input line \noalign{\hrule} & && && && operator && Operation name&\cr \noalign{\hrule} &0 && (F F F F)(p, q) && $\bot$ && false, Opq && Contradiction &\cr \noalign{\hrule} &1 && (F F F T)(p, q) && NOR && p $\downarrow$ q, Xpq && Logical NOR&\cr \noalign{\hrule} &2 && (F F T F)(p, q) && \notgets && p $\notgets$ q, Mpq && Converse nonimplication &\cr \noalign{\hrule} &3 && (F F T T)(p, q) && $\neg$p, $\sim$p && $\neg$p, Np, Fpq && Negation &\cr \noalign{\hrule} &4 && (F T F F)(p, q) && $\not\to$ && p $\not\to$ q, Lpq && Material nonimplication &\cr \noalign{\hrule} &5 && (F T F T)(p, q) && $\neg$q, $\sim$q && $\neg$q, Nq, Gpq && Negation&\cr \noalign{\hrule} &6 && (F T T F)(p, q) && XOR && p $\oplus$ q, Jpq && Exclusive disjunction&\cr \noalign{\hrule} &7 && (F T T T)(p, q) && NAND && p $\uparrow$ q, Dpq && Logical NAND&\cr \noalign{\hrule} &8 && (T F F F)(p, q) && AND && p $\land$ q, Kpq && Logical conjunction&\cr \noalign{\hrule} &9 && (T F F T)(p, q) && XNOR && p if and only if q, Epq && Logical biconditional&\cr \noalign{\hrule} &10 && (T F T F)(p, q) && q && q, Hpq && Projection function&\cr \noalign{\hrule} &11 && (T F T T)(p, q) && p $\to$ q && if p then q, Cpq && Material implication&\cr \noalign{\hrule} &12 && (T T F F)(p, q) && p && p, lpq && Projection function&\cr \noalign{\hrule} &13 && (T T F T)(p, q) && p $\gets$ q && p if q, Bpq && Converse implication&\cr \noalign{\hrule} &14 && (T T T F)(p, q) && OR && p $\lor$ q, Apq && Logical disjunction&\cr \noalign{\hrule} &15 && (T T T T)(p, q) && $\top$ && true, Vpq && Tautology&\cr \noalign{\hrule} } } \medskip The second column of this table is just the numbers in the first column converted to binary, with ‘T’ standing for ‘1’ and ‘F’ standing for ‘0’, e.g. no. 8, Logical AND: TFFF = 1000, $1000_2 = 8_{10}$. \medskip \eject \def\xor{$\underline{\lor}$} \def\xnor{$\underline{\land}$} %(Bottom of page \xref{smalltruthtable}) Another table, showing the use of {\tt\string\multispan} to put a heading above a table: \medskip %\definexref{smalltruthtable}{\folio}{pagenumber} {\offinterlineskip \setbox\strutbox=\hbox{\vrule height10.5pt depth3.5pt width0pt} \halign{\strut \vrule#& \hfil\ #\ \hfil& \vrule#& \hfil\ #\ \hfil& \vrule\kern1.2pt\vrule#& \hfil\ #\ \hfil& \vrule#& \hfil\ #\ \hfil& \vrule#& \hfil\ #\ \hfil& \vrule#& \hfil\ #\ \hfil& \vrule#& \hfil\ #\ \hfil& \vrule#& \hfil\ #\ \hfil& \vrule#& \hfil\ #\ \hfil& #\vrule\cr %& && && && && && && && && &\cr% blank input line \multispan{19}\hfil\strut Truth table for most commonly used logical operators\hfil\cr \noalign{\vskip2pt}\noalign{\hrule} & P&& Q&& P $\land$ Q&& P $\lor$ Q&& P \xor\ Q&& P \xnor\ Q&& P $\Rightarrow$ Q&& P $\Leftarrow$ Q&& P $\Leftrightarrow$ Q&\cr \noalign{\hrule} & T&& T&& T&& T&& F&& T&& T&& T&& T&\cr\noalign{\hrule} & T&& F&& F&& T&& T&& F&& F&& T&& F&\cr\noalign{\hrule} & F&& T&& F&& T&& T&& F&& T&& F&& F&\cr\noalign{\hrule} & F&& F&& F&& F&& F&& T&& T&& T&& T&\cr\noalign{\hrule} } } \medskip \gutter=5pt% inter-column space setting for the \doublecolumns macro \noindent where: {\doublecolumns\ninepoint \settabs\+xxx&xxxxxxxxxxxxxxxx\cr \+T & true\cr \+F & false\cr \+$\land$ & AND (logical conjunction)\cr \+$\lor$ & OR (logical disjunction)\cr \+\xor & XOR (exclusive or)\cr \+\xnor & XNOR (exclusive nor)\cr \+$\Rightarrow$ & conditional ``if-then"\cr \+$\Leftarrow$ & conditional ``then-if"\cr \+$\Leftrightarrow$ & biconditional ``if-and-only-if".\cr } \singlecolumn \medskip A more modern kind of table (not so many lines, colour):\smallskip % timetable from: % http://www.irishrail.ie/media/09_dublin-belfast.pdf % A macro to create a colored \hrule equal to the height and depth of the \strut % of the following table. The width is that of the enclosing box. % I got the RGB color values from https://www.rapidtables.com/web/color/RGB_Color.html % The values (255, 204, 204) have to be divided by 255 to work in XeTeX. % \noalign{\pinkbar} prints the pink bar, then \noalign{\vskip-\baselineskip} shifts % the following line up a \baselineskip, printing it over the pink bar. % I used the same technique for the headings in the two following tables. \def\pinkbar{ \special{color push rgb 1 0.8 0.8}% \hrule height10.5pt depth4.5pt% \special{color pop}} % The equivalent macro for pdftex and LuaTeX % pdftex code from % https://tex.stackexchange.com/questions/133147/how-to-use-pdfcolorstack % use these 3 definitions for LuaTeX v0.85 and later %\def\pdfcolorstack{\pdfextension colorstack} %\def\pdfnewcolorstack{\pdffeedback newcolorstack} %\def\pdfcolorstackinit{\pdffeedback colorstackinit} %\chardef\Color=\pdfcolorstackinit page direct{0 g 0 G} %\def\pinkbar{ %\pdfcolorstack \Color push {1 0.8 0.8 rg 1 0.8 0.8 RG} %\hrule height10.5pt depth4.5pt% %\pdfcolorstack \Color pop {} %} \def\sundays{\vtop{\sansb\noindent\hsize2em\baselineskip10pt Sun\break Only\strut}} {\sans \baselineskip15pt %\offinterlineskip% using \offinterlineskip in this table causes strange things % to happen %\lineskip0pt% sometimes has the same effect as \offinterlineskip (i.e. closes gaps in % \vrules), but doesn't seem to make a difference in this table \setbox\strutbox=\hbox{\vrule height10.5pt depth4.5pt width0pt} \halign{\strut \vrule width0.8pt#& \ \sansb#\hfil& \vrule#& \ Dep#\ \hfil& \vrule#& \ #\hfil& \vrule#& \ #\hfil& \vrule#& \ #\hfil& \vrule#& \ #\hfil& \vrule#& \ #\hfil& \vrule width0.8pt#\cr %& && && && && && && &\cr% blank input line \noalign{\hrule height 0.8pt} & && \omit && \sym🍴🍵 && \sym🍴🍵 && \sym🍴🍵 && \sym🍴🍵 && \sym🍴🍵 &\cr & && \omit && \sundays && \sundays && \sundays && \sundays && \sundays &\cr \noalign{\pinkbar}\noalign{\vskip-\baselineskip} \noalign{\hrule height 0.8pt} &BELFAST Lanyon Place && && 09.00 && 11.05 && 13.05 && 16.05 && 19.05 &\cr &Lisburn && && 09.13 && \hfil. . && \hfil. . && \hfil. . && \hfil. . &\cr \noalign{\pinkbar}\noalign{\vskip-\baselineskip} &Lurgan && && 09.32 && \hfil. . . . && \hfil. . . . && \hfil. . . . && \hfil. . . . &\cr &Portadown && && 09.40 && 11.36 && 13.36 && 16.36 && 19.36 &\cr \noalign{\pinkbar}\noalign{\vskip-\baselineskip} &Newry && && 10.01 && 11.58 && 13.58 && 16.58 && 19.58 &\cr &DUNDALK Clarke && && 10.19 && 12.17 && 14.17 && 17.17 && 20.17 &\cr \noalign{\pinkbar}\noalign{\vskip-\baselineskip} &DROGHEDA MacBride && && 10.40 && 12.40 && 14.40 && 17.40 && 20.40 &\cr &DUBLIN Connolly &&\omit\ Arr\hfil && 11.20 && 13.15 && 15.15 && 18.15 && 21.15 &\cr \noalign{\hrule height 0.8pt}% I used \hrule height 0.8pt and \vrule width0.8pt % to create a heavier border around the table. The default thickness of TeX rules % is 0.4pt. } } \bigskip \outline{1}{table commands} \marginalia{table commands}% A table from David Bausum's \TeX\ \href{http://www.tug.org/utilities/plain/cseq.html#Tables-fam}{page} giving the primitive \TeX\ commands relating to tables. I set the table headings O'Reilly-style in white type on a black backround.\medskip % macro for a black line with height8.5pt, depth3.5pt and % width equal to \hsize \def\blackbar{\special{color push rgb 0 0 0}% \hrule height8.5pt depth3.5pt% \special{color pop}} \font\whitett="[lmmonolt10-bold]:color=fefefe" at 10pt \vbox{\lineskip0pt %\openup2pt% an alternative to putting \noalign{\vskip2pt} % between the table rows \baselineskip12pt \halign to\hsize{\strut \tabskip.75em\tt#\hfil& #\hfil& \vtop{\hsize.69\hsize\noindent#\strut}\tabskip0pt\cr % I used \noalign{\blackbar} to make a black \hrule 12pt high, % then used \noalign{\vskip-\baselineskip} to overlay the line % with white type \noalign{\blackbar}\noalign{\vskip-\baselineskip} \whitett\thinspace CtrlSeq & \whitett Type & \whitett Description\strut \cr \noalign{\vskip2pt} \string\cr & c & is a visible command which ends one row in a table.\cr \noalign{\vskip2pt} \string\crcr & c & is an alternate to {\tt\string\cr}.\cr \noalign{\vskip2pt} \string\everycr & pt & holds tokens inserted after every {\tt\string\cr} or nonredundent {\tt\string\crcr}.\cr \noalign{\vskip2pt} \string\halign & c & begins the horizontal alignment of material (i.e., makes a table containing rows).\cr \noalign{\vskip2pt} \string\noalign & c & inserts vertical mode material after a {\tt\string\cr} in a table.\cr \noalign{\vskip2pt} \string\omit & c & is used in the body of a table to change an entry's template from the one in the preamble.\cr \noalign{\vskip2pt} \string\span & c & combines adjacent entries in a table into a single entry.\cr \noalign{\vskip2pt} \string\tabskip & pg & is optional glue put between columns in a table.\cr \noalign{\vskip2pt} \string\valign & c & begins the vertical alignment of material (i.e., makes a table containing columns).\cr} } \medskip \noindent In this table, c = command, pg = Parameter (glue), pt = Parameter (token). This table shows the use of {\tt\string\vtop} to set entries that are too wide to fit in a single row of a column. Putting them inside a {\tt\string\vtop} allows them to be set as short paragraphs. I used \verbatim\noalign{\vskip2pt}|endverbatim\ here instead of the enlarged {\tt\string\strut} that I used in the truth tables because I only wanted to add space between the entries. Using the {\tt\string\strutbox} method would also have spaced out the lines of the {\tt\string\vtop}s. Actually I could have done it equivalently by setting \verbatim\setbox\strutbox=\hbox{\vrule height10.5pt depth3.5pt width0pt}|endverbatim\ globally in the table and putting the normal Plain \TeX\ {\tt\string\strut} inside the braces of the {\tt\string\vtop}. This is how I did it in this second table of Plain \TeX\ table commands (definitions from {\it\TeX\ for the Impatient}). \medskip\eject % strut setting for normal Plain TeX 12pt \baselineskip \def\normalstrut{% \setbox\strutbox=\hbox{\vrule height8.5pt depth3.5pt width0pt}% } \def\blackbar{\special{color push rgb 0 0 0}% \hrule height8.5pt depth3.5pt% \special{color pop}} \definexref{halignglossary}{\folio}{pagenumber} \vbox{\lineskip0pt \setbox\strutbox=\hbox{\vrule height10.5pt depth3.5pt width0pt}% \baselineskip14pt \halign to\hsize{\strut \tabskip1em\tt#\hfil& \vtop{\hsize.64\hsize\noindent\baselineskip12pt\normalstrut#\strut}\tabskip0pt\cr \noalign{\blackbar}\noalign{\vskip-\baselineskip} \whitett\thinspace CtrlSeq & \whitett\vrule height8.5pt depth3.5pt width0pt Description \cr \string\hidewidth & ignore width of an entry in an alignment, so that it extends out from its box in the direction of the {\tt\string\hidewidth}. \cr \string\multispan & make next alignment entry span a specified number of columns (or rows). \cr \string\offinterlineskip & inhibit interline glue from now on.\nl (Used in alignments in conjunction with {\tt\string\strut}.) \cr \string\openup & increase {\tt\string\baselineskip}, {\tt\string\lineskip}, and {\tt\string\lineskiplimit} by a specified amount \cr \string\strut & box with zero width, but height and depth of a standard line, from baseline to baseline, in the current font. \cr } } \medskip \outline{1}{dotfill, etc} \marginalia{{\tt\string\dotfill}, {\tt\string\hrulefill} etc.}\TeX\ has various `fill' commands to fill up a horizontal space with a pattern or rule, e.g. {\tt\string\dotfill} and {\tt\string\hrulefill}: \medskip \noindent 1\dotfill2 \noindent 1\hrulefill2 \bigskip \noindent {\tt\string\leftarrowfill} and {\tt\string\rightarrowfill}: \medskip \hbox to \hsize{\vrule\leftarrowfill\ {\tt\string\hsize} \rightarrowfill\vrule} \bigskip \noindent {\tt\string\downbracefill} and {\tt\string\upbracefill}: \noindent \downbracefill \noindent \upbracefill \medskip \outline{1}{leaders} \marginalia{{\tt\string\leaders}}% There are also {\tt\string\leaders}, {\tt\string\cleaders} and {\tt\string\xleaders} which fill a horizontal or vertical space with copies of a pattern. These commands can be used in the typesetting of old-fashioned contents pages, e.g. in the {\tt\string\halign} below \verbatim\leaders\hbox{ . }\hfil|endverbatim\ fills the space between the second and third columns with repeating dots: \medskip % from the contents page of `Plain Printing Types' % (vol. 1 of `The Practice of Typography') % by T.L. De Vinne % https://archive.org/details/practiceoftypogr00devirich/page/n11 \halign to \hsize{\strut \hbox to 2em{\hfil\sc#}\quad& \hbox to 82.35mm{#{\leaders\hbox{ . }\hfil}}& \hfil#\cr \multispan3\eightscw chapter\hfil page\cr %\noalign{\vskip.25\baselineskip} i & The Process of Type-making & 9\cr ii & The Names of the Leading Sizes of Types & 53\cr iii & The Point System & 123\cr iv & A Font of Type & 165\cr v & Faces or Styles of Type. Old-style Roman & 182\cr vi & Modern Faces of Roman Letter & 209\cr } \medskip With {\tt\string\cleaders} the leaders are centered within the enclosing box (at the expense of vertical alignment): \medskip \halign to \hsize{\strut \hbox to 2em{\hfil\sc#}\quad& \hbox to 82.35mm{#{\cleaders\hbox{ . }\hfil}}& \hfil#\cr vii & Condensed Roman Types & 255\cr viii & Italic Types & 269\cr ix & Fat-face or Title-types & 281\cr x & Black-letter & 291\cr } \medskip {\tt\string\xleaders} seems to try and spread out the leaders as much as possible: \medskip \halign to \hsize{\strut \hbox to 2em{\hfil\sc#}\quad& \hbox to 82.35mm{#{\xleaders\hbox{ . }\hfil}}& \hfil#\cr xi & Gothic & 315\cr xii & Antique Types, Runic, Celtic and Italian & 323\cr xiii & The Classes and Prices of Printing-types & 336\cr } \bigskip In this example I used a macro to create a two dot pattern: % from the contents page of % Ausgewählte Aufsätze über Fragen der Gestalt % des Buches und der Typographie % by Jan Tschichold, % Birkhäuser Verlag, 1975 \def\pattern{\hbox to 12pt{\hfil.\kern1pt.\hfil}} %\def\pattern{\hbox to 12pt{\hfil.\hfil}} $$\vbox{ \eight\uselanguage{ngerman} \halign to76.5mm{\strut \vtop{\hsize73.5mm\noindent\hang\raggedright{#\leaders\pattern\hfill}\strut}& \vtop{\hsize3mm\noindent\raggedleft#\strut}\cr Jan Tschichold & 7\cr Ton in des Töpfers Hand & 9\cr Graphik und Buchkunst & 14\cr Über Typographie & 18\cr Die Bedeutung der Tradition für die Typographie & 31\cr Symmetrische oder asymmetrische Typographie? & 41\cr Willkürfreie Maßverhältnisse der Buchseite und des Satzspiegels &\nl 45\cr} }$$ \medskip A table of pronouns showing the use of {\tt\string\upbracefill}: \medskip % table from p.106 of `A Short Historical English Grammar' % by Henry Sweet % https://archive.org/details/shorthistoricale00sweeiala/page/106 % In this table \input font_palatino calls the math Palatino font from % http://mirror.ox.ac.uk/sites/ctan.org/macros/plain/contrib/font-change/doc/ % to get thinner braces than the ones that Computer Modern provides % I renamed the LM fonts to \lmrm, \lmit, because the standard font names % \rm, \it, \bf, would have have overwritten by font_palatino % In this case all I want from font_palatino is the braces. {\input font_palatino \font\lmrm="[lmroman10-regular]:mapping=tex-text" at 10pt \font\lmit="[lmroman10-italic]:mapping=tex-text" at 10pt \lmrm \halign{\strut \tabskip.5em#\hfil& #\hfil& \lmit#\hfil& \lmit\qquad#\hfil& \lmit#\hfil& \lmit\qquad#\hfil\cr Sing. & Nom. & I & thou, you & who & what \cr & Obj. & me & thee, you & whom\hidewidth & what \cr Plur. & Nom. & we & ye, you & & \cr & Obj. & us & ye, you & & \cr Sing. & Nom. & he & it & she & \cr & Obj. & him & it & her & \cr \noalign{\vskip-5pt} & &\multispan3\upbracefill & \cr \noalign{\vskip-1pt} Plur. & Nom. & & they & & \cr & Obj. & & \smash{them ('em)} & & \cr} } \eject \outline{1}{big braces} \marginalia{big braces}% Some alignments showing the use of \TeX\ math mode together with {\tt\string\halign} to create tables with large braces. E.g. to create this: \smallskip $\left\{\matrix{\vtop{\halign{\strut#\hfil\cr one\cr two\cr three\cr four\cr}}}\right\}$ \smallskip \noindent make up the {\tt\string\halign} first and then paste it over the `x' in this: \verbatim $\left\{\matrix{\vtop{x}}\right\}$ |endverbatim \noindent Placing the {\tt\string\halign} inside a \verbatim\vtop{}|endverbatim\ makes it possible to have a {\tt\string\halign} within math mode and also excerpts it from \TeX's math typesetting rules. If you don't want braces on the left side or the right side use {\tt\string\left.} or {\tt\string\right.} (You can't just leave out {\tt\string\left} or {\tt\string\right}.) Also the {\tt\string\left} can be a right brace: \verbatim\left\}|endverbatim\ and vice versa. \medskip Some examples: % from Hugo's French Verbs Simplified % https://archive.org/details/frenchverbssimpl00hugo/page/24 { % A simpler way to change large braces: % just overwrite the plain.tex \tenex font (Math Extension) %\font\tenex=pxex at 10pt% braces from font_palatino \font\tenex=mdbchr7v at 10pt% " " font_charter %\font\tenex=mdputr7v at 10pt% " " font_utopia %\font\tenex=ex-anttr at 10pt% " " font_antt %\font\tenex=ex-anttl at 10pt% " " font_antt-light %\font\tenex=txex at 10pt% " " font_libertine_times %\font\tenex=cmex10% plain.tex default \textfont3=\tenex \font\rm="[lmroman8-regular]:mapping=tex-text" at 8pt \font\it="[lmroman8-italic]:mapping=tex-text" at 8pt \rm \setbox\strutbox=\hbox{\vrule height7.792pt depth3.208pt width0pt} % In this alignment `or' is repeated in every row, so I put it in the % template. `\/\ ' is italic correction followed by an explicit space. \noindent\hfil {\scw present tense} \hfil\hfil {\scw imperfect {\it or} past}\strut\hfil\hfil \noindent $\left.\matrix{\vtop{\halign{\strut#\hfil&{\it or}\/\ #&#\hfil\cr I call & & I am \cr thou callest & & thou art \cr he calls & & he is \cr we call & & we are \cr you call & & you are \cr they call & & they are \cr}}}\right\}$ \rotatebox{270}{\kern-14.5pt calling}\quad $\left.\matrix{\vtop{\halign{\strut#\hfil&\it{or\/\ }#&#\hfil\cr I called & & I was \cr thou calledst & & thou wast \cr he called & & he was \cr we called & & we were \cr you called & & you were \cr they called & & they were \cr}}}\right\}$ \rotatebox{270}{\kern-14.5pt calling} \vskip\baselineskip \noindent\hfil {\scw future}\strut\hfil {\leftskip0pt plus 1fill\rightskip0pt plus 1fill\noindent $\left.\matrix{\vtop{\halign{\strut#\hfil\cr I shall\cr thou wilt\cr he will\cr we shall\cr you will\cr they will\cr}}}\right\}$ \raise1pt\hbox{call {\it or}} $\left\{\matrix{\vtop{\halign{\strut#\hfil\cr I shall be\cr thou wilt be\cr he will be\cr we shall be\cr you will be\cr they will be\cr}}}\right\}$ \raise1pt\hbox{calling}\par} } \medskip The {\tt\string\halign}s that are on the same level horizontally are stacked over each other in the input, with no blank lines between them e.g. the `Present Tense' and `Imperfect' tables look like this with the {\tt\string\halign}s taken out. The {\tt\string\halign}s go over `x' and `y': \verbatim \noindent $\left.\matrix{\vtop{x}}\right\}$ calling\quad $\left.\matrix{\vtop{y}}\right\}$ calling |endverbatim \eject (Below) an example of using big braces within a {\tt\string\halign}. I made up the table first without the braces, then wrote macros for the braces themselves, to try and make the input a little easier to follow. I've rewritten the macros for the braces. The original way involved too much rewriting of the table. The new macros can be just `dropped in'. You can use {\tt\string\kern} to adjust their horizontal position. The macros use {\tt\string\smash} and {\tt\string\lower} to fit the braces into the table without disturbing the linespacing. The {\tt\string\smlower} macro is used to {\tt\string\smash} and {\tt\string\lower} the words in the cell to the right to align them with the points of the braces. \vfil\vfil % table showing the forms of `do' in various forms of English and in German % from `The Loom of Language' by Frederick Bodmer % p. 263 % https://archive.org/details/in.ernet.dli.2015.126692/page/n275 % macros to manipulate the height and depth of particular lines % in the following table \def\bigstrut{\vrule height12.5pt depth5.5pt width0pt} \def\moreheight{\vrule height12.5pt width0pt} \def\moredepth{\vrule depth5.5pt width0pt} {\offinterlineskip \halign{\strut #\hfil& #\hfil& \vrule\ #\hfil& #\hfil& \vrule\ #\hfil& #\hfil& \vrule\ #\hfil& #\hfil\cr \noalign{\hrule} \multispan2\vtop{\hsize5.2em\centre\sc anglo-\break american\strut} & \multispan2\vrule\vtop{\hsize5.2em\centre\sc bible\break english\strut} & \multispan2\vrule\ \vtop{\vfil\noindent\hsize5.7em\sc old english\vfil\strut} & \multispan2\vrule\ \vtop{\vfil\noindent\hsize5.2em\sc german\vfil\strut}\moreheight \cr I &do &I &do &ic &do &ich &tue \cr you & &thou &doest &thu&dest &du &tust \cr he &does &he &doeth &he &deth &er &tut \cr we & &we & &we & &wir &tun \cr you &do &you &do & ge&doth &ihr &tut \cr they & &they & & hie& &sie &tun\moredepth\cr \noalign{\hrule} I &did &I &did &ic &dyde &ich &tat\moreheight \cr you & &thou &didst &thu &dydest &du &tat(e)st\cr he & &he &did &he &dyde& er&tat \cr we & &we & &we&&wir&taten \cr you & &you & &ge&dydon &ihr &tatet\cr they & &they & &hie& &sie &taten\moredepth\cr \noalign{\hrule} \multispan2I have done\hfil & \multispan2\vrule\ I have done\hfil & \multispan2\vrule\ ic haebbe gedon\ & \multispan2\vrule\ ich habe getan\hfil \bigstrut\cr \noalign{\hrule} \multispan2I had done\hfil & \multispan2\vrule\ I had done\hfil & \multispan2\vrule\ ic haefde gedon\hfil & \multispan2\vrule\ ich hatte getan \hfil\bigstrut\cr \noalign{\hrule} \multispan2\hfil (to) do\hfil & \multispan2\vrule\hfil(to) do\hfil & \multispan2\vrule\hfil don\hfil & \multispan2\vrule\hfil(zu) tun\hfil\bigstrut\cr \noalign{\hrule} } } \vfil\vfil\vfil \eject % original macro % with this macro you write the pronouns in the macro: e.g. % \alignrbrace{2.5}{I\cr you\cr he\cr we\cr you\cr they\cr} % then paste that over the first pronoun, then delete the % other pronouns in the table % The first parameter is the amount to lower the alignment % expressed in terms of \baselineskip. % `deprecated' \def\alignrbrace#1#2{ \smash{\lower#1\baselineskip\hbox{\kern-2.85pt$\left.\matrix{ \vtop{\halign{\strut##\cr#2\crcr}} }\right\}$\kern-2pt}} } % new macros % macros for various sizes of braces % these macros can be pasted next to where you want them in the table % use \kern to adjust horizontal spacing % the macro parameter is the amount to lower the brace in terms of \baselineskip % use braces from Charter math font \def\charterbrace{\font\tenex=mdbchr7v at 10pt \textfont3=\tenex} \def\twolinerightbrace#1{\charterbrace \smash{\lower#1\baselineskip \hbox{$\left.\matrix{ % two lines \null\cr\null\cr}\right\}$\kern-2pt}} } \def\threelinerightbrace#1{\charterbrace \smash{\lower#1\baselineskip \hbox{$\left.\matrix{ % three lines \null\cr\null\cr\null\cr}\right\}$\kern-2pt}} } \def\fourlinerightbrace#1{\charterbrace \smash{\lower#1\baselineskip \hbox{$\left.\matrix{ % four lines \null\cr\null\cr\null\cr\null\cr}\right\}$\kern-2pt}} } \def\sixlinerightbrace#1{\charterbrace \smash{\lower#1\baselineskip \hbox{$\left.\matrix{ % six lines \null\cr\null\cr\null\cr\null\cr\null\cr\null\cr} \right\}$\kern-2pt}} } {\offinterlineskip %\setbox\strutbox=\hbox{\vrule height8.5pt depth3.5pt width0pt} \baselineskip12pt% this is needed for the brace macros \halign{\strut #\hfil& #\hfil& \vrule\ #\hfil& #\hfil& \vrule\ #\hfil& #\hfil& \vrule\ #\ \hfil& #\hfil\cr \noalign{\hrule} \multispan2\ \vtop{\noindent\hsize5.2em\centre\sc anglo-\break american\strut} & \multispan2\vrule\ \vtop{\noindent\hsize5.2em\centre\sc bible\break english\strut} & \multispan2\vrule\ \vtop{\vfil\noindent\hsize5.7em\sc old english\vfil\strut} & \multispan2\vrule\ \vtop{\vfil\noindent\hsize5.2em\sc german\vfil\strut}\moreheight \cr I\kern12pt\twolinerightbrace{.5} &\smlower{.5}{do} &I &do &ic &do &ich &tue \cr you & &thou &doest &thu &dest &du &tust \cr he &does &he &doeth &he &deth &er &tut \cr we\kern4pt\threelinerightbrace{1} & &we\kern4pt\threelinerightbrace{1} & &we\kern-1pt\threelinerightbrace{1} & &wir &tun \cr you & do & you &do & ge &doth &ihr &tut \cr they & & they & & hie & &sie &tun\moredepth\cr \noalign{\hrule} I\kern12pt\sixlinerightbrace{2.5} &\smlower{2.5}{did} &I &did &ic &dyde &ich &tat\moreheight \cr you & &thou &didst &thu &dydest &du &tat(e)st\cr he & &he \kern2pt\fourlinerightbrace{1.5} &\smlower{1.5}{did} &he &dyde& er&tat \cr we & & we & &we\kern-1pt\threelinerightbrace{1}& &wir&taten \cr you & & you & & ge& dydon &ihr &tatet\cr they & & they & & hie& &sie &taten\moredepth\cr \noalign{\hrule} \multispan2I have done\hfil & \multispan2\vrule\ I have done\hfil & \multispan2\vrule\ ic haebbe gedon\hfil\ & \multispan2\vrule\ ich habe getan\hfil \bigstrut\cr \noalign{\hrule} \multispan2I had done\hfil & \multispan2\vrule\ I had done\hfil & \multispan2\vrule\ ic haefde gedon\hfil & \multispan2\vrule\ ich hatte getan \hfil\bigstrut\cr \noalign{\hrule} \multispan2\hfil (to) do\hfil & \multispan2\vrule\hfil(to) do\hfil & \multispan2\vrule\hfil don\hfil & \multispan2\vrule\hfil(zu) tun\hfil\bigstrut\cr \noalign{\hrule} } } \bigskip Another table, slightly trickier than the previous one.\medskip % from `A Grammar of Present-day French', % by J.E. Mansion % p. 130 % https://archive.org/details/in.ernet.dli.2015.50747/page/n131 \def\twolineleftbrace#1{\charterbrace \smash{\lower#1\baselineskip\hbox{$\left\{\matrix{ \null\cr\null\cr}\right.$}}} \def\threelinerightonleftbrace#1{\charterbrace \smash{\lower#1\baselineskip \hbox{$\left\}\matrix{ \null\cr\null\cr\null\cr}\right.$}}} % I rewrote this table using the brace macros from the previous table % and some new ones. % I used \kern to manipulate the position of the braces, e.g. to push % the two-line brace away from `ils' and `elles' so that it seems to be % attached to `les'. % There are also negative \kerns in some of the column templates % and negative \kerns in the headings row to produce a hang paragraph effect. { \font\osf="[lmroman10-regular]:+onum,mapping=tex-text" at 10pt% font with oldstyle figures \halign{\strut\tabskip.5em \quad\it#\hfil&% template for 1st column \bf#\hfil&% 2nd col \bf#\hfil&% 3rd col \bf\kern-2pt#\hfil&% 4th col \bf\kern3pt#\hfil&% 5th col \bf\qquad#\hfil\tabskip0pt\cr% 6th col \multispan6\hfil\rmw PERSONAL PRONOUNS \hfil\cr \noalign{\vskip3pt} \multispan5\hfil\hfil\sc Unstressed\hfil\hfil\hfil & \kern-1em\sc Stressed\cr \noalign{\vskip3pt} \multispan6\sc\hfil\hfil\hfil Singular\hfil\hfil\hfil\hfil\cr \kern-1em Persons &\kern-2em\it Nom. Subj.\kern1em &\kern-1em\it Accus. \kern1em&\kern-.5em\it Dat. &\kern-1em\it Genit.\kern1em& \kern-2.5em\it Nom. and Accus. \cr {\osf 1}st &je &me &me & & moi\cr {\osf 2}nd &tu &te &te & & toi\cr {\osf 3}rd masc. & il &le\kern8pt\twolinerightbrace{.5}\kern-5pt &\smlower{.5}{lui, y} & & \kern-8pt\twolineleftbrace{.5}\kern-3pt lui\cr {\osf 3}rd fem. & elle &la & & \kern-14pt\threelinerightonleftbrace{0}\kern1.6pt en &elle \cr {\osf 3}rd neut. & il &le &y & & \cr {\osf 3}rd reflex.& &se &se & &soi \cr \noalign{\vskip3pt} \multispan6\hfil\hfil\hfil\sc Plural\hfil\hfil\hfil\hfil \cr {\osf 1}st & nous &nous &nous & &nous \cr {\osf 2}nd & vous &vous &vous & &vous\cr {\osf 3}rd masc. & ils\kern20pt\twolinerightbrace{.5}\kern-5pt&\smlower{.5}{les} &\smlower{.5}{leur, y} &\smlower{.5}{en} &\kern-8pt\twolineleftbrace{.5}\kern-3.15pt eux \cr {\osf 3}rd fem. & elles & & & &elles \cr {\osf 3}rd reflex.& &se &se & &soi \cr } } \eject \redrule \outline{0}{Paragraph settings} \outline{1}{hangindent, hangafter} \marginalia{hang paragraphs}Some examples (from {\it Einführung in \TeX}, p. 39) showing various settings of {\tt\string\hangindent} and {\tt\string\hangafter}. The default settings are \verbatim\hangindent=0pt|endverbatim\ and \verbatim\hangafter=1|endverbatim. \medskip \noindent \verbatim\hangindent=2cm\hangafter=-4\noindent|endverbatim \hangindent=2cm\hangafter=-4\noindent Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \medskip \noindent \verbatim\hangindent=2cm\hangafter=4\noindent|endverbatim\nobreak \hangindent=2cm\hangafter=4\noindent Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \medskip \noindent \verbatim\hangindent=-2cm\hangafter=-4\noindent|endverbatim \hangindent=-2cm\hangafter=-4\noindent Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \medskip \noindent \verbatim\hangindent=-2cm\hangafter=4\noindent|endverbatim \hangindent=-2cm\hangafter=4\noindent Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \medskip For a normal hang paragraph you would use the Plain \TeX\ hang command: \verbatim\def\hang{\hangindent\parindent}|endverbatim \noindent in conjunction with {\tt\string\noindent}: \medskip \noindent \verbatim\hang\noindent|endverbatim \hang\noindent {\it Lorem} ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \medskip {\tt\string\hangindent} and {\tt\string\hangafter} are reset to their default values after each paragraph. If you have a lot of text set in hang paragraphs, and you don't feel like placing \verbatim\hang\noindent|endverbatim\ before each paragraph, put this around your paragraphs: \verbatim {\everypar{\setbox0=\lastbox\hang} First paragraph. Second paragraph. }|endverbatim\smallskip e.g. {\everypar{\hang\setbox0=\lastbox} Ampersand: The name given to the contraction of ‘and’, thus: \&. Antiqua: The German name for roman type. Antique paper: A term used to describe any good book paper with a rough surface. {\it Art paper:} A clay-coated paper, especially suitable for half-tone block printing. This is generally produced with a highly glazed surface but when the surface is matt it is known as matt art paper. }\smallskip %It does work if you do it like this: \verbatim\it Art paper: \rm A clay-coated ...|%endverbatim, but that seems a weird way of doing it. You could put {\tt\string\it} in %\verbatim\everypar{}|endverbatim\ and then put {\tt\string\rm} after the colon. But note that hang paragraphing has failed in the fourth paragraph because I put the first two words in \verbatim{\it }|endverbatim. There is a workaround: either put {\tt\string\leavevmode} before \verbatim{\it Art paper:}|endverbatim, or put {\tt\string\global} in {\tt\string\everypar}: \verbatim\everypar{\global\hang\setbox0=\lastbox}|endverbatim. \noindent See \href{https://tex.stackexchange.com/questions/420597/question-re-everypar-hang-paragraphs-plain-tex}{here}. Another way of doing it is to use something similar to the {\tt\string\entry} macro which I used in Glossary63.tex on the Typography page: \eject % from p. 443 of `A Plain TeX Primer' by Malcolm Clark \def\entry#1:#2\par{% \hangindent1.5em\noindent{\it#1:}#2\par} \smallskip \entry Ampersand: The name given to the contraction of ‘and’, thus: \&. \entry Antiqua: The German name for roman type. \entry Antique paper: A term used to describe any good book paper with a rough surface. \medskip \def\hangentry#1{\def\hangobject{\hbox to77.5pt{\it#1\hfil}}\setbox0=\hbox{\hangobject}% \hangindent \wd0 \noindent \hangobject \ignorespaces} Another way of using {\tt\string\hangindent} to set a glossary: \smallskip \hangentry{Ampersand:} The name given to the contraction of ‘and’, thus: \&. \hangentry{Antiqua:} The German name for roman type. \hangentry{Antique paper:} A term used to describe any good book paper with a rough surface. \smallskip \noindent This is adapted from the {\tt\string\hangfrom} macro in Section 18.3.3 of {\it\TeX\ by Topic}. I gave {\tt\string\hangobject} a fixed value close to what I thought would be the longest head word. The end result is kind of similar to the {\tt\string\halign} with {\tt\string\vtop} method on p. \xref{halignglossary}. If the head word is unusually long you will have to break it: \smallskip \hangentry{\smash{\vtop{\noindent\hang Electronic scan-\nl ning and\nl engraving:}}} This is the latest method of colour separation and engraving which can be used in conjunction with either letterpress printing or lithography. \smallskip In the original version {\tt\string\hangobject} takes the width of the head word: \smallskip % `hangfrom' original version \def\hangfrom#1{\def\hangobject{#1}\setbox0=\hbox{\hangobject}% \hangindent \wd0 \noindent \hangobject \ignorespaces} \hangfrom{Ampersand:\ }The name given to the contraction of ‘and’, thus: \&. \hangfrom{Antiqua:\ }The German name for roman type. %\hangfrom{Antique paper:\ } A term used to describe any good book paper with a %rough surface. \hangfrom{Electronic scanning and engraving:\ }This is the latest method of colour separation and engraving which can be used in conjunction with either letterpress printing or lithography. \smallskip \noindent The original macro was probably written with short head words in mind. \medskip A macro for producing a paragraph with a centered last line: \verbatim \def\centrepar{\rightskip 0pt plus -1fil \leftskip 0pt plus 1fil \parfillskip 0pt plus 2fil\relax} |endverbatim\medskip \def\centrepar{\rightskip 0pt plus -1fil\leftskip 0pt plus 1fil\parfillskip 0pt plus 2fil\relax} {\centrepar Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\par} \medskip \outline{1}{parshape} \marginalia{\tt\string\parshape}For more precise control over the shape of a paragraph, \TeX\ has the {\tt\string\parshape} command. This command has the form {\tt\string\parshape} $n\; i_1 l_1\; i_2 l_2 \dots i_n l_n$ where $n$ is the number of lines you want to control, $i$ is the indentation and $l$ is the remainder of the line after the indentation (which would be $\hbox{{\tt\string\hsize}} - i$, if you want the right margin to be justified). Here is an extreme example of the use of {\tt\string\parshape} from the \href{https://tug.org/texshowcase/ShowcaseCircular.pdf}{TeX Showcase}. \bigskip \noindent An example of a tapered paragraph. In this {\tt\string\parshape}, for each indent, {\tt\string\hsize} is diminished by $2i_n$, producing an equal indent on each side. \medskip \noindent\parshape 11 0mm 100mm%three 0mm 100mm%normal 0mm 100mm% lines 5.5mm 89mm% or .055\hsize .89\hsize etc 11mm 78mm 16.5mm 67mm 22mm 56mm 27.5mm 45mm 33mm 34mm 38.5mm 23mm 44mm 12mm Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est\hfil laborum. \bigskip \noindent An example of using {\tt\string\parshape} to set incised margin notes. I used {\tt\string\parshape} to make the indentation then I reset {\tt\string\marginalia}'s {\tt\string\inmarginspacing} parameter to {\tt -4em} to push the note into the paragraph.\medskip {\inmarginspacing=-4em% temporarily reset \inmarginspacing from the \marginalia macro \noindent\parshape 8 0mm 100mm % four normal lines 0mm 100mm 0mm 100mm 0mm 100mm 15mm 85mm% three indented lines 15mm 85mm 15mm 85mm 0mm 100mm% back to normal, which will be maintained throughout the rest of the paragraph Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint \marginalia{\vskip-12pt A cut-in margin note}occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. } %\medskip \eject % I changed these from the default settings, \abovecolumnskip = \bigskipamount, % \belowcolumnskip = \bigskipamount, % to get normal leading above and below \doublecolumns \abovecolumnskip1.775pt \belowcolumnskip1.775pt \gutter4mm% space between columns in the \doublecolumns macro %\def\gutterbox{\vbox to \dimen0{\vfil\hbox{\special{color push rgb 1 0 0}\vrule height\dimen0\special{color pop}}\vfil}} \font\capfont="Mediaeval Caps:color=FF0000" at 20pt % the measure used for the drop cap macro is got by subtracting the gutter (4mm) from the full measure % and dividing the result by 2: (100 - 4) / 2 = 48 \def\cap#1#2{\null\noindent\smash{\raise0.5pt\hbox{\capfont#1}}\nobreak \vskip-2\baselineskip\nobreak \parshape 3 5mm 43mm 7mm 41mm 0mm 48mm\nobreak \noindent{\scw #2}\nobreak} \outline{1}{lettrines} A macro for a lettrine, built with the help of {\tt\string\parshape}:\marginalia{lettrines (drop capitals, versals)} \centerline{Secundum Lucam c. 9} {\doublecolumns\uselanguage{latin} \cap{I}{n} illo témpore, Elevátis Jesus óculis in discípulos suos, dicébat; Beati páuperes: quia vestrum est regnum Dei. Beáti qui nunc esurítis: quia saturabímini. Beáti qui nunc fletis: quia ridébitis. Beáti éritis cum vos óderint hómines, et cum separáverint vos et exprobráverint et ejécerint nomen vestrum tanquam malum propter Fílium Hóminis. Gaudéte in illa die et exsultáte: ecce enim merces vestra multa est in cœlo.\strut } \singlecolumn Originally I wrote the macro like this: {\parindent0pt \verbatim \def\cap#1#2{\vskip\baselineskip \noindent\smash{\raise0.5pt\hbox{\capfont#1}}\nobreak \vskip-2\baselineskip\nobreak \parshape 3 5mm 43mm 7mm 41mm 0mm 48mm\nobreak \noindent{\scw #2}\nobreak} |endverbatim } But when the drop capital came immediately after the {\tt\string\doublecolumns} command this happened:\medskip \def\cap#1#2{\vskip\baselineskip \noindent\smash{\raise0.5pt\hbox{\capfont#1}}\nobreak \vskip-2\baselineskip\nobreak \parshape 3 5mm 43mm 7mm 41mm 0pc 48mm\nobreak \noindent{\scw #2}\nobreak} \centerline{Secundum Lucam c. 9} {\doublecolumns\uselanguage{latin} \cap{I}{n} illo témpore, Elevátis Jesus óculis in discípulos suos, dicébat; Beati páuperes: quia vestrum est regnum Dei. Beáti qui nunc esurítis: quia saturabímini. Beáti qui nunc fletis: quia ridébitis. Beáti éritis cum vos óderint hómines, et cum separáverint vos et exprobráverint et ejécerint nomen vestrum tanquam malum propter Fílium Hóminis. Gaudéte in illa die et exsultáte: ecce enim merces vestra multa est in cœlo.\strut } \singlecolumn \medskip Replacing \verbatim\vskip\baselineskip|endverbatim\ in the first line of the macro with {\tt\string\null} fixed the problem. {\tt\string\null} -- \verbatim\def\null{\hbox{}}|endverbatim\ -- puts an empty {\tt\string\hbox} on the first line of the paragraph, so that the drop capital now rests on the second baseline. \verbatim\noindent\smash{\kern0pt\raise0.5pt\hbox{\capfont#1}}|endverbatim\ is the code that positions the drop capital. {\tt\string\raise} (or {\tt\string\lower}) can be used to move the letter vertically. You can also use {\tt\string\kern} to move the letter horizontally. \marginalia{{\tt\string\smash}}The purpose of {\tt\string\smash} in the macro is to make \TeX\ disregard the vertical dimensions of the drop capital. If {\tt\string\smash} was not there the `horns' of the I, or the accent on the example further on, would interfere with the linespacing. {\tt\string\smash} is the opposite of \marginalia{{\tt\string\phantom}}the {\tt\string\phantom} commands. With {\tt\string\smash} the drop capital in the macro is typeset, but its {\tt height} and {\tt depth} are disregarded, whereas with {\tt\string\vphantom} e.g. in the Plain \TeX\ {\tt\string\mathstrut} command the argument is not typeset but the {\tt height} and {\tt depth} are taken account of: \verbatim \def\mathstrut{\vphantom(} |endverbatim This makes an empty box with the {\tt height} and {\tt depth} of a left parenthesis. \verbatim\vskip-2\baselineskip\nobreak|endverbatim\ brings the following text back up to the first line of the paragraph, then {\tt\string\parshape} sets the indentations to make room for the drop capital, then \verbatim\noindent{\scw #2}}|endverbatim\ puts the rest of the first word\footnote{or the first three or four words, or the whole first line.} in letterspaced small caps, to make a transition between the drop cap and the normal text. In the lettrine macro, if the drop capital takes up $n$ lines, on the first line you would have \verbatim\null\vglue[n - 2]\baselineskip|endverbatim,\footnote{I used {\tt\string\vglue} here because it produces vertical space that does not disappear at a page break. Apart from that it is the same as {\tt\string\vskip}. When I used {\tt\string\null}{\tt\string\vskip}{\tt 2}{\tt\string\baselineskip} in the four line lettrines and one of them chanced to come at the top of the page, the lettrine and paragraph protruded two {\tt\string\baselineskip}s above the top of the text block.} and on the second line \verbatim\vskip-n\baselineskip|endverbatim. Since $n$ equalled 2 in the example, the first line of the macro just used {\tt\string\null}. \medskip When I am making lettrine macros I start with a generic macro for `normal' letters like H or N. \font\capfont="[lmroman17-regular]:mapping=tex-text" at 25.75pt \def\cap#1#2{\null\noindent\smash{\raise0pt\hbox{\capfont#1}}\nobreak \vskip-2\baselineskip\nobreak \parshape 3 6mm 94mm 7.5mm 92.5mm 0mm 100mm\nobreak \noindent{\scw #2}\nobreak} \cap{H}{aving} now gained some insight into the general aspects of the composing department, as well as the materials, tools, and other appliances used therein, it is necessary for the student to acquire a knowledge of the boxes of the upper and lower cases respectively. \smallskip \font\capfont="[lmroman17-regular]:mapping=tex-text" at 25.5pt \def\capI#1{\null\noindent\smash{\raise0.01pt\hbox{\capfont I}}\nobreak \vskip-2\baselineskip\nobreak \parshape 3 3mm 97mm 4.5mm 95.5mm 0mm 100mm\nobreak \noindent{\scw #1}\nobreak} Then I make customized versions for some of the other letters; I and M obviously: \capI{n} connection with composition the classical or foreign languages which require special cases, as also some amount of experience in setting, must not be forgotten. The languages which a compositor has to deal with more generally are Greek, Hebrew, and German. \font\capfont="[lmroman17-regular]:mapping=tex-text" at 25.5pt \def\capM#1{\null\noindent\smash{\raise0pt\hbox{\capfont M}}\nobreak \vskip-2\baselineskip\nobreak \parshape 3 7.6mm 92.4mm 9.1mm 90.9mm 0mm 100mm\nobreak \noindent{\scw #1}\nobreak} {\widowpenalty50000 \capM{usic} is printed by one of the four following processes: plate, lithography, photo-zinco, and type, the last method being more generally used for book music. The composition requires some amount of practice, as this class of work is almost distinct from ordinary letterpress printing. The cases used are very complicated, and contain more boxes than are usually required for other founts, foreign or otherwise, owing to the very large number of pieces used. } \smallskip But also A: \font\capfont="[lmroman17-regular]:mapping=tex-text" at 24.75pt \def\capA#1{\null\noindent\smash{\raise0pt\hbox{\capfont A}}\nobreak \vskip-2\baselineskip\nobreak \parshape 3 4.75mm 95.25mm 7mm 93mm 0mm 100mm\nobreak \noindent{\scw #1}\nobreak} \capA{lthough} wood engraving as an art is almost extinct, woodcut printing, whether on the hand-press or on power machine, is capable of a large amount of treatment. To bring out the degrees of light and shade of an illustration which has much work in it is a task which requires a great deal of experience; in fact, the workman should possess some artistic qualification to appreciate and to give effect to the artist's design. \smallskip Maybe P: \font\capfont="[lmroman17-regular]:mapping=tex-text" at 25.5pt \def\capP#1{\null\noindent\smash{\raise0pt\hbox{\capfont P}}\nobreak \vskip-2\baselineskip\nobreak \parshape 3 5.75mm 94.25mm 6.5mm 93.5mm 0mm 100mm\nobreak \noindent{\scw #1}\nobreak} \capP{erfecting} machines, with two cylinders, are those which print both sides of the sheet before it leaves the machine, but with two quite distinct impressions, and are adapted for ordinary bookwork of long numbers. \smallskip And also J, L, O, Q, V, W, Y. If I was setting a book with a lot of lettrines in it I might end up writing macros for most of the alphabet. %These examples are from \href{https://archive.org/details/printingpractica00jacorich}{`Printing'} by C. T. Jacobi. \medskip \noindent A four line drop capital. The `Q' is raised slightly so that the tail does not hit the letters below it. \font\bigQfont="[lmroman17-regular]:mapping=tex-text" at 50pt \def\bigQ#1{\null\vglue2\baselineskip \noindent\smash{\kern-5.5pt\raise7.5pt\hbox{\bigQfont Q}}\nobreak \vskip-4\baselineskip\nobreak \parshape 5 9.75mm 90.25mm 14mm 86mm 14mm 86mm 14mm 86mm 0mm 100mm\nobreak \noindent{\scw #1}\nobreak} \bigQ{u’en plein marais} de la Souteyranne, à quelques kilomètres au nord d’Aigues-Mortes, se trouve la Tour Carbonnière, surprend les visiteurs. Construite au XIIIe siècle, elle contrôlait l’unique voie d’accès terrestre de la ville fortifiée, celle qui menait à Psalmody, l’une des «abbayes de sel» dont il ne reste que quelques vestiges. L’abbaye était ravitaillée par un souterrain qui la reliait au château de Treillan. \medskip \font\bigVfont="[lmroman17-regular]:color=808080,mapping=tex-text" at 59pt \def\bigV#1{\null\vglue2\baselineskip \noindent\smash{\kern-17.5pt\raise1pt\hbox{\bigVfont V}}\nobreak \vskip-4\baselineskip\nobreak \parshape 5 9mm 90.25mm 8mm 91mm 6.5mm 93mm 4.5mm 95mm 0mm 100mm\nobreak \noindent{\scw #1}\nobreak} \noindent A drop cap V, showing how the letter is optically kerned into the margin and how the text slopes around the letter. \bigV{oici} à quelques kilomètres au nord d’Aigues-Mortes la Tour Carbonnière. Construite au XIIIe siècle, elle contrôlait l’unique voie d’accès terrestre de la ville fortifiée, celle qui menait à Psalmody, l’une des «abbayes de sel» dont il ne reste que quelques vestiges. L’abbaye était ravitaillée — dit-on — par un souterrain qui la reliait au château de Treillan. \eject \hskip2em An A with a diacritic: \font\bigAfont="[lmroman17-regular]:color=808080,mapping=tex-text" at 59pt \def\bigA#1#2{\null\vglue2\baselineskip\nobreak \noindent\smash{\kern-4.5pt\raise0pt\hbox{\bigAfont#1}}\nobreak \vskip-4\baselineskip\nobreak \parshape 5 8mm 92mm 10.5mm 89.5mm 12.5mm 87.5mm 14.5mm 85.5mm 0mm 100mm\nobreak \noindent{\scw #2}\nobreak} \bigA{À}{ quelques kilomètres} au nord d’Aigues-Mortes, se trouve la Tour Carbonnière. Construite au XIIIe siècle, elle contrôlait l’unique voie d’accès terrestre de la ville fortifiée, celle qui menait à Psalmody, l’une des «abbayes de sel» dont il ne reste que quelques vestiges. L’abbaye était ravitaillée — dit-on — par un souterrain qui la reliait au château de Treillan. \smallskip \noindent A drop capital with a punctuation mark in front of it: \font\capfont="[lmroman17-regular]:mapping=tex-text" at 26pt \def\guillemetcap#1#2{\null \noindent\smash{\kern-2pt\llap{\raise6pt\hbox{\Rm«}}\raise-0.25pt\hbox{\capfont#1}}\nobreak \vskip-2\baselineskip\nobreak \parshape 3 5.25mm 94.75mm 7mm 93mm 0mm 100mm\nobreak \noindent{\scw #2}\nobreak} \guillemetcap{E}{n} plein marais de la Souteyranne, à quelques kilomètres au nord d’Aigues-Mortes, se trouve la Tour Carbonnière. Construite au XIIIe siècle, elle contrôlait l’unique voie d’accès terrestre de la ville fortifiée, celle qui menait à Psalmody, l’une des «abbayes de sel» . . . \smallskip \font\gcapfont="Deutsche Zierschrift" at 43pt \font\frak="Kleist-Fraktur" at 11pt \def\gothcap#1#2{\null\vglue\baselineskip\noindent \smash{\kern-.75em\lower0.5pt\hbox{\gcapfont#1}}\nobreak \vskip-3\baselineskip\nobreak \parshape 5 14mm 76mm 17mm 83mm 17mm 83mm 17mm 83mm 0mm 100mm\nobreak \noindent{\frak #2}\nobreak} \noindent A Gothic initial:\smallskip \gothcap{W}{ER} {\frak reitet ſo ſpät durch Nacht und Wind?\nl Es iſt der Vater mit ſeinem Kind;\nl Er hat den Knaben wohl in dem Arm,\nl Er faßt ihn ſicher, er hält ihn warm. \vskip.5\baselineskip {\obeylines\parindent0pt\leftskip17mm Mein Sohn, was birgſt du ſo bang dein Geſicht? – Siehſt, Vater, du den Erlkönig nicht? Den Erlenkönig mit Kron und Schweif? – Mein Sohn, es iſt ein Nebelſtreif. – } } \smallskip These last four lettrines are taken from \href{https://anorien.csc.warwick.ac.uk/mirrors/CTAN/macros/latex/contrib/lettrine/doc/demo-fr.pdf}{examples} of the \LaTeX\ {\tt\string\lettrine} package. \redrule \outline{0}{Spacing} \outline{1}{nonfrenchspacing} Plain \TeX\ by default inserts additional space after certain punctuation marks. This is set by the {\tt\string\nonfrenchspacing} macro: \marginalia{{\tt\string\nonfrench-\break spacing}}\verbatim \def\nonfrenchspacing{\sfcode`\.3000\sfcode`\?3000% \sfcode`\!3000\sfcode`\:2000\sfcode`\;1500% \sfcode`\,1250 } |endverbatim \nonfrenchspacing \marginalia{{\tt\string\sfcode}}The {\tt\string\sfcode} ({\it space factor code}) command in this macro is used to alter the spacing after individual characters: \centerline{Public. junk? dwarves! hug: my; quartz, fox.} \noindent (Compare with {\tt\string\frenchspacing}: \centerline{\frenchspacing Public. junk? dwarves! hug: my; quartz, fox.)} This macro will not add additional space if the punctuation mark follows a capital letter, because it assumes that the capital letter is an initial in someone's name: D. E. Knuth. If you want to have the extra spacing after a punctuation mark that is preceded by caps, you could do something like this: \verbatim \TeX\ isn't WYSIWYG\null? 'Fraid not. |endverbatim \TeX\ isn't WYSIWYG\null? 'Fraid not. You could write your own macro to apply the spacing after punctuation marks that you prefer: \verbatim \def\myspacing{\sfcode`\.2500\sfcode`\?2500% \sfcode`\!2500\sfcode`\:1700\sfcode`\;1250% \sfcode`\,1000 } |endverbatim \def\myspacing{\sfcode`\.2500\sfcode`\?2500% \sfcode`\!2500\sfcode`\:1700\sfcode`\;1250% \sfcode`\,1000 } {\myspacing Sphinx. of? black! quartz: judge; my, vow. } \outline{1}{frenchspacing} If you want spacing after punctuation to be uniform use the {\tt\string\frenchspacing} macro: \marginalia{{\tt\string\frenchspacing}}\verbatim \def\frenchspacing{\sfcode`\.1000 \sfcode`\?1000% \sfcode`\!1000\sfcode`\:1000 \sfcode`\;1000% \sfcode`\,1000} |endverbatim \frenchspacing \medskip \outline{1}{Spacing before characters} \noindent OK, that’s spacing after punctuation marks, but what if you want to alter spacing before punctuation marks? In old books there always seems to be more spacing in front of colons, semicolons, exclamation marks and question marks than in modern digitally set books. And in other languages such as French, there seems to be a lot more spacing before these punctuation marks than in English. I found a method of altering the spacing before punctuation marks on a website which is no longer up but the files can be had via the \href{https://web.archive.org/web/*/http://visuel.ouvaton.org/*}{Internet Archive}. This code is taken from Velene.pdf: \smallskip \verbatim \catcode`\: =\active \def :{\unskip\kern .16667em\string:} \catcode`\«=\active \def «{\string«\kern .16667em\ignorespaces} \catcode`\»=\active \def »{\unskip\kern .16667em\string»} \catcode`\;=\active \outer\def ;{\unskip\kern .16667em\string;} \catcode`\!=\active \outer\def !{\unskip\kern .16667em\string!} \catcode`\?=\active \def ?{\unskip\kern .16667em\string?} \catcode`\'=\active \def '{\string’} |endverbatim\medskip It puts additional space before colons, semi-colons, exclamation marks, question marks, and before a right guillemet and after a left guillemet, in accordance with French typographic usage: { \catcode`\: =\active \def :{\unskip\kern .16667em\string:} \catcode`\«=\active \def «{\string«\kern .16667em\ignorespaces} \catcode`\»=\active \def »{\unskip\kern .16667em\string»} \catcode`\;=\active \outer\def ;{\unskip\kern .16667em\string;} \catcode`\!=\active \outer\def !{\unskip\kern .16667em\string!} \catcode`\?=\active \def ?{\unskip\kern .16667em\string?} \catcode`\'=\active \def '{\string’} % examples from Hart's Rules, 1983 ed., pp. 101--102 «Prenez garde au chien!», lisait-on à l’entrée des maisons romaines. «C’est par le sang et par le fer que les États grandissent», a dit Bismarck. A-t-il dit: «Je reviendrai»? Quel bonheur d’entendre: «Je vous aime!» A-t-il dit: «qui est ici?» Il a dit «Je reviendrai.» }\medskip With some fonts I use these settings to add some space before : ; ! ?\smallskip \verbatim \catcode`\:=\active \def :{\unskip\kern 1pt\string:} \catcode`\;=\active \outer\def ;{\unskip\kern 1pt\string;} \catcode`\!=\active \outer\def !{\unskip\kern .1em\string!} \catcode`\?=\active \def ?{\unskip\kern 1pt\string?} |endverbatim\smallskip \noindent The catcode method works in pdf\TeX, \XeTeX\ and Lua\TeX. pdf\TeX\ has its own method of adding space before characters:\smallskip \verbatim \pdfprependkern=1% activate kerns before characters \knbccode\font`\:=100 \knbccode\font`\;=100 \knbccode\font`\!=100 \knbccode\font`\?=100 |endverbatim\smallskip \noindent The numbers are thousandths of an em. In 10pt type 100 is equivalent to 1pt. See p. 32 of the pdf\TeX\ \href{https://www.tug.org/texmf-dist/doc/pdftex/manual/pdftex-a.pdf}{manual}. \outline{1}{XeTeXcharclass} Another method, specific to \XeTeX, of achieving the same results is with {\tt\string\XeTeXcharclass} and {\tt\string\XeTeXinterchartoks}: \smallskip \verbatim \XeTeXinterchartokenstate=1 \XeTeXcharclass `\: = 1 \XeTeXcharclass `\; = 1 \XeTeXcharclass `\! = 2 \XeTeXcharclass `\? = 2 \XeTeXinterchartoks 0 1 = {\kern 0.5pt} \XeTeXinterchartoks 0 2 = {\kern 1pt} |endverbatim { \XeTeXinterchartokenstate=1 \XeTeXcharclass `\: = 1 \XeTeXcharclass `\; = 1 \XeTeXcharclass `\! = 2 \XeTeXcharclass `\? = 2 \XeTeXinterchartoks 0 1 = {\kern 0.5pt} \XeTeXinterchartoks 0 2 = {\kern 1pt} boxing: wizards; jump! quickly? But if the preceding word is in a different font it doesn't work: {\it boxing}: {\rm wizards}; {\it jump}! {\it quickly}? (But if the whole thing is in italic it does: {\it boxing: wizards; jump! quickly?}) } There is also yet another way to add space before characters with Lua\TeX. See \href{https://www.gutenberg.eu.org/IMG/pdf/gutenberg_2011_isambert.pdf}{here}. {\tt\string\XeTeXinterchartoks} can also be used to fix gaps in a font's kerning table, e.g. in EB Garamond the combination `VÆ' does not seem to be kerned: {\gara LINGVÆ}. You could fix that like this: \smallskip \verbatim \XeTeXinterchartokenstate=1 \newXeTeXintercharclass \Vclass \newXeTeXintercharclass \AEclass \XeTeXcharclass`\V \Vclass \XeTeXcharclass`\Æ \AEclass \XeTeXinterchartoks\Vclass \AEclass = {\kern -1pt} |endverbatim\smallskip {\gara \XeTeXinterchartokenstate=1 \newXeTeXintercharclass \Vclass \newXeTeXintercharclass \AEclass \XeTeXcharclass`\V \Vclass \XeTeXcharclass`\Æ \AEclass \XeTeXinterchartoks\Vclass \AEclass = {\kern -1pt} \centerline{SYNTAXIS LINGVÆ GRÆCÆ} } \smallskip Another use for {\tt\string\XeTeXinterchartoks} would be to suppress the `Th' ligature that some fonts have on by default. E.g. in Minion Pro and some other Adobe fonts the `Th' ligature is included in standard ligatures ({\tt liga}). You could switch off {\tt liga} like this: \noindent \verbatim \font\minnolig="MinionPro-Regular:-liga,mapping=tex-text" at 10pt |endverbatim \noindent but then you would lose the f ligatures. If you use {\tt\string\XeTeXinterchartoks} like this – \smallskip \verbatim \XeTeXinterchartokenstate=1 \newXeTeXintercharclass \Tclass \newXeTeXintercharclass \hclass \XeTeXcharclass`\T \Tclass \XeTeXcharclass`\h \hclass \XeTeXinterchartoks\Tclass \hclass = {\kern 0pt} |endverbatim \verbatim \font\min="MinionPro-Regular:mapping=tex-text" at 10pt {\min Th ff ffi ffl fi fl} |endverbatim \noindent – the `Th' ligature is suppressed but the f ligatures remain. \eject \outline{1}{spacefactor, fontdimen} As well as {\tt\string\sfcode} \TeX\ also has the {\tt\string\spacefactor} command. This overrides {\tt\string\fontdimen2}, the normal interword space. {\tt\string\spaceskip} is meant for temporarily changing the values, like removing the stretch and shrink components in {\tt\string\raggedright} Sometimes I use \verbatim\spaceskip.33em|endverbatim\ in places where text does not need to be justified and I want a slightly wider word spacing, e.g. in headings or page headers. The standard {\tt\string\fontdimen} registers for text fonts are {\leftskip1.2em \item{1.} slant factor for positioning of accents for slanted and italic fonts. \item{2.} normal interword space, may be overwritten by setting {\tt\string\spaceskip}. \item{3.} is the extra interword space, which may be overwritten by the `plus' part of {\tt\string\spaceskip}. This is the extra space \TeX\ uses for justification of paragraph line. \item{4.} is the extra interword shrinkable space, which \TeX\ may reduce for justification. It will be overwritten by the `minus' part of {\tt\string\spaceskip}. \item{5.} x-height, height of lowercase letters without ascenders, e.g., `a' `o' or `x'. This is just the font-specific measuring unit \hbox{`1 ex'.} \item{6.} `{\tt\string\quad}' is the font specific width of `M', simultaneously the measuring unit `1 em'. \item{7.} additional interword space after punctuation; suppressed by {\tt\string\frenchspacing}. (A non zero value of {\tt\string\xspaceskip} takes precedence over it.) } The rest of the {\tt\string\fontdimen} registers (up to 22) deal with mathematical typesetting. Each font has its own {\tt\string\fontdimen} settings. If you wanted to change them you could do this: \verbatim \fontdimen2\font=.25em % inter-word space \fontdimen3\font=.25em % inter-word stretchability \fontdimen4\font=.05em % inter-word shrinkability |endverbatim This example taken from \href{http://tex.stackexchange.com/questions/94737/starting-with-tex-not-latex}{here}. See \href{http://tex.stackexchange.com/questions/49298/what-settings-for-xspaceskip-would-you-suggest-for-linux-libertine/49306#49306}{also}. \medskip \outline{1}{Microtypography} \marginalia{microtypo-\break graphy}A further refinement of spacing is the micro-typographical extensions introduced by pdf\TeX\ and since taken up by Lua\TeX\ and \XeTeX. The most prominent of these are font protrusion, in which characters such as ' '' ! , - . : ; ? are pushed out slightly into the right margin to create a more optically straight right edge, and font expansion in which glyphs can be imperceptably widened or narrowed to aid in justification. Currently pdf\TeX\ and Lua\TeX\ support both font protrusion and expansion; \XeTeX\ supports font protrusion only. See p. 6 of the \href{http://mirror.ox.ac.uk/sites/ctan.org/macros/latex/contrib/microtype/microtype.pdf}{manual} for the \LaTeX\ {\tt microtype} package. \bigskip \abovecolumnskip0pt \belowcolumnskip2pt % From `Envisioning Information' by E.R. Tufte \def\tufte{We thrive in information||thick worlds because of our marvelous and everyday capacity to select, edit, single out, structure, highlight, group, pair, merge, harmonize, synthesize, focus, organize, condense, reduce, boil down, choose, categorize, catalog, classify, list, abstract, scan, look into, idealize, isolate, discriminate, distinguish, screen, pigeonhole, pick over, sort, integrate, blend, inspect, filter, lump, skip, smooth, chunk, average, approximate, cluster, aggregate, outline, summarize, itemize, review, dip into, flip through, browse, glance into, leaf through, skim, refine, enumerate, glean, synopsize, winnow the wheat from the chaff and separate the sheep from the goats.} Some \XeTeX\ examples using a macro for protrusion which I found \href{http://tex.stackexchange.com/questions/94737/starting-with-tex-not-latex}{here}: %\abovecolumnskip=0pt %\belowcolumnskip=\smallskipamount \gara% switch the main font to EB Garamond for these examples \def\marginprotrusion#1{% let these characters protrude into right margin % just some random test values to play with. http://tex.stackexchange.com/a/8130/1410 \rpcode#1 U`” 150 \rpcode#1 U`’ 150 \rpcode#1 U`! 100 \rpcode#1 U`, 200 \rpcode#1 U`- 200 \rpcode#1 U`. 200 \rpcode#1 U`: 100 \rpcode#1 U`; 100 \rpcode#1 U`? 100} \marginprotrusion\gara \medskip \noindent {\rm 0. The default: no protrusion.} {\doublecolumns\emergencystretch7pt \noindent\tufte \singlecolumn } \medskip \noindent {\rm 1. The same text with {\tt\string\XeTeXprotrudechars} set to 1.} {\XeTeXprotrudechars=1 \emergencystretch7pt \doublecolumns \noindent\tufte \singlecolumn } {\rm When {\tt\string\XeTeXprotrudechars} is set to 1, the protrusion is applied after \TeX’s normal paragraph breaking routines have broken the paragraph into lines. The linebreaking here is the same as in example 0.} \medskip \noindent {\rm 2. With {\tt\string\XeTeXprotrudechars} set to 2.} {\XeTeXprotrudechars=2 \emergencystretch7pt \doublecolumns \noindent\tufte \singlecolumn } {\rm When {\tt\string\XeTeXprotrudechars} is set to 2 the changes caused by protrusion and expansion are taken into account {\it while} the paragraph is being built. Consequently the line breaking in this example is different to that in examples 0 and 1.} \rm% back to Latin Modern The microtypography examples are taken from an \href{https://www.tug.org/TUGboat/tb31-1/tb97hagen-fonts.pdf}{article} by Hans Hagen. \bye