From a7dfc63af349a5ea5fb37b110f584cc878308ea7 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 16 Nov 2007 11:19:28 +0000 Subject: mlist v0.5 from ctan git-svn-id: svn://tug.org/texlive/trunk@5457 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/mlist/mlist.cfg | 69 +++++++++++++++++++ Master/texmf-dist/tex/latex/mlist/mlist.sty | 102 +++++++++------------------- 2 files changed, 102 insertions(+), 69 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/mlist/mlist.cfg (limited to 'Master/texmf-dist/tex/latex/mlist') diff --git a/Master/texmf-dist/tex/latex/mlist/mlist.cfg b/Master/texmf-dist/tex/latex/mlist/mlist.cfg new file mode 100644 index 00000000000..9d193412c7c --- /dev/null +++ b/Master/texmf-dist/tex/latex/mlist/mlist.cfg @@ -0,0 +1,69 @@ +%% +%% This is file `mlist.cfg', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% mlist.dtx (with options: `defaults') +%% +%% __________________________________ +%% Copyright (C) 2007 Will Robertson +%% +%% License information appended. +%% +\mlistsetup{% + sep={,}, + sepsep={;}, + wrapcmd=\mlistparen, + wrapone={}{}, + dots=\dots, + dot={\,\cdot\,}, + elemcmd=\mlistelem, + headcmd=\mathbf, + index={}, +} +\newmlist\vect[ + wrapcmd=\mlistparen, + wraponecmd=\mlistnowrap, + elemcmd=\mlistsub, + headcmd=\mathbf, +] +\newmlist\matr[ + sep=&, + sepsep=\\, + wrap={\begin{bmatrix}} + {\end{bmatrix}}, +] +\newmlist\func[ + headcmd=\mlisthead, + wrapcmd=\mlistheadparen, + wraponecmd, +] +\newmlist\mset[ + headcmd=\mathbb, + sep=\times, + wrapcmd=\mlistsup, + wraponecmd, +] +\newmset\setR{R} +\newmset\setC{C} +\newmset\setN{N} +\newmset\setZ{Z} +%% +%% Copyright (C) 2007 by Will Robertson +%% +%% Distributable under the LaTeX Project Public License, +%% version 1.3c or higher (your choice). The latest version of +%% this license is at: http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) +%% by Will Robertson. +%% +%% This work consists of the file mlist.dtx +%% and the derived files mlist.pdf, +%% mlist.sty, +%% mlist.cfg, and +%% mlist.ins. +%% +%% +%% End of file `mlist.cfg'. diff --git a/Master/texmf-dist/tex/latex/mlist/mlist.sty b/Master/texmf-dist/tex/latex/mlist/mlist.sty index cdb83d5cfb3..aa9d1b56aeb 100644 --- a/Master/texmf-dist/tex/latex/mlist/mlist.sty +++ b/Master/texmf-dist/tex/latex/mlist/mlist.sty @@ -5,15 +5,14 @@ %% The original source files were: %% %% mlist.dtx (with options: `package') -%% mlist.dtx (with options: `defaults') %% %% __________________________________ -%% Copyright (C) 2006 Will Robertson +%% Copyright (C) 2007 Will Robertson %% %% License information appended. %% \ProvidesPackage{mlist} - [2007/05/19 v0.4 Typesetting maths lists] + [2007/09/19 v0.5 Typesetting maths lists] \let\mlisthead\@firstofone \let\mlistelem\@secondoftwo \newcommand\mlistsub [2]{#1_{#2}} @@ -28,9 +27,9 @@ \newcommand\mlistheadbrace[2]{#1\left\{#2\right\}} \newcommand\mlistheadangle[2]{#1\left<#2\right>} \RequirePackage{xkeyval,ifmtarg} -\unless\ifdefined\if@tempswb\newif\if@tempswb\fi -\unless\ifdefined\if@tempswc\newif\if@tempswc\fi -\unless\ifdefined\@tempcntc\newcount\@tempcntc\fi +\newif\if@mlist@notfirst@ +\newif\if@mlist@implicit@ +\newcount\mlist@elem@N \def\@gobblenil#1\@nil{} \newif\if@mlist@warn \long\def\@sfor#1:=#2\do#3{% @@ -62,6 +61,7 @@ \expandafter\def\csname#1\endcsname} \providecommand\def@co[2]{% \def@c{#1\expandafter}\expandafter{#2}} +\newcommand\@optarg[1]{\@ifnextchar[{#1}{#1[]}}%] \newcommand\@ifnextbrace{\expandafter\@ifnextchar\bgroup} \def\mlist@colon{:} \def\mlist@period{.} @@ -85,7 +85,7 @@ \define@key[mlist]{sym}{elem}{% \@tempcnta\z@ \@tempcntb\z@ - \@tempcntc\z@ + \mlist@elem@N\z@ \@sfor\@jj:=#1\do{% \advance\@tempcnta\@ne \@tempcntb\z@ @@ -100,9 +100,9 @@ \expandafter\@tempa\expandafter{\@ii}% \else \advance\@tempcntb\@ne - \advance\@tempcntc\@ne + \advance\mlist@elem@N\@ne \def@co{mlist@\the\@tempcnta @\the\@tempcntb}{\@ii}% - \def@co{mlist@@\the\@tempcntc}{\@ii}% + \def@co{mlist@@\the\mlist@elem@N}{\@ii}% \fi \fi}% \if@tempswa\@tempswafalse\fi}} @@ -135,15 +135,15 @@ {\if@tempswa\mlist@add\mlist@sepsep\fi \@tempswatrue}% \@tempcntb\z@ - \@tempswbfalse + \@mlist@notfirst@false \@for\@ii:=\@jj\do{% \let\@ii\@ii \advance\@tempcntb\@ne \expandafter\@ifmtarg\expandafter{\@ii}% {\advance\@tempcntb\m@ne \mlist@add{\@gobble}} - {\if@tempswb\mlist@add\mlist@sep\fi - \@tempswbtrue + {\if@mlist@notfirst@\mlist@add\mlist@sep\fi + \@mlist@notfirst@true \ifx\@ii\mlist@colon \mlist@add{\mlist@dots\@gobble}% \else @@ -154,7 +154,7 @@ \fi \fi}% \mlist@parse@implicit - \if@tempswc + \if@mlist@implicit@ \mlist@add@ifcs{% mlist@\the\@tempcnta @\expandafter\@gobble\@ii }{\@ii}% @@ -165,7 +165,9 @@ \fi }% }% - \def\mlist@list{\mlist@wrap{\mlist@symbol}{\mlist@list@elems}}% + \def\mlist@list{% + \mlist@wrap{\mlist@headcmd{\mlist@symbol}} + {\mlist@list@elems}}% \ifnum\@tempcnta=\@ne \ifnum\@tempcntb=\@ne \let\mlist@wrap\mlist@wrapone @@ -190,31 +192,26 @@ \fi{\expandafter\mlist@add\expandafter{\expandafter{\csname#1\endcsname}}} {\expandafter\mlist@add\expandafter{\expandafter{#2}}}} \def\mlist@parse@implicit{% - \@tempswcfalse + \@mlist@implicit@false \def\@tempb{% \expandafter\@ifnextchar\mlist@ampersat - {\@tempswctrue\@gobblenil} - {\@tempswcfalse\@gobblenil}}% + {\@mlist@implicit@true\@gobblenil} + {\@mlist@implicit@false\@gobblenil}}% \expandafter\@tempb\@ii\@nil - \unless\if@tempswc + \unless\if@mlist@implicit@ \def\@tempb{% \@ifnextchar @ - {\@tempswctrue\@gobblenil} - {\@tempswcfalse\@gobblenil}}% + {\@mlist@implicit@true\@gobblenil} + {\@mlist@implicit@false\@gobblenil}}% \expandafter\@tempb\@ii\@nil \fi} \newcommand\newmlist[1]{% \@mlist@warntrue - \@ifnextchar[%] - {\@defmlist@opt{#1}} - {\@defmlist@noopt{#1}}} + \@optarg{\@defmlist@opt{#1}}} \newcommand\renewmlist[1]{% \@mlist@warnfalse - \@ifnextchar[%] - {\@defmlist@opt{#1}} - {\@defmlist@noopt{#1}}} + \@optarg{\@defmlist@opt{#1}}} \def\@defmlist@opt#1[#2]{\@defmlist{#1}{#2}} -\def\@defmlist@noopt#1{\@defmlist{#1}{}} \newcommand\@defmlist[2]{% \if@mlist@warn \ifdefined#1 @@ -225,27 +222,19 @@ \protected\def#1##1{% \@ifnextbrace {\csname\string#1@opt\endcsname{##1}} - {\csname\string#1@noopt\endcsname{##1}}}% + {\csname\string#1@opt\endcsname{##1}{}}}% \def@c{\string#1@opt}##1##2{% \csname\string#1\endcsname{##1}{##2}}% - \def@c{\string#1@noopt}##1{% - \csname\string#1\endcsname{##1}{}}% \def@c{\string#1}##1##2{% \@mlist{symbol=##1,#2,index={##2}}}% \def@c{new\expandafter\@gobble\string#1}##1##2{% \@mlist@warntrue - \@ifnextchar[%] - {\csname @new\string#1@opt\endcsname{##1}{##2}} - {\csname @new\string#1@noopt\endcsname{##1}{##2}}}% + \@optarg{\csname @new\string#1@opt\endcsname{##1}{##2}}}% \def@c{renew\expandafter\@gobble\string#1}##1##2{% \@mlist@warnfalse - \@ifnextchar[%] - {\csname @new\string#1@opt\endcsname{##1}{##2}} - {\csname @new\string#1@noopt\endcsname{##1}{##2}}}% + \@optarg{\csname @new\string#1@opt\endcsname{##1}{##2}}}% \def@c{@new\string#1@opt}##1##2[##3]{% \csname @new\string#1\endcsname{##1}{##2}{##3}}% - \def@c{@new\string#1@noopt}##1##2{% - \csname @new\string#1\endcsname{##1}{##2}{}}% \def@c{@new\string#1}##1##2##3{% \if@mlist@warn \ifdefined##1 @@ -260,36 +249,8 @@ \def@c{@new\string##1@opt}####1{% \@mlist{symbol=##2,#2,##3,index={####1}}}}% } -\mlistsetup{% - sep={,}, - sepsep={;}, - wrapcmd=\mlistparen, - wrapone={}{}, - dots=\dots, - dot={\,\cdot\,}, - elemcmd=\mlistelem, - headcmd=\mathbf, - index={}, -} -\newmlist\vect[ - wrapcmd=\mlistparen, - wraponecmd=\mlistnowrap, - elemcmd=\mlistsub, - headcmd=\mathbf, -] -\newmlist\matr[ - sep=&, - sepsep=\\, - elemcmd=\mlistelem, - wrap={\begin{bmatrix}} - {\end{bmatrix}}, -] -\newmlist\func[ - headcmd=\mlisthead, - elemcmd=\mlistelem, - wrapcmd=\mlistheadparen, - wraponecmd, -] +\InputIfFileExists{mlist.cfg}{} + {\PackageWarning{mlist}{No configuration file (mlist.cfg) found nor loaded}} %% %% Copyright (C) 2007 by Will Robertson %% @@ -301,7 +262,10 @@ %% by Will Robertson. %% %% This work consists of the file mlist.dtx -%% and the derived files mlist.sty and mlist.pdf. +%% and the derived files mlist.pdf, +%% mlist.sty, +%% mlist.cfg, and +%% mlist.ins. %% %% %% End of file `mlist.sty'. -- cgit v1.2.3