chiark / gitweb /
mdwtools.tex: Use `strayman' and `mdwfonts' if available.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 6 Sep 2020 12:25:50 +0000 (13:25 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 7 Sep 2020 16:36:43 +0000 (17:36 +0100)
mdwtools.tex

index 7807d44481759f73078ce34decc263ec1bfd2c51..c8e8932a9326e579df93385f9cc0b6ca1a4c01fe 100644 (file)
@@ -36,7 +36,7 @@
 %</mdwtools>
 % \end{meta-comment}
 %
-% \CheckSum{765}
+% \CheckSum{804}
 %% \CharacterTable
 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
 %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
 % loaded is by seeing if the |\documentclass| command has been redefined
 % to raise an error.  This isn't too hard, really.
 %
+% If my \package{strayman} document class is available, then I'd prefer to
+% use that.
+%
 %    \begin{macrocode}
 \ifx\documentclass\@twoclasseserror\else
-  \documentclass[a4paper]{ltxdoc}
+  \IfFileExists{strayman.cls}
+    {\documentclass[a4paper]{strayman}}
+    {\documentclass[a4paper]{ltxdoc}}
   \ifx\doneclasses\mdw@undefined\else\doneclasses\fi
 \fi
 %    \end{macrocode}
 %
+% If I can use better fonts, then that would be nice.
+%
+%    \begin{macrocode}
+\usepackage[T1]{fontenc}
+\IfFileExists{mdwfonts.sty}
+  {\usepackage[palatino, helvetica, courier, maths=cmr]{mdwfonts}}{}
+%    \end{macrocode}
+%
 % As part of my standard environment, I'll load some of my more useful
 % packages.  If they're already loaded (possibly with different options),
 % I'll not try to load them again.
 \@ifpackageloaded{sverb}{}{\usepackage{sverb}}
 %    \end{macrocode}
 %
+% If I'm not using the \package{ltxdoc} document class then I'll need some of
+% its definitions.  I've no idea why these aren't part of \package{doc}\ldots
 %
+% \begin{macro}{\cmd}
+% \begin{macro}{\cs}
+%    \begin{macrocode}
+\def\cmd#1{\expandafter\cmd@i\string#1\x}
+\def\cmd@i#1#2\x{\cs{#2}}
+\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\marg}
+% \begin{macro}{\oarg}
+% \begin{macro}{\parg}
+%    \begin{macrocode}
+\def\@arg#1#2#3{\texttt{#1}\meta{#2}\texttt{#3}}
+\def\marg#1{\@arg{\char`\{}{#1}{\char`\}}}
+\def\oarg#1{\@arg{[}{#1}{]}}
+\def\parg#1{\@arg{(}{#1}{)}}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+
 % \subsection{Some macros for interaction}
 %
 % I like the \LaTeX\ star-boxes, although it's a pain having to cope with