diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/macros2e/macros2e.pdf | bin | 0 -> 174974 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/macros2e/macros2e.tex | 924 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/collection-documentation-english.tlpsrc | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/macros2e.tlpsrc | 0 |
4 files changed, 925 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/macros2e/macros2e.pdf b/Master/texmf-dist/doc/latex/macros2e/macros2e.pdf Binary files differnew file mode 100644 index 00000000000..fbb84f56294 --- /dev/null +++ b/Master/texmf-dist/doc/latex/macros2e/macros2e.pdf diff --git a/Master/texmf-dist/doc/latex/macros2e/macros2e.tex b/Master/texmf-dist/doc/latex/macros2e/macros2e.tex new file mode 100644 index 00000000000..964a7f4086e --- /dev/null +++ b/Master/texmf-dist/doc/latex/macros2e/macros2e.tex @@ -0,0 +1,924 @@ +%&pdflatex +% $Id: macros2e.tex 2521 2011-07-23 19:14:33Z martin $ +\documentclass[12pt,a4paper]{article} +\usepackage[margin=1in]{geometry} +\usepackage{ydoc-desc}[2010/02/16] +\usepackage{newverbs} +\MakeShortVerb\| +\def\q#1{`#1'} +\def\qq#1{``#1''} +\MakeSpecialShortVerb\qverb\" +\AtBeginDocument{\MakeShortMacroArgs*\`} +\AtEndDocument{\DeleteShortMacroArgs\`} + +\usepackage{hyperref} +\usepackage{xcolor} +\hypersetup{filecolor=macrodesc} + +\usepackage{booktabs} +\usepackage{tabularx} +\usepackage{multicol} + +\usepackage{zref-user} +\usepackage{zref-abspos} +\usepackage{zref-xr} +\usepackage{graphicx} + +% Relative position of `source2e` without extension +\def\sourceIIe{/usr/local/texlive/2010/texmf-dist/doc/latex/base/source2e} +%source2e} + +\makeatletter +% Bug-fix for missing declaration: +\@ifundefined{ZREF@xr@ignored}{\newcount\ZREF@xr@ignored}{} + +% Redefine the format of macro names to link to 'source2e': +\def\PrintMacroName#1{% + {\macrodescstyle{\strut + \begingroup + \escapechar\m@ne + \edef\name{\string #1}% + \edef\@tempa{\noexpand\exthref{\name}{\noexpand\texttt{\char92}\name}}% + \expandafter\endgroup\@tempa + }}% +} + +\iffalse + +\def\exthref#1#2{{% + % Get page of 'desc-'iption label + \edef\page{\zref@extract{desc-#1}{abspage}}% + \ifnum0\page=0\relax + % If it doesn't exist try the 'code-' label + \edef\page{\zref@extract{code-#1}{abspage}}% + \ifnum0\page=0\else + %\Gin@defaultbp\x{\zposx{code-#1}sp}% + \Gin@defaultbp\y{\zposy{code-#1}sp}% + \zrefused{code-#1}% + %\message{^^J USED LABEL^^Jcode-#1^^J}% + \fi + \else + %\Gin@defaultbp\x{\zposx{desc-#1}sp}% + \Gin@defaultbp\y{\zposy{desc-#1}sp}% + \zrefused{desc-#1}% + %\message{^^J USED LABEL^^Jdesc-#1^^J}% + \fi + \ifnum0\page=0\relax + % Simply typeset the text if no label is found + #2% + %\message{^^J No reference for: '\string#2'^^J}% + \else + % Otherwise set link to Fit Horizontally at the given y-coordinate + \href[{page=\page,pdfnewwindow=true,pdfremotestartview=FitH \y}]{file:\sourceIIe.pdf}% + %{\llap{\tiny\page,\y\ } + {#2}% + \fi +}} + +\def\siieposs#1#2#3#4\relax{% + \Gin@defaultbp\x{#1sp}% + \Gin@defaultbp\y{#2sp}% + \def\p{#3}% +} +\def\siiepos#1#2{% + \siieposs#2\relax + \message{^^J\noexpand\siiepos{#1}{\x}{\y}{\p}} +} + +\else + +\def\siiepos#1#2#3#4{% + \@namedef{siiepos@#1@x}{#2}% + \@namedef{siiepos@#1@y}{#3}% + \@namedef{siiepos@#1@p}{#4}% +} + +\def\exthref#1#2{% + \@ifundefined{siiepos@#1@p}{% + % Simply typeset the text if no label is found + #2% + %\message{^^J No reference for: '\string#2'^^J}% + }{% + % Otherwise set link to Fit Horizontally at the given y-coordinate + \href[page=\@nameuse{siiepos@#1@p},pdfnewwindow=true,pdfremotestartview=FitH \@nameuse{siiepos@#1@y}]{file:\sourceIIe.pdf}% + {#2}% + }% +} + +\fi + + +\siiepos{@addtofilelist}{64.4291}{530.5617}{75} +\siiepos{addto@hook}{83.25822}{503.54074}{131} +\siiepos{@Alph}{106.79463}{245.35754}{113} +\siiepos{@alph}{106.79463}{321.19466}{113} +\siiepos{arraystretch}{73.84366}{568.89484}{266} +\siiepos{@arstrutbox}{78.55093}{532.63092}{266} +\siiepos{@backslashchar}{64.4291}{288.49547}{37} +\siiepos{@begin@tempboxa}{59.72182}{151.91508}{241} +\siiepos{bgroup}{102.08734}{228.77116}{25} +\siiepos{@break@tfor}{78.55093}{254.67577}{45} +\siiepos{@bsphack}{92.67278}{338.35991}{60} +\siiepos{@cclvi}{102.08734}{659.32011}{20} +\siiepos{@cclv}{106.79463}{689.89565}{20} +\siiepos{@charlb}{97.38007}{444.76064}{73} +\siiepos{@charrb}{97.38007}{432.8055}{73} +\siiepos{@classoptionslist}{50.30725}{732.87947}{375} +\siiepos{@clsextension}{69.13638}{519.08176}{375} +\siiepos{count@}{102.08734}{529.44287}{21} +\siiepos{@ctrerr}{97.38007}{223.98906}{51} +\siiepos{@currenvir}{83.25822}{675.0963}{211} +\siiepos{@currext}{92.67278}{555.34567}{375} +\siiepos{@currname}{87.9655}{591.60959}{375} +\siiepos{dimen@ii}{92.67278}{493.57745}{21} +\siiepos{dimen@i}{97.38007}{505.5326}{21} +\siiepos{dimen@}{102.08734}{517.48773}{21} +\siiepos{egroup}{102.08734}{216.81602}{25} +\siiepos{@empty}{102.08734}{582.16159}{45} +\siiepos{empty}{106.79463}{301.299}{25} +\siiepos{end}{116.20918}{358.88287}{213} +\siiepos{@end@tempboxa}{69.13638}{706.24886}{242} +\siiepos{@Esphack}{92.67278}{192.76773}{61} +\siiepos{@esphack}{92.67278}{304.81541}{61} +\siiepos{@expandtwoargs}{64.4291}{335.09938}{37} +\siiepos{@filelist}{87.9655}{576.76791}{75} +\siiepos{@firstofone}{78.55093}{463.95224}{37} +\siiepos{@firstoftwo}{78.55093}{451.9971}{37} +\siiepos{@flushglue}{83.25822}{140.80533}{42} +\siiepos{@for}{111.5019}{513.18219}{45} +\siiepos{g@addto@macro}{69.13638}{394.49792}{383} +\siiepos{GenericError}{73.84366}{286.28459}{46} +\siiepos{GenericInfo}{78.55093}{522.39859}{46} +\siiepos{@gobblefour}{78.55093}{497.60475}{37} +\siiepos{@gobble}{97.38007}{521.51503}{37} +\siiepos{@gobbletwo}{83.25822}{509.55989}{37} +\siiepos{hexnumber@}{83.25822}{571.48509}{178} +\siiepos{hideskip}{92.67278}{453.08853}{22} +\siiepos{@iden}{106.79463}{406.38943}{37} +\siiepos{@ifclasslater}{69.13638}{616.91463}{376} +\siiepos{@ifclassloaded}{64.4291}{767.74863}{376} +\siiepos{@iffileonpath}{69.13638}{150.01534}{73} +\siiepos{if@filesw}{87.9655}{779.70377}{70} +\siiepos{ifin@}{106.79463}{593.51366}{157} +\siiepos{ifnot@nil}{87.9655}{553.58012}{143} +\siiepos{@ifpackagelater}{59.72182}{628.86977}{376} +\siiepos{@ifpackageloaded}{55.01453}{779.70377}{376} +\siiepos{if@partsw}{87.9655}{767.74863}{70} +\siiepos{if@tempswa}{83.25822}{348.22577}{42} +\siiepos{in@}{116.20918}{605.4688}{157} +\siiepos{iterate}{97.38007}{767.74863}{26} +\siiepos{@ixpt}{106.79463}{328.01884}{131} +\siiepos{l@ngrel@x}{87.9655}{145.68292}{32} +\siiepos{loop}{111.5019}{779.70377}{26} +\siiepos{@makeother}{83.25822}{570.09033}{216} +\siiepos{maxdimen}{92.67278}{465.04367}{22} +\siiepos{MessageBreak}{73.84366}{590.14438}{46} +\siiepos{@Miii}{106.79463}{445.91852}{42} +\siiepos{@Mii}{111.5019}{457.87366}{42} +\siiepos{@Mi}{116.20918}{469.8288}{42} +\siiepos{@Miv}{111.5019}{433.96338}{42} +\siiepos{@MM}{116.20918}{623.4547}{20} +\siiepos{m@ne}{111.5019}{601.9707}{21} +\siiepos{@M}{120.91647}{635.40984}{20} +\siiepos{@m}{120.91647}{647.36497}{20} +\siiepos{@ne}{116.20918}{737.7162}{20} +\siiepos{@nnil}{106.79463}{616.65128}{45} +\siiepos{null}{111.5019}{265.03508}{25} +\siiepos{@obsoletefile}{69.13638}{682.53369}{75} +\siiepos{@onelevel@sanitize}{45.59998}{542.79277}{41} +\siiepos{@onlypreamble}{69.13638}{338.95767}{32} +\siiepos{@pkgextension}{69.13638}{507.12662}{375} +\siiepos{p@}{120.91647}{418.60434}{22} +\siiepos{@protected@testopt}{45.59998}{136.21292}{33} +\siiepos{@ptionlist}{83.25822}{176.96553}{375} +\siiepos{remove@star}{78.55093}{438.01378}{143} +\siiepos{remove@to@nnil}{64.4291}{461.92406}{143} +\siiepos{rem@pt}{102.08734}{402.0999}{122} +\siiepos{repeat}{102.08734}{755.79349}{26} +\siiepos{@sanitize}{87.9655}{626.47874}{41} +\siiepos{@secondoftwo}{73.84366}{440.04196}{37} +\siiepos{@settopoint}{78.55093}{386.73682}{114} +\siiepos{sixt@@n}{97.38007}{701.85078}{20} +\siiepos{skip@}{106.79463}{481.62231}{21} +\siiepos{space}{106.79463}{337.56291}{25} +\siiepos{@spaces}{97.38007}{233.35391}{50} +\siiepos{@sptoken}{92.67278}{213.96835}{40} +\siiepos{@star@or@long}{69.13638}{225.38385}{32} +\siiepos{@starttoc}{87.9655}{283.38025}{296} +\siiepos{strip@prefix}{73.84366}{356.49013}{11} +\siiepos{strip@pt}{92.67278}{414.05504}{122} +\siiepos{strutbox}{92.67278}{734.27771}{27} +\siiepos{@tempboxa}{87.9655}{256.4905}{42} +\siiepos{@tempcnta}{87.9655}{394.0934}{42} +\siiepos{@tempcntb}{87.9655}{382.13826}{42} +\siiepos{@tempdima}{87.9655}{313.31702}{42} +\siiepos{@tempdimb}{87.9655}{301.36188}{42} +\siiepos{@tempdimc}{87.9655}{289.40674}{42} +\siiepos{@tempskipa}{83.25822}{221.58173}{42} +\siiepos{@tempskipb}{83.25822}{209.62659}{42} +\siiepos{@temptokena}{78.55093}{175.71408}{42} +\siiepos{@testopt}{92.67278}{252.89267}{33} +\siiepos{@tfor}{106.79463}{343.95984}{45} +\siiepos{@thirdofthree}{69.13638}{370.74442}{37} +\siiepos{thr@@}{106.79463}{713.80592}{20} +\siiepos{toks@}{106.79463}{469.66718}{21} +\siiepos{tw@}{116.20918}{725.76106}{20} +\siiepos{@unusedoptionlist}{50.30725}{685.65668}{375} +\siiepos{@vbsphack}{87.9655}{736.86452}{62} +\siiepos{@viiipt}{97.38007}{363.12321}{131} +\siiepos{@viipt}{102.08734}{398.22762}{131} +\siiepos{@vipt}{106.79463}{433.33199}{131} +\siiepos{voidb@x}{97.38007}{382.73892}{22} +\siiepos{@vpt}{111.5019}{468.43637}{131} +\siiepos{@whiledim}{87.9655}{510.31464}{44} +\siiepos{@whilenum}{87.9655}{567.50005}{44} +\siiepos{@whilesw}{92.67278}{440.17783}{44} +\siiepos{wlog}{111.5019}{565.70679}{21} +\siiepos{@writefile}{83.25822}{449.68938}{212} +\siiepos{@xiipt}{102.08734}{222.7057}{131} +\siiepos{@xipt}{106.79463}{257.81009}{131} +\siiepos{@xivpt}{102.08734}{187.60133}{131} +\siiepos{@xpt}{111.5019}{292.91446}{131} +\siiepos{@xviipt}{97.38007}{152.49695}{131} +\siiepos{@xxpt}{106.79463}{117.39256}{131} +\siiepos{@xxvpt}{102.08734}{779.70377}{132} +\siiepos{@xxxii}{102.08734}{504.73756}{42} +\siiepos{zap@space}{87.9655}{639.23088}{381} +\siiepos{z@}{120.91647}{406.6492}{22} +\siiepos{z@skip}{102.08734}{394.69406}{22} +\siiepos{@dblarg}{144.7269}{382.64244}{31} +\siiepos{filename@parse}{144.7269}{274.5259}{12} +\siiepos{@ifdefinable}{144.7269}{311.46509}{31} +\siiepos{@ifnextchar}{144.7269}{466.32841}{31} +\siiepos{@ifstar}{144.7269}{420.99852}{31} +\siiepos{@ifundefined}{144.7269}{347.3305}{31} +\siiepos{input@path}{144.7269}{466.08487}{12} +\siiepos{input}{144.7269}{400.3316}{374} +\siiepos{@namedef}{144.7269}{514.70245}{31} +\siiepos{@nameuse}{144.7269}{490.2387}{31} +\siiepos{@@par}{144.7269}{387.73839}{54} +\siiepos{@restorepar}{144.7269}{411.37193}{54} +\siiepos{@setpar}{144.7269}{465.26593}{54} + +% Load the external references +%\zexternaldocument{\sourceIIe} + +\title{List of internal \LaTeX2e Macros useful to Package Authors} +\author{Compiled by Martin Scharrer\\\url{martin@scharrer-online.de}} +\date{Version 0.4 -- July 23rd 2011} + +\setlength{\descindent}{0pt} +\setlength{\parindent}{0pt} +\makeatletter +\begin{document} +\maketitle +\begin{abstract} +This document lists the internal macros defined by the \LaTeX2e base files which can be also useful +to package authors. The macros are hyper-linked to their description in \emph{source2e}. +For this to work both PDFs must be inside the same directory. + +This document is not yet complete in content and format and may miss some macros. +\end{abstract} + +\begin{multicols}{2} +\tableofcontents +\end{multicols} + +\clearpage + +\section{Constants} + +\subsection{Number Constants} + +Some of the following integer values are defined using `\countdef` (for $-1$), +`\chardef` (for values between 0--255) and `\mathchardef` ($>255$). They are +robust and do not expand in an `\edef` context. When used on the right side of an +assignment the act the same way as a count register. The `\m@ne` is a real count register and can +still be modified, but doing so would certainly break various code. In the terms defined by +\emph{The TeXbook}, this integer constants yield \emph{internal integers} rather than \emph{integer +denotations}. + +The other numbers are defined as normal macros, which will simply expand to the containing number. +They were defined +to be used to set font sizes, which explains the non-integer numbers. Please note that if they +are used for an assignment or other numeric context (e.g.\ |\ifnum|) TeX will keep expanding the +following tokens until a non-numeric token is found.%, e.g.\ a space or |\relax|. + + +\bigskip +\noindent\hbox to \linewidth\bgroup\hss +\begin{tabular}{lrl} + \toprule + Macro & Value & Defined using \\ + \midrule + \Macro\@ne & 1 & chardef \\ + \Macro\tw@ & 2 & chardef \\ + \Macro\thr@@ & 3 & chardef \\ + \Macro\sixt@@n & 16 & chardef \\ + \Macro\@xxxii & 32 & chardef \\ + \Macro\@cclv & 255 & chardef \\ + \Macro\@cclvi & 256 & mathchardef \\ + \Macro\@m & 1000 & mathchardef \\ + \Macro\@M & 10000 & mathchardef \\ + \Macro\@Mi & 10001 & mathchardef \\ + \Macro\@Mii & 10002 & mathchardef \\ + \Macro\@Miii & 10003 & mathchardef \\ + \Macro\@Miv & 10004 & mathchardef \\ + \Macro\@MM & 20000 & mathchardef \\ + \bottomrule +\end{tabular} +\hss +\begin{tabular}{lrl} + \toprule + Macro & Value & Defined using \\ + \midrule + \Macro\@vpt & 5 & def \\ + \Macro\@vipt & 6 & def \\ + \Macro\@viipt & 7 & def \\ + \Macro\@viiipt & 8 & def \\ + \Macro\@ixpt & 9 & def \\ + \Macro\@xpt & 10 & def \\ + \Macro\@xipt & 10.95 & def \\ + \Macro\@xiipt & 12 & def \\ + \Macro\@xivpt & 14.4 & def \\ + \Macro\@xviipt & 17.28 & def \\ + \Macro\@xxpt & 20.74 & def \\ + \Macro\@xxvpt & 24.88 & def \\ + \\%\midrule + \Macro\m@ne & $-1$ & countdef \\ + \bottomrule +\end{tabular}% +\hss\egroup + + +\subsection{Dimension Constants} +The following dimension and skip constants are defined using registers. They must not be changed. + +\begin{center} +\begin{tabularx}{\linewidth}{lrlX} + \toprule + Macro & Value & Defined using & Notes \\ + \midrule + \Macro\p@ & 1pt & newdimen & Can be used as a replacement of pt behind a number due to the resulting multiplication \\ + \Macro\z@ & 0pt & newdimen & Can be used both for 0pt and 0 \\ + \Macro\maxdimen & 16383.99999pt & newdimen & Largest valid dimension \\ + \bottomrule +\end{tabularx} +\par\medskip +\begin{tabularx}{\linewidth}{lrlX} + \toprule + Macro & Value & Defined using & Notes\\ + \midrule + \Macro\z@skip & 0pt plust0pt minus0pt & newskip & \\ + \Macro\hideskip & $-1000$pt plus 1fill & newskip & negative but can grow \\ + \Macro\@flushglue & 0pt plus 1fil & newskip & \\ + \bottomrule +\end{tabularx} +\end{center} + +\subsection{String Constants} +The following macros hold common strings and are fully expandable. +Some special characters are defined here as their verbatim ASCII representation. +This makes them useful if such characters are to be written into an auxiliary file. + +\bigskip\noindent +\begin{tabularx}{\linewidth}{llX} + \toprule + Macro & Value & Note\\ + \midrule + \Macro\space & One space & An explicit space (catcode 10 \qq{space}).\\ + \Macro\@spaces & Four spaces & Contains $4\times$\Macro\space.\\ + \Macro\empty & Empty string & Commonly used to define empty macros using \Macro\let. \\ + \Macro\@empty & Empty string & Same as above. Used by the \LaTeX{} kernel commands. \\ + \Macro\@backslashchar & \qq{\texttt{\@backslashchar}} & Backslash with catcode 12 (other), i.e. simple ASCII backlash usable in e.g.\ \Macro\write.\\ + \Macro\@percentchar & \qq{\texttt{\@percentchar}} & Percent character with catcode 12 (other), i.e. simple ASCII percent usable in e.g.\ \Macro\write.\\ + \Macro\@charlb & \qq{\texttt{\@charlb}} & Left brace with catcode 11 (letter). \\ + \Macro\@charrb & \qq{\texttt{\@charrb}} & Right brace with catcode 11 (letter). \\ + \Macro\@clsextension & \qq{\texttt{cls}} & Used for comparison with \Macro\@currext. \\ + \Macro\@pkgextension & \qq{\texttt{sty}} & Used for comparison with \Macro\@currext. \\ + \Macro\@depth & \qq{\texttt{depth}} & Used for box size declarations (\Macro\hb@xt@).\\ + \Macro\@height & \qq{\texttt{height}} & Used for box size declarations.\\ + \Macro\@width & \qq{\texttt{width}} & Used for box size declarations.\\ + \Macro\@minus & \qq{\texttt{minus}} & Used for skip declarations.\\ + \Macro\@plus & \qq{\texttt{plus}} & Used for skip declarations.\\ + \bottomrule +\end{tabularx} + +\subsection{Token Constants} +The following macros are defined using \Macro\let<macro>'='<token> and therefore equal to this token. They are useful for |\ifx| comparisons +with tokens read by |\let| or |\futurelet|. + +\bigskip\noindent +\begin{tabular}{llll} + \toprule + Name & Token & Catcode & Note \\ + \midrule + \Macro\@sptoken & Space & 10 & Should not be confused with \Macro\space \\ + \Macro\bgroup & |{| & 1 & Begin of group \\ + \Macro\egroup & |}| & 2 & End of group \\ + \bottomrule +\end{tabular} + +\subsection{Other} + +\begin{tabularx}{\linewidth}{lllX} + \toprule + Macro & Value & Defined using & Notes \\ + \midrule + \Macro\voidb@x & (void) & newbox & permanently void box register \\ + \Macro\@undefined & (undef) & (undefined) & This macro is not defined. + It is used to test if other macros are undefined (using \Macro\ifx) or set them to an undefined state (using \Macro\let).\\ + \bottomrule +\end{tabularx} + + +\clearpage +\section{Variables} + +\subsection{Temporary Variables} +The following variables are defined and used by the \LaTeX{} kernel commands as scratch registers and macros. +They can be used with care, but should only be redefined inside a local group to avoid interference with other +code. Care must also be taken if they are used together with external macros, which might use them as well +-- maybe not yet but in the next release. + +\par\bigskip\noindent +\begin{tabularx}{\linewidth}{llX} + \toprule + Temp variable & Type & Note \\ + \midrule + \Macro\count@ & counter & \\ + \Macro\@tempcnta & counter & \\ + \Macro\@tempcntb & counter & \\ + \Macro\dimen@ & dimension & \\ + \Macro\dimen@i & dimension & Marked as \qq{global only} \\ + \Macro\dimen@ii & dimension & \\ + \Macro\@tempdima & dimension \\ + \Macro\@tempdimb & dimension \\ + \Macro\@tempdimc & dimension \\ + \Macro\@tempa & macro \\ + \Macro\@tempb & macro \\ + \Macro\@tempc & macro \\ + \Macro\@gtempa & macro & For temporary definitions which must be made global\\ + \Macro\skip@ & skip & \\ + \Macro\@tempskipa & skip \\ + \Macro\@tempskipb & skip \\ + \Macro\toks@ & token register & \\ + \Macro\@temptokena & token register \\ + \Macro\if@tempswa & if switch & Comes with the usual setters \Macro\@tempswatrue and \Macro\@tempswafalse \\ + \Macro\@tempboxa & box register \\ + \Macro\@let@token & \q{let} & Used by \Macro\@ifnextchar to temporary store the next token using \Macro\futurelet. Can be used for similar purposes. \\ + \bottomrule +\end{tabularx} + + +\subsection{Dimension Variables} + +\par\bigskip\noindent +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\@wholewidth & + This |dimen| register holds the half line width (thickness) in \env{picture} environments. \\ + \Macro\@halfwidth & + This |dimen| register hold the full line width (thickness) in \env{picture} environments. \\ + \bottomrule +\end{tabularx} + +\subsection{String and Other Variables} + +\par\bigskip\noindent +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\@currext & Extension of the current package or class file, empty outside. \\ + \Macro\@currname & File name base of the current package or class file, empty outside. \\ + \Macro\@currenvir & Name of the current environment. \\ + \Macro\@currenvline & Line number of the begin of the current environment \\ + \Macro\@currentlabel & The value a \Macro\label will point to. Set by \Macro\stepcounter and \Macro\refstepcounter. \\ + \bottomrule +\end{tabularx} + + +\section{Macros} + +\subsection{Macro Definition} +\DescribeMacro\@namedef{<name>}<parameter list>{<definition>} +\noindent +Defines macro \MacroArgs'\'<name>\relax using \Macro\def. Can be prefixed with \Macro\long and \Macro\global. + +\DescribeMacro\@nameuse{<name>} +\noindent +Expands to macro \MacroArgs'\'<name>. + +\DescribeMacro\@ifnextchar<token>{<yes>}{<no>} +\noindent +Tests if next non-space token is equal to \MacroArgs<token>. + +\DescribeMacro\@ifstar{<yes>}{<no>} +\noindent +Tests of next non-space token is "*". Removes star for \MacroArgs<yes> branch. + +\DescribeMacro\@dblarg{<cmd>}{<arg>} +\noindent +Expands to \MacroArgs<cmd>[<arg>]{<arg>}. + +\DescribeMacro\@ifundefined{<name>}{<yes>}{<no>} +\noindent +Tests if \MacroArgs!\@backslashchar!<name> is defined (and not equal to \Macro\relax). + +\DescribeMacro\@ifdefinable'\'<name>{<yes>} +\noindent +Tests if \MacroArgs'\'<name> is undefined, \MacroArgs<name> not "relax" +and doesn't start with "end", and if \Macro{end}<name> is not defined. + +\DescribeMacro\@onlypreamble<macro> +\noindent +The given \meta{macro} is marked as only be valid in the preamble. It will be redefined as an error message AtBeginDocument. + +\DescribeMacro\@star@or@long +\noindent +Tests for a following "*", if found \Macro\l@ngrel@x will be let to \Macro\relax, but \Macro\long +otherwise. It can the be used before \Macro\def as an potential prefix. + +\DescribeMacro\@testopt{<1>}{<2>} +\noindent +Short for \Macro\@ifnextchar'['{<1>}{<1>[{<2>}]}, i.e.\ \meta{2} will be used as default argument if non was given. + +\DescribeMacro\@protected@testopt +\noindent +Robust version of \Macro\@testopt? + +\DescribeMacro\addto@hook<token register>{<code>} +\noindent +Appends code to the token register. + +\DescribeMacro\g@addto@macro<macro>{<code>} +\noindent +Appends \meta{code} to the definition of \MacroArgs<macro>.\\ + +\subsection{Expanding/Gobbling Arguments} +\par\bigskip\noindent +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\@gobble{<arg>} & Removes (gobbles) its argument. (long)\\ + \Macro\@gobbletwo{<arg 1>}{<arg 2>} & Removes (gobbles) two arguments. (long)\\ + \Macro\@gobblefour{<1>}{<2>}{<3>}{<4>} & Removes (gobbles) four arguments. (long)\\ + \Macro\@gobblecr & Gobbles a following carriage return, ignores spaces otherwise \\ + \Macro\@firstofone{<arg>} & Expands to \meta{arg}, i.e. is used to remove braces. (long)\\ + \Macro\@iden{<arg>} & Identity. Same as \Macro\@firstofone for compatibility reasons. (long)\\ + \Macro\@firstoftwo{<1>}{<2>} & Expands to \meta{1}, discards \meta{2}. (long)\\ + \Macro\@secondoftwo{<1>}{<2>} & Expands to \meta{2}, discards \meta{1}. (long)\\ + \Macro\@thirdofthree{<1>}{<2>}{<3>} & Expands to \meta{3}, discards \meta{1} and \meta{2}. (long)\\ + \Macro\@expandtwoargs\AlsoMacro\macro{<1>}{<2>} & Expands the two arguments using \Macro\edef and feeds it to \Macro\macro.\\ + \bottomrule +\end{tabularx} + +\subsection{Lists} + +\DescribeMacro\in@{<1>}{<2>} +Checks if first argument occurs in the second and sets the switch \Macro\ifin@ accordantly. +The arguments are not expanded. This must be done beforehand. + +\DescribeMacro\@removeelement{<element>}{<list>}{<cs>} +Removes an element from a comma-separated list and puts it into a control sequence. + +\subsection{Loops} +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\loop' ... '\AlsoMacro\iterate' ... '\AlsoMacro\repeat & \\ + \Macro\@whilenum <test> \AlsoMacro\do {<body>} & While loop with \Macro\ifnum test. \\ + \Macro\@whiledim <test> \AlsoMacro\do {<body>} & While loop with \Macro\ifdim test. \\ + \Macro\@whilesw <switch> \AlsoMacro\fi {<body>} & While loop with \MacroArgs<switch> test. \\ + \Macro\@for<macro>':='<list>\AlsoMacro\do{<body>} & For loop. The \MacroArgs<list> is supposed to expand to a comma separated list. + Defines \MacroArgs<macro> to each element of the list and executes \meta{body} each time. + Supports an empty lists without errors. \\ + \Macro\@tfor<macro>':='<list>\AlsoMacro\do{<body>} & For loop. The \MacroArgs<list> is not expanded and taken as a list of tokens or \MacroArgs{...}. + Defines \MacroArgs<macro> to each element of the list and executes \meta{body} each time. + Supports an empty lists without errors. \\ + \Macro\@break@tfor & Break out of a \Macro\@tfor loop. This should be called \emph{inside} the scope of an \Macro\fi.\\ + \bottomrule +\end{tabularx} +\par\bigskip\noindent +NOTES:\par\vspace{-1ex} +\begin{enumerate}\itemsep=0pt + \item These macros use no |\@temp| sequences. + \item These macros do not work if the body contains anything that +looks syntactically to TeX like an improperly balanced |\if \else \fi|. +\end{enumerate} + +\subsection{Colors} +The following macros are defined equal to |\relax| by LaTeX2e as placeholder for the +real code added by the \pkg{color} or \pkg{xcolor} package. +They are needed to handle colors inside saved boxes correctly. +See the definitions of \Macro\sbox for an example. + +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Definition given by \pkg{color} \\ + \midrule + \Macro\color@begingroup & \leavevmode\Macro\begingroup \\ + \Macro\color@endgroup & \leavevmode\Macro\endgroup \\ + \Macro\color@setgroup & \leavevmode\Macro\begingroup\AlsoMacro\set@color \\ + \Macro\color@hbox & \leavevmode\Macro\hbox\AlsoMacro\bgroup\AlsoMacro\color@begingroup \\ + \Macro\color@vbox & \leavevmode\Macro\vbox\AlsoMacro\bgroup\AlsoMacro\color@begingroup \\ + \Macro\color@endbox & \leavevmode\Macro\color@endgroup\AlsoMacro\egroup \\ + \bottomrule +\end{tabularx} + +\subsection{Auxiliary Macros} + +This auxiliary macros were originally defined to handle font changes but can be used for other code as well. +\par\bigskip\noindent +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\ifnot@nil{<1>}{<2>} & Checks if \meta{1} is the token \Macro\@nil. If so gobbles \meta{2} + otherwise uses \Macro\@firstofone to remove the braces around \meta{2}.\\ + \Macro\@nil & This macro is undefined on purpose and used as endmarker in loops and other macros which process token lists. \\ + \Macro\@nnil & Definition contains only \Macro\@nil and is used beside others to test for the presents of \Macro\@nil in \Macro\ifnot@nil. Is also used as endmarker.\\ + \Macro\remove@to@nnil & Removes everything behind it until and including \Macro\@nnil.\\ + \Macro\remove@star & Removes everything behind it until and including *.\\ + \Macro\zap@space<text>!\verb*+ +!\AlsoMacro\@empty & Removes all spaces from \meta{text}. Expandable. \\ + \Macro\strip@prefix & Removes everything up to and including to the next \texttt{>}. \\ + \bottomrule +\end{tabularx} + +\subsection{Catcodes} + +\par\bigskip\noindent +\begin{tabularx}{\linewidth}{lX} + \toprule + Name & Description \\ + \midrule + \Macro\strip@prefix & Removes everything up to and including to the next \texttt{>}. \\ + \Macro\@makeother{<letter>} & Changes the catcode of the letter to \q{other} (12). Special letters must be escaped with a backslash. \\ + \Macro\@sanitize & Changes catcodes of everything except braces to \q{other} (12).\\ + \Macro\@onelevel@sanitize<macro> & Sanitizes \meta{macro}, turns it definition into verbatim code. Resulting characters except spaces are in catcode \q{other} (12)! Uses \Macro\meaning and \Macro\strip@prefix. (With $\epsilon$-\TeX\ many applications can be replaced by \Macro\detokenize{<content>}.) \\ + \bottomrule +\end{tabularx} + + +\subsection{Messages} +\DescribeMacro\MessageBreak +\noindent +Inside a message this macro create a new line followed by a continuation text. Outside it is equal to |\relax|. + +\DescribeMacro\GenericInfo{<continuation>}{<message>} +\noindent +Prints \meta{message} to a log file. An included \Macro\MessageBreak\relax will cause a new line which start with \meta{continuation}. + +\DescribeMacros + \hbox{\Macro\GenericError{<continuation>}{<error message>}}% + \hbox{\phantom{\ttfamily\textbackslash GenericError}\MacroArgs{<where to go for further information>}{<help text>}}% +\endDescribeMacros +\noindent +Print error message to log file followed by the \q{further information} line. +The help text is displayed if the user presses "h". + +\DescribeMacro\wlog{<log message>} +\noindent +Write on log file only. + +\subsection{Dimensions, Length and Skips} + +\par\bigskip\noindent +\begin{tabularx}{\linewidth}{lX} + \toprule + Name & Description \\ + \midrule + \Macro\@settopoint<register> & Rounds register to whole number of points. \\ + \Macro\rem@pt<dimension value> & Awaits a value dimension value (\MacroArgs<int>'.'<frac>'pt') as string where the "pt" is removed. If \meta{frac} is numerical equal to 0, then it and the decimal dot are removed as well. \\ + \Macro\strip@pt<dimension> & Expands dimension using \cs{the} and strips the "pt" using \Macro\rem@pt. \\ + \Macro\@killglue & + Removes (|\unskip|s) the last and then all further skips (|\lastskip|) till one with a size of zero is reached. \\ + \bottomrule +\end{tabularx} + +\DescribeMacro\@defaultunits +\noindent +Used to provide a default unit for |dimen| or |skip| assignment.\\ +Usage: |\@defaultunits\dimen=#1pt\relax\@nnil|. +Other units can be used instead of "pt". + +\subsection{Class and Package Options} + +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\@classoptionslist & List of options of the main class. \\ + \Macro\@unusedoptionlist & List of options to the main class that haven't been declared. \\ + \Macro\@declaredoptions & Comma separated list of the options declared by the current package or class. + The list is in the order in which the options were declared. \\ + \bottomrule +\end{tabularx} + +\subsection{Files} + +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\if@filesw & If false the package should not be produce or write to output files. Set to false by \cs{nofiles}.\\ + \Macro\if@partsw & \\ + \Macro\@currdir & Holds the current directory, e.g. "./" in an Unix OS. \\ + \Macro\input@path & List of input paths. Each path should be enclosed in braces with no delimiters between paths. \\ + \Macro\@filelist & The comma separated list of all files read so far. Only active if \cs{listfiles} is used in the preamble. \\ + \Macro\@inputcheck& Input file handle to check for the existence of the file.\\ + \Macro\@unused & Output file handle used to reserve the standard output. Used in \Macro\typeout to write to the terminal.\\ + \Macro\@mainaux & Output file handle for the main |aux| file.\\ + \Macro\@partaux & Output file handle for include file |aux| files.\\ + \Macro\@auxout & Let to \Macro\@partaux inside include files, but to \Macro\@mainaux otherwise.\\ + \Macro\@partlist & Holds the comma-separated list defined by \Macro\includeonly. \\ + \Macro\@pushfilename & pushes file name, extension and current catcode of "@" onto the file stack. \\ + \Macro\@popfilename & pushes file name, extension and current catcode of "@" onto the file stack. \\ + \Macro\@currnamestack & file name stack.\\ + \bottomrule +\end{tabularx} + + +\DescribeMacro\filename@parse{<filename>} +\noindent +Parses \meta{filename} and provides its directory, name base and extension in \Macro\filename@area, +\Macro\filename@base and \Macro\filename@ext. The latter is let to \Macro\relax if it does not +exists. + +\DescribeMacro\@filef@und +The macro \Macro\IfFileExists (which is used by \Macro\InputIfFileExists) stores the found file followed by a space in this macro. + +\DescribeMacro\@starttoc{<ext>} +\noindent +Reads the file with the given extension (\texttt{\string\jobname.}\meta{ext}) and opens it for +writing afterwards. The file is initially empty. Creates the output file handle \Macro\tf@<ext>. + +\DescribeMacro\@writefile{<ext>}{<code>} +\noindent +Writes code using the output handle \Macro\tf@<ext> if it exists. + + +\DescribeMacro\@iffileonpath{<filename>} +\noindent +Check if given file is found by \TeX{} directly or in any of the directories given by \cs{input@path}. + +\DescribeMacro\@obsoletefile{<new>}{<obsolete>} +\noindent +Prints warning message (only) that now a different file is used a input. + +\DescribeMacro\@addtofilelist{<filename>} +\noindent +Adds the given filename to the list of files. Only active if \cs{listfiles} is used in the preamble. + +\DescribeMacro\@ptionlist{<filename>} +\noindent +Expands the option list of package, class or file given by full filename. + +\DescribeMacro\@ifpackageloaded{<package>}{<true>}{<false>} +\DescribeMacro\@ifclassloaded{<class>}{<true>}{<false>} +\DescribeMacro\@ifl@aded{<extension>}{<file base>}{<true>}{<false>} +Tests if given package/class/file has been loaded. + + +\DescribeMacros +\Macro\@ifpackagewith{<name>}{<option-list>}{<true>}{<false>} +\Macro\@ifclasswith{<name>}{<option-list>}{<true>}{<false>} +\Macro\@if@ptions{<extension>}{<name>}{<option-list>}{<true>}{<false>} +\endDescribeMacros +\noindent +Tests if given package/class/file has been loaded with the given options. + +\DescribeMacros +\Macro\@ifpackagelater{<name>}{<date YYYY/MM/DD>}{<true>}{<false>} +\Macro\@ifclasslater{<name>}{<date YYYY/MM/DD>}{<true>}{<false>} +\Macro\@ifl@ter{<extension>}{<file base>}{<date YYYY/MM/DD>}{<true>}{<false>} +\endDescribeMacros +\noindent +Tests if given package/class/file has been loaded with a version more recent than \meta{version}. + + +\subsection{Saved plain\TeX{} primitives} +The following plain\TeX{} macros are redefined by \LaTeX{} and therefore saved away first: + +\par\bigskip\noindent +\begin{tabularx}{\linewidth}{llX} + \toprule + \LaTeX{} Macro & plain\TeX{} original & Description/Note \\ + \midrule + \Macro\@@par & \Macro{par} & Some \LaTeX{} environments redefine \Macro{par} locally \\ + \Macro\@@input & \Macro\input & Syntax: \Macro\input~<filename> \\ + \Macro\@@end & \Macro{end} & \\ + \Macro\@@underline & \Macro\underline & \\ + \Macro\frozen@everymath & \Macro\everymath & \\ + \Macro\frozen@everydisplay & \Macro\everydisplay & \\ + \bottomrule +\end{tabularx} + +\subsection{Fonts} +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\f@encoding & Holds the current font encoding. \\ + \Macro\f@family & Holds the current font family. \\ + \Macro\f@series & Holds the current font series. \\ + \Macro\f@shape & Holds the current font shape. \\ + \Macro\f@size & Holds the current font size (in pt but without unit). \\ + \Macro\f@baselineskip & Holds the current baseline skip (in pt but without unit). \\ + \Macro\f@linespread & Holds the current internal value for \Macro\baselinestretch. \\ + \Macro\@currsize & Let to the last font size command (e.g.\ |\small|). \\ + \Macro\curr@math@size & Holds locally the current math size. \\ + \Macro\curr@fontshape & |\f@encoding /\f@family /\f@series /\f@shape| \\ + \bottomrule +\end{tabularx} + +\subsection{Paragraph} +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\@@par & Plain\TeX{} primitive \cs{par}. \\ + \Macro\@setpar{<val>} & Used to make environment-wide changes to \cs{par}. Sets both \cs{par} and \cs{@par} to \meta{val}. \\ + \Macro\@restorepar & Defines \cs{par} to \cs{@par}. \\ + \bottomrule +\end{tabularx} + +\subsection{Space Hack} +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\@bsphack & \\ + \Macro\@esphack & Both of these macro ensure that the code between them does not insert any spaces into the document. + The code itself should not produce any text and not change the mode (e.g.\ start or stop math mode).\\ + \Macro\@Esphack & Variant of \cs{@esphack} which sets the |@ignore| switch to true which causes an \cs{ignorespaces} + after the \cs{end} of the environment.\\ + \Macro\@vbsphack & Variant of \cs{@bsphack} which ensure the invisible material is \emph{not} set in vmode. Not used by \LaTeX{} itself at the moment. \\ + \bottomrule +\end{tabularx} + +\subsection{Boxes} +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\null & Empty \Macro\hbox. Good to fill places which must not be empty. \\ + \Macro\strutbox & Box with dimension of |\strut|, i.e.\ maximum height and depth of the current font and zero width. Can be used to extract this dimension + with \texttt{\string\ht\string\strutbox} and \texttt{\string\dp\string\strutbox}. \\ + \Macro\@arstrutbox & Defined inside array and tabular. Like \Macro\strutbox but stretched by \Macro\arraystretch. \\ + \Macro\@begin@tempboxa<box>{<content>} & Stores \meta{content} into \Macro\@tempboxa as \meta{box} (\cs{hbox} or \cs{vbox}) and stores its dimension into \Macro\width, \Macro\height, \Macro\depth and \Macro\totalheight. \\ + \Macro\@end@tempboxa & Ends a \Macro\@begin@tempboxa environment. \\ + \Macro\hb@xt@ & \Macro\hbox~'to' \\ + \Macro\hmode@bgroup & \Macro\leavevmode\AlsoMacro\bgroup \\ + \bottomrule +\end{tabularx} + +\DescribeMacro\@settodim{<dimension cs>}{<length register>}{<content>} +Sets the \meta{length register} to the dimension given by the \meta{dimension} (\Macro\ht, \Macro\dp and \Macro\wd\relax) of the \meta{content}. +Example: \Macro\@settodim{\Macro\wd}{\Macro\@tempdima}{Hello World} +will set \Macro\@tempdima to the width of \qq{Hello World}. + + + + +\subsection{Base Conversion} +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule + \Macro\hexnumber@{<number>} & Returns a single digit hexadecimal number (\mbox{0--9}, \mbox{A--F}) from given \meta{number}, which must either be a numeric register or a number ending with a space! \\ + \Macro\@alph{<number>} & Expands to lower case letter corresponding to the given number (1=a, 2=b, \ldots). Expands to \Macro\@ctrerr if number is larger then~26.\\ + \Macro\@Alph{<number>} & Expands to upper case letter corresponding to the given number (1=A, 2=B, \ldots). Expands to \Macro\@ctrerr if number is larger then~26.\\ + \Macro\two@digits{<number>} & + Returns \meta{number} (e.g.\ a |count| register) as string and ensures that it has at least two digits + by appending a "0" if required. \\ + \bottomrule +\end{tabularx} + +\subsection{Conditionals} + +\begin{tabularx}{\linewidth}{lX} + \toprule + Macro & Description \\ + \midrule +\Macro{if@compatibility} & Switch to indicate if the LaTeX2.09 compatibility mode is active. \\ +\Macro{if@ignore} & Whether or not to ignore spaces after an environment. Set to true by \Macro\ignorespacesafterend.\\ +\Macro{if@minipage} & True for a |minipage|, false for a |parbox|. Responsible for adding space, skips and paragraph indents for a |parbox|.\\ +\Macro{if@twoside} & True for two-sided documents \\ +\Macro{if@twocolumn} & Indicates if two-column mode is active \\ +\Macro{if@firstcolumn}& Indicates if the first column is processed \\ + \bottomrule +\end{tabularx} + + +% ToDo Check footnote makros + + +\end{document} + + diff --git a/Master/tlpkg/tlpsrc/collection-documentation-english.tlpsrc b/Master/tlpkg/tlpsrc/collection-documentation-english.tlpsrc index fcef3412f09..1219c13e341 100644 --- a/Master/tlpkg/tlpsrc/collection-documentation-english.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-documentation-english.tlpsrc @@ -26,6 +26,7 @@ depend latex2e-help-texinfo depend latex4wp depend latexcheat depend lshort-english +depend macros2e depend math-e depend mathmode depend memdesign diff --git a/Master/tlpkg/tlpsrc/macros2e.tlpsrc b/Master/tlpkg/tlpsrc/macros2e.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/macros2e.tlpsrc |