| 1 |
% $Id: pdftexmanual.cls 979 2026-02-16 15:32:58Z karl $ |
| 2 |
% LaTeX class file for the pdfTeX manual. |
| 3 |
% Originally written by Karl Berry, 2023. Public domain. |
| 4 |
|
| 5 |
\LoadClass[11pt]{report} % use {report} so we can have \appendix |
| 6 |
\usepackage[T1]{fontenc} % for \textbackslash |
| 7 |
\usepackage{fullpage} % fewer pages is better |
| 8 |
\usepackage{rerunfilecheck} % so the Makefile can easily rerun |
| 9 |
\usepackage{mflogo,graphicx} % basics |
| 10 |
\usepackage{verbatim} % for \verbatiminput |
| 11 |
\usepackage{bm} % bold math symbol |
| 12 |
|
| 13 |
\pdfminorversion=3 % maximally compatible |
| 14 |
\pdfobjcompresslevel=0 % since minor version=3, can't compress objects |
| 15 |
\hbadness=10000 % don't care |
| 16 |
\overfullrule=1mm % but want to see overfull |
| 17 |
|
| 18 |
\raggedbottom % no need for spacey pages |
| 19 |
|
| 20 |
\divide\abovecaptionskip by 2 % too spacey by default |
| 21 |
\setcounter{topnumber}{3} % .ini figures are small |
| 22 |
|
| 23 |
% This is the default hsize for letter; not ideal, but works well enough |
| 24 |
% for a4. Too irritating to rewrite to avoid overfull hboxes with two |
| 25 |
% different widths. |
| 26 |
\AtBeginDocument{\hsize=469.75502pt } |
| 27 |
|
| 28 |
% If |microtype| is loaded, deactivate it in verbatim blocks. |
| 29 |
% It often manipulates a leading |\| in CM rather too much, |
| 30 |
% thus messing with the visible fixed-width alignment. |
| 31 |
% \begin{macrocode} |
| 32 |
\AtBeginDocument{% |
| 33 |
\@ifpackageloaded{microtype} |
| 34 |
{\g@addto@macro\@verbatim{\microtypesetup{activate=false}}}{} |
| 35 |
} |
| 36 |
|
| 37 |
% We want a verbatim command that will accept all special characters (so |
| 38 |
% \texttt doesn't work) and work in arguments (so \verb doesn't work). |
| 39 |
% |
| 40 |
% - can't use obeyspaces, it generates extra space. |
| 41 |
%\PassOptionsToPackage{obeyspaces}{url} |
| 42 |
% |
| 43 |
% - can't use \HyOrg@url (\url saved by hyperref), it doesn't obey spaces. |
| 44 |
% But we have to live with it, switching all args with spaces to \verb. |
| 45 |
\usepackage[allowmove]{url} % we only do simple stuff in \caption, let it work |
| 46 |
\def\type{\HyOrg@url} |
| 47 |
% / in our document is PostScript, not a url, so we want to allow a |
| 48 |
% break before, not after. But then we get an infloop, so disallow breaks. |
| 49 |
%\g@addto@macro\UrlSpecials{\do\/{\slash}} |
| 50 |
\g@addto@macro\UrlNoBreaks{\do\/} |
| 51 |
% |
| 52 |
% - can't use \nolinkurl from hyperref, doesn't obey spaces, breaks after /, |
| 53 |
% sometimes expands, e.g., \pdfcreationdate. |
| 54 |
% https://github.com/latex3/hyperref/issues/291 |
| 55 |
%\def\type{\nolinkurl} |
| 56 |
% |
| 57 |
% - can't use \lstinline, doesn't work in tables. |
| 58 |
%\usepackage{listings}\def\type{\lstinline} |
| 59 |
% |
| 60 |
% - expl3 attempt: |
| 61 |
% \NewDocumentCommand\type{v}{\texttt{#1}} |
| 62 |
% but gets error, so I guess I don't understand: |
| 63 |
% LaTeX cmd Error: Verbatim-like command '\type' illegal in arg |
| 64 |
% \pdftexprimitive{\Syntax{\Tex{\pdfoutput} |
| 65 |
% |
| 66 |
% It seems the general problem remains unsolved in LaTeX. |
| 67 |
|
| 68 |
\usepackage[pdfa,hidelinks,linktoc=all]{hyperref} |
| 69 |
|
| 70 |
% Assorted convenience macros. |
| 71 |
% |
| 72 |
% we can use \textbackslash since we load [T1]. |
| 73 |
\DeclareRobustCommand{\cs}[1]{\mbox{\tt \textbackslash #1}}% |
| 74 |
\DeclareRobustCommand{\titleref}[1]{{\slshape\frenchspacing#1\/}} |
| 75 |
|
| 76 |
\def\eTeX{{$\varepsilon$}-\kern-.125em\TeX} |
| 77 |
\def\filename{\type} |
| 78 |
\def\hyph{-\penalty0 \hskip0pt \relax} % allow hyphenation after a - |
| 79 |
\def\varname{\textit} |
| 80 |
% |
| 81 |
\def\ConTeXt{C\kern-.0333emon\-\kern-.0667em\TeX\kern-.0333emt} |
| 82 |
\def\MDFIVE{MD5} % not oldstyle 5, capital MD |
| 83 |
\def\PDFReference{PDF reference manual} |
| 84 |
\def\THANH{H\`an Th\^e\llap{\raise 0.5ex\hbox{\'{}}} Th\`anh} |
| 85 |
% |
| 86 |
\def\eg{e.g.,}\def\Eg{E.g.,} |
| 87 |
\def\ie{i.e.,}\def\Ie{I.e.,} |
| 88 |
% |
| 89 |
% the default \verbatiminput evidently ends with a blank line. |
| 90 |
% Also, it does not give an error when the input file does not exist, |
| 91 |
% only a terminal message. Let's complain. |
| 92 |
\def\myverbatiminput#1{\begingroup |
| 93 |
\small |
| 94 |
\openin0 = #1 |
| 95 |
\ifeof0 \errmessage{No verbatiminput file #1}\else\closein0 \fi |
| 96 |
\verbatiminput{#1}% |
| 97 |
\vspace{-\baselineskip}% |
| 98 |
\endgroup} |
| 99 |
% |
| 100 |
\newenvironment{smalltable}{\medskip\small}{\medskip} |
| 101 |
|
| 102 |
% Our self-identified version information. |
| 103 |
% |
| 104 |
\def\svnscan $#1 #2 #3 #4-#5-#6 #7${ |
| 105 |
\def\rcsrevision{#3} |
| 106 |
\def\rcsyear{#4} |
| 107 |
\def\rcsmonth{#5} |
| 108 |
\def\rcsday{{\count0=#6\relax\the\count0}} |
| 109 |
\def\rcsmonthname{\ifcase\rcsmonth ERROR\or |
| 110 |
January\or February\or March\or April\or May\or June\or July\or |
| 111 |
August\or September\or October\or November\or December\else ERROR\fi} |
| 112 |
} |
| 113 |
\def\versplit#1#2#3{#1.#2#3}% 140 -> 1.40 |
| 114 |
\def\currentpdftex{\expandafter\versplit\the\pdftexversion.\pdftexrevision} |
| 115 |
|
| 116 |
% Syntax descriptions. |
| 117 |
% |
| 118 |
% used in main source text to mark a primitive. |
| 119 |
\def\pdftexprimitive{\par\nobreak\vspace{-4pt}\noindent\strut} |
| 120 |
|
| 121 |
\def\aftersyntax{\nobreak\smallskip} % changed for appendix |
| 122 |
\def\Syntax #1{{\ignorespaces #1\unskip\strut}\par\aftersyntax} |
| 123 |
\def\IndentSyn {\hbox to 4.5em{}} % unchangeable space that doesn't disappear |
| 124 |
\def\Next {\nobreak\newline\IndentSyn\nobreak} % multiline syntax |
| 125 |
\def\Sugar {} |
| 126 |
\def\Lbrace {\Sugar{\allowbreak\texttt{\textbraceleft}}} |
| 127 |
\def\Literal #1{\Sugar{\type{#1}}} |
| 128 |
\def\Means {\Sugar{\ensuremath{\rightarrow}\;\;}} |
| 129 |
\def\Modelist #1{\Sugar{\;{(\hbox{#1})}}} |
| 130 |
\def\Optional #1{\Sugar{\ensuremath{\>\bm[\>\hbox{\ignorespaces #1}\>\bm]\>}}} |
| 131 |
\def\Or {\Sugar{\,\ensuremath{\bm{\vert}}\,\nobreak\ }} |
| 132 |
\def\Something#1{\Sugar{\ensuremath{\langle}\textrm{#1}\ensuremath{\rangle}}} |
| 133 |
\def\Somethingbf#1{\textbf{\Something{#1}}} |
| 134 |
\def\Rbrace {\Sugar{\texttt{\textbraceright}}} |
| 135 |
\def\Whatever #1{\Sugar{\;\;\ensuremath{(\hbox{#1})}}} % parens |
| 136 |
% more space before for more separation on syntax lines. |
| 137 |
|
| 138 |
% parens with a little extra space for list of alternatives: |
| 139 |
\def\OneOf#1{\Sugar{% |
| 140 |
\;\ensuremath{\bm(}% |
| 141 |
\;\hbox{\ignorespaces #1\unskip}\;% |
| 142 |
\ensuremath{\bm)}\;% |
| 143 |
}} |
| 144 |
|
| 145 |
% Just for clarity. |
| 146 |
\let\InlineSyntax\relax |
| 147 |
|
| 148 |
% introduced: |
| 149 |
\def\introduced#1{The primitive was introduced in \PDFTEX\ #1.} |
| 150 |
\def\introducedplural#1{The primitives were introduced in \PDFTEX\ #1.} |
| 151 |
|
| 152 |
% Urls. |
| 153 |
% |
| 154 |
% assume all defined url control sequences start with "url": |
| 155 |
\def\useurl#1{\expandafter\csname url#1\endcsname} |
| 156 |
|
| 157 |
\urldef{\urlctansystems} \url{https://ctan.org/tex-archive/systems} |
| 158 |
\urldef{\urletexctan} \url{https://ctan.org/pkg/etex} |
| 159 |
\urldef{\urljbigenc} \url{https://github.com/agl/jbig2enc} |
| 160 |
\urldef{\urlkpathsea} \url{https://tug.org/kpathsea} |
| 161 |
\urldef{\urlluatex} \url{https://ctan.org/pkg/luatex} |
| 162 |
\urldef{\urlpdfreference} \url{https://pdfa.org/resource/pdf-specification-index/} |
| 163 |
\urldef{\urlptexctan} \url{https://ctan.org/pkg/pdftex} |
| 164 |
\urldef{\urlptexdevel} \url{svn://tug.org/pdftex/branches/stable} |
| 165 |
\urldef{\urlptexbugs} \url{https://lists.tug.org/pdftex} |
| 166 |
\urldef{\urlptexorg} \url{https://www.pdftex.org} |
| 167 |
\urldef{\urltcxfiles} \url{https://tug.org/texinfohtml/web2c.html#TCX-files} |
| 168 |
\urldef{\urltexlive} \url{https://tug.org/texlive} |
| 169 |
\urldef{\urlthanhtruetypetub} \url{https://tug.org/TUGboat/tb30-1/tb94thanh.pdf} |
| 170 |
\urldef{\urltughelp} \url{https://tug.org/begin} |
| 171 |
\urldef{\urlwebc} \url{https://tug.org/web2c} |
| 172 |
\urldef{\urlxetex} \url{https://tug.org/xetex} |
| 173 |
\urldef{\urlwindows} \url{http://ctan.org/tex-archive/systems/windows} |
| 174 |
|
| 175 |
% Abbreviations. |
| 176 |
\newtoks\abbrevtoks |
| 177 |
\def\abbrevlist{{% |
| 178 |
\par\bigskip |
| 179 |
\small |
| 180 |
\advance\baselineskip by 2pt plus1pt minus1pt |
| 181 |
\halign{&##\qquad\hfil\cr\the\abbrevtoks}% |
| 182 |
}} |
| 183 |
\def\abbrevitem#1#2{#1\cr} |
| 184 |
\def\abbreviation[#1] #2 #3{% |
| 185 |
\expandafter\def\csname#1\endcsname{#2}% |
| 186 |
\abbrevtoks = \expandafter{\the\abbrevtoks \abbrevitem{#2}{#3}} |
| 187 |
} |
| 188 |
|
| 189 |
\abbreviation [AFM] {AFM} {Adobe Font Metrics} |
| 190 |
\abbreviation [ASCII] {ASCII} {American Standard Code for Information Interchange} |
| 191 |
\abbreviation [CONTEXT] {\ConTeXt} {general purpose macro package} |
| 192 |
\abbreviation [CTAN] {CTAN} {global \TEX\ archive server} |
| 193 |
\abbreviation [DVI] {DVI} {native \TEX\ DeVice Independent file format} |
| 194 |
\abbreviation [ENCTEX] {enc\TeX} {enc\TeX\ extension to \TEX} |
| 195 |
\abbreviation [EPSTOPDF] {epstopdf} {\EPS\ to \PDF\ conversion tool} |
| 196 |
\abbreviation [EPS] {EPS} {Encapsulated PostScript} |
| 197 |
\abbreviation [EPLAIN] {Eplain} {Expanded plain \TEX\ format} |
| 198 |
\abbreviation [ETEX] {\eTeX} {a stable extension to \TEX} |
| 199 |
\abbreviation [EXIF] {EXIF} {Exchangeable Image File format (JPEG file variant)} |
| 200 |
\abbreviation [GHOSTSCRIPT] {Ghostscript} {\POSTSCRIPT\ and \PDF\ language interpreter} |
| 201 |
\abbreviation [GNU] {GNU} {GNU's Not Unix} |
| 202 |
\abbreviation [HZ] {HZ} {Hermann Zapf's paragraph-breaking optimizations} |
| 203 |
\abbreviation [ISO] {ISO} {International Organization for Standardization} |
| 204 |
\abbreviation [JBIGTWO] {JBIG2} {Joint Bi-level Image Experts Group image format, version 2} |
| 205 |
\abbreviation [JBIG] {JBIG} {Joint Bi-level Image Experts Group image format} |
| 206 |
\abbreviation [JFIF] {JFIF} {JPEG File Interchange Format} |
| 207 |
\abbreviation [JPEG] {JPEG} {Joint Photographic Experts Group} |
| 208 |
\abbreviation [LATEX] {\LaTeX} {general-purpose macro package} |
| 209 |
\abbreviation [LMTX] {LMTX} {the LuaMeta\TeX\ engine} |
| 210 |
\abbreviation [LUATEX] {Lua\TeX} {the Lua\TeX\ engine} |
| 211 |
\abbreviation [MACTEX] {Mac\-\TeX} {\TEXLIVE\ on the Mac} |
| 212 |
\abbreviation [METAFONT] {\MF} {graphic programming environment, bitmap output} |
| 213 |
\abbreviation [METAPOST] {MetaPost} {graphic programming environment, vector output} |
| 214 |
\abbreviation [MIKTEX] {MiK\TeX} {\TeX\ distribution for \WIN} |
| 215 |
\abbreviation [MLTEX] {ml\TeX} {ML\TeX\ extension to \TEX} |
| 216 |
\abbreviation [MPTOPDF] {mptopdf} {\METAPOST\ to \PDF\ conversion tool} |
| 217 |
\abbreviation [PDFA] {PDF/\kern-.05em A} {PDF A/* standards} |
| 218 |
\abbreviation [PDFETEX] {pdfe\TeX} {\ETEX\ extension supporting \PDF\ output} |
| 219 |
\abbreviation [PDFLATEX] {pdf\LaTeX} {\LATEX\ format using \PDFTEX, producing \PDF} |
| 220 |
\abbreviation [PDFTEX] {pdf\TeX} {\TEX\ extension supporting \PDF\ output} |
| 221 |
\abbreviation [PDF] {PDF} {Portable Document Format} |
| 222 |
\abbreviation [PERL] {Perl} {Perl programming environment} |
| 223 |
\abbreviation [PFA] {PFA} {Adobe PostScript Font format, ASCII} |
| 224 |
\abbreviation [PFB] {PFB} {Adobe PostScript Font format, binary} |
| 225 |
\abbreviation [PK] {PK} {Packed bitmap font} |
| 226 |
\abbreviation [PNG] {PNG} {Portable Network Graphics} |
| 227 |
\abbreviation [POSIX] {POSIX} {Portable Operating System Interface} |
| 228 |
\abbreviation [POSTSCRIPT] {PostScript} {general graphics language} |
| 229 |
\abbreviation [PSTOPDF] {PStoPDF} {PostScript to \PDF\ converter (on top of \GHOSTSCRIPT)} |
| 230 |
\abbreviation [RGB] {RGB} {red--green--blue color specification} |
| 231 |
\abbreviation [TCX] {TCX} {\TEX\ Character Translation} |
| 232 |
\abbreviation [TDS] {TDS} {\TEX\ Directory Standard} |
| 233 |
\abbreviation [TEXINFO] {Texinfo} {\GNU\ documentation format} |
| 234 |
\abbreviation [TEXLIVE] {\TeX\ Live} {\TeX\ Live distribution (cross-platform)} |
| 235 |
\abbreviation [TEX] {\TeX} {typographic language and program} |
| 236 |
\abbreviation [TFM] {TFM} {\TEX\ Font Metrics} |
| 237 |
\abbreviation [TIF] {TIFF} {Tagged Interchange File format} |
| 238 |
\abbreviation [TUG] {TUG} {\TEX\ Users Group, \texttt{tug.org}} |
| 239 |
\abbreviation [UNIX] {Unix} {Unix platform} |
| 240 |
\abbreviation [URL] {url} {Uniform Resource Locator} |
| 241 |
\abbreviation [UTFEIGHT] {\mbox{UTF-8}} {Uniform Resource Locator} |
| 242 |
\abbreviation [WEBC] {Web2C} {Implementation framework for \TEX\ and friends} |
| 243 |
\abbreviation [WEB] {WEB} {literate programming environment} |
| 244 |
\abbreviation [WIN] {Windows} {Microsoft Windows platform} |
| 245 |
\abbreviation [XETEX] {Xe\TeX} {the Xe\TeX\ engine} |