From b2fa76c1ab2a3450375bf999807941f7923a056a Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 22 Jul 2022 11:30:42 +0100 Subject: [PATCH] mdwref.dtx: Build the table the old-fashioned way. It's going to become impractical to do this. Besides, the machinery was only used for the documentation (which is rather nasty) and doesn't work well in other circumstances. --- mdwref.dtx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/mdwref.dtx b/mdwref.dtx index 66c2d07..fe386b0 100644 --- a/mdwref.dtx +++ b/mdwref.dtx @@ -124,10 +124,21 @@ % A number of useful prefixes are already defined, following my usual % preferences; they're shown in \xref{tab:defs}. % \begin{table} -% \def\i#1#2{\texttt{#1}&\texttt{#2}\\} % \begin{tabular}[C]{ll} \hlx*{hv} % \textbf{Prefix} & \textbf{Text} \\ \hlx{vhv} -% \csname xref@defs\endcsname +% \texttt{ch} & chapter $n$ \\ +% \texttt{app} & appendix $n$ \\ +% \texttt{sec} & section $n$ \\ +% \texttt{def} & definition $n$ \\ +% \texttt{th} & theorem $n$ \\ +% \texttt{lem} & lemma $n$ \\ +% \texttt{prop} & proposition $n$ \\ +% \texttt{cor} & corollary $n$ \\ +% \texttt{fig} & figure $n$ \\ +% \texttt{tab} & table $n$ \\ +% \texttt{eq} & equation $n$ \\ +% \texttt{i} & item $n$ \\ +% \texttt{ex} & exercise $n$ \\ % \hlx*{vh}\end{tabular} % \caption{Predefined reference prefixes} % \label{tab:defs} @@ -147,19 +158,12 @@ % % \begin{macro}{\defxref} % Defining prefixes is easy. We store the text for each prefix in a macro -% called \syntax{"\\xref$"}. The only catch is that, for the -% purposes of generating \xref{tab:defs}, we maintain a list of the prefixes -% which have been defined so far, but this is fairly easy. +% called \syntax{"\\xref$"}. % \begin{macrocode} \def\defxref#1#2{% - \toks@\expandafter{\xref@defs\i{#1}{#2}}\xdef\xref@defs{\the\toks@}% \expandafter\def\csname xref$#1\endcsname{#2}% } % \end{macrocode} -% The list is obviously empty initially. -% \begin{macrocode} -\gdef\xref@defs{} -% \end{macrocode} % \end{macro} % % \begin{macro}{\formatxref} -- 2.11.0