From 281c40ee1ab217cc905c97390d8a62584965dd28 Mon Sep 17 00:00:00 2001 From: mdw Date: Fri, 5 Sep 2003 16:09:57 +0000 Subject: [PATCH] New feature\! --- centre.dtx | 117 ++++++++++++++++++ colour.dtx | 121 +++++++++++++++++++ mdwkey.dtx | 391 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ slowbox.dtx | 382 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1011 insertions(+) create mode 100644 centre.dtx create mode 100644 colour.dtx create mode 100644 mdwkey.dtx create mode 100644 slowbox.dtx diff --git a/centre.dtx b/centre.dtx new file mode 100644 index 0000000..3424cbf --- /dev/null +++ b/centre.dtx @@ -0,0 +1,117 @@ +% \begin{meta-comment} +% +% $Id: centre.dtx,v 1.1 2003/09/05 16:09:56 mdw Exp $ +% +% UK spellings of `centre' +% +% (c) 2003 Mark Wooding +% +%----- Revision history ----------------------------------------------------- +% +% $Log: centre.dtx,v $ +% Revision 1.1 2003/09/05 16:09:56 mdw +% New feature\! +% +% +% \end{meta-comment} +% +% \begin{meta-comment} +%% +%% centre package -- center, only spelt correctly +%% Copyright (c) 2003 Mark Wooding +%% +%% This program is free software; you can redistribute it and/or modify +%% it under the terms of the GNU General Public License as published by +%% the Free Software Foundation; either version 2 of the License, or +%% (at your option) any later version. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with this program; if not, write to the Free Software +%% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%% +% \end{meta-comment} +% +% \begin{meta-comment} +%<+package>\NeedsTeXFormat{LaTeX2e} +%<+package>\ProvidesPackage{centre} +%<+package> [2003/08/24 1.0 center, only spelt correctly] +% \end{meta-comment} +% +% \CheckSum{21} +%% \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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +% +% \begin{meta-comment} +% +%<*driver> +\input{mdwtools} +\describespackage{centre} +\mdwdoc +% +% +% \end{meta-comment} +% +%^^A------------------------------------------------------------------------- +% \section{User guide} +% +% \DescribeMacro\vcentre +% \DescribeEnv{centre} +% \DescribeMacro\centring +% \DescribeMacro\centreline +% \DescribeMacro\textasteriskcentred +% \DescribeMacro\textdotcentred +% More of my ranting about American spellings. A bunch of synonyms for those +% whose spelling of `centre' is French-influenced. +% +% +%^^A------------------------------------------------------------------------- +% \implementation +% \section{Implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% And add new definitions. +% +% \begin{macrocode} +\let\vcentre\vcenter +\let\centre\center +\let\endcentre\endcenter +\let\centring\centering +\let\centreline\centerline +\let\textasteriskcentred\textasteriskcentered +\let\textdotcentred\textperiodcentered +% \end{macrocode} +% +% That's all there is. Byebye. +% +% \begin{macrocode} +% +% \end{macrocode} +% \nopagebreak +% +% \hfill Mark Wooding, \today +% +% \Finale +% +\endinput diff --git a/colour.dtx b/colour.dtx new file mode 100644 index 0000000..685274b --- /dev/null +++ b/colour.dtx @@ -0,0 +1,121 @@ +% \begin{meta-comment} +% +% $Id: colour.dtx,v 1.1 2003/09/05 16:09:57 mdw Exp $ +% +% UK spellings of `colour' +% +% (c) 2003 Mark Wooding +% +%----- Revision history ----------------------------------------------------- +% +% $Log: colour.dtx,v $ +% Revision 1.1 2003/09/05 16:09:57 mdw +% New feature\! +% +% +% \end{meta-comment} +% +% \begin{meta-comment} +%% +%% colour package -- color, only spelt correctly +%% Copyright (c) 2003 Mark Wooding +%% +%% This program is free software; you can redistribute it and/or modify +%% it under the terms of the GNU General Public License as published by +%% the Free Software Foundation; either version 2 of the License, or +%% (at your option) any later version. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with this program; if not, write to the Free Software +%% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%% +% \end{meta-comment} +% +% \begin{meta-comment} +%<+package>\NeedsTeXFormat{LaTeX2e} +%<+package>\ProvidesPackage{colour} +%<+package> [2003/08/24 1.0 color, only spelt correctly] +% \end{meta-comment} +% +% \CheckSum{26} +%% \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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +% +% \begin{meta-comment} +% +%<*driver> +\input{mdwtools} +\describespackage{colour} +\mdwdoc +% +% +% \end{meta-comment} +% +%^^A------------------------------------------------------------------------- +% \section{User guide} +% +% This is the |\package{color}| package, with the addition of English +% spellings to the American misspellings. In particular, it provides +% commands |\colour|, |\definecolour|, |\textcolour|, |\pagecolour|, +% |\colourbox| and |\fcolourbox| commands. It also provides a \textsf{grey} +% colour model, which works the same as \textsf{gray}. +% +%^^A------------------------------------------------------------------------- +% \implementation +% \section{Implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% Import the \package{color} package. +% +% \begin{macrocode} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{color}} +\ProcessOptions +\RequirePackage{color} +% \end{macrocode} +% +% And add new definitions. +% +% \begin{macrocode} +\let\colour\color +\let\definecolour\definecolor +\let\textcolour\textcolor +\let\pagecolour\pagecolor +\let\colourbox\colorbox +\let\fcolourbox\fcolorbox +\let\color@grey\color@gray +% \end{macrocode} +% +% That's all there is. Byebye. +% +% \begin{macrocode} +% +% \end{macrocode} +% \nopagebreak +% +% \hfill Mark Wooding, \today +% +% \Finale +% +\endinput diff --git a/mdwkey.dtx b/mdwkey.dtx new file mode 100644 index 0000000..b00e6ec --- /dev/null +++ b/mdwkey.dtx @@ -0,0 +1,391 @@ +% \begin{meta-comment} +% +% $Id: mdwkey.dtx,v 1.1 2003/09/05 16:09:56 mdw Exp $ +% +% Parsing key/value pairs +% +% (c) 2003 Mark Wooding +% +%----- Revision history ----------------------------------------------------- +% +% $Log: mdwkey.dtx,v $ +% Revision 1.1 2003/09/05 16:09:56 mdw +% New feature\! +% +% +% \end{meta-comment} +% +% \begin{meta-comment} +%% +%% mdwkey package -- yet another key/value parser +%% Copyright (c) 2003 Mark Wooding +%<*package> +%% +%% This program is free software; you can redistribute it and/or modify +%% it under the terms of the GNU General Public License as published by +%% the Free Software Foundation; either version 2 of the License, or +%% (at your option) any later version. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with this program; if not, write to the Free Software +%% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +% +%% +% \end{meta-comment} +% +% \begin{meta-comment} +%<+package&!plain>\NeedsTeXFormat{LaTeX2e} +%<+package&!plain>\ProvidesPackage{mdwkey} +%<+package&!plain> [2003/08/21 1.0 key/value parser] +% \end{meta-comment} +% +% \CheckSum{316} +%\iffalse +%<*package> +%\fi +%% \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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%\iffalse +% +%\fi +% +% \begin{meta-comment} +% +%<*driver> +\input{mdwtools} +\describespackage{mdwkey} +\mdwdoc +% +% +% \end{meta-comment} +% +%^^A------------------------------------------------------------------------- +% \section{User's guide} +% +% This is a key/value-pair parser, rather like the one in David Carlisle's +% \package{keyval} package but a little more powerful. There's no problem +% with having both in the same program. +% +% \subsection{Terminology} +% +% A \emph{key-value pair} is a pair \syntax{ `=' }, where the +% \lit{=} appears at the topmost bracing level. A \emph{tag} is just a +% single \syntax{}. A \emph{list} is a sequence of key-value pairs and +% tags separated by commas \lit{,} at the topmost bracing level. A \ or +% \ has a leading and/or trailing space removed, if there are any, and +% if the whole thing is enclosed in braces, then the braces are removed. +% Examples: +% \begin{itemize} \synshorts +% \item "foo = bar" is a key-value pair. The key is `foo' and the value is +% `bar'. +% \item `{foo = bar}' is a tag. The key is `foo = bar'. +% \item `foo = { bar }' is a key-value pair. The key is `foo' and +% the value is ` bar ' (with the leading and trailing spaces). +% \item `foo = { bar }x' is a key-value pair. The key is `foo' and +% the value is `{ bar }x'. +% \item `one, two' is a list of two tags, `one' and `two'. +% \item `one, {two, three}' is a list of two tags, `one' and `two, three'. +% \end{itemize} +% There is no way to get an unmatched brace into a \ or \ without +% stupid catcode tricks. +% +% \subsection{Using the system} +% +% \DescribeMacro\mkdef +% New key names, and what to do when they're encountered, is all defined +% using |\mkdef|. Keys are gathered into \emph{groups}, so that lots of +% people can use the system without treading on their toes. I recommend that +% people use \syntax{":"