From: Mark Wooding Date: Sun, 6 Sep 2020 12:25:50 +0000 (+0100) Subject: mdwtools.tex: Use `strayman' and `mdwfonts' if available. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mdwtools/commitdiff_plain/ba741fe9f0a2b38976db455d17e88ece8046ae0f mdwtools.tex: Use `strayman' and `mdwfonts' if available. --- diff --git a/mdwtools.tex b/mdwtools.tex index 7807d44..c8e8932 100644 --- a/mdwtools.tex +++ b/mdwtools.tex @@ -36,7 +36,7 @@ % % \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 @@ -225,13 +225,26 @@ % 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. @@ -242,7 +255,32 @@ \@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