diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-08-05 13:55:31 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-08-05 13:55:31 +0000 |
commit | bf687e7363bb107761d39bf2425633982bc38249 (patch) | |
tree | 29decc2637e1c73196a5ebc741eca80fc5652152 /Master/texmf-dist/source/latex/mh/mathtools.dtx | |
parent | a3f5e7ad4cf0d3909e8b2be53bc49bc33c6dee82 (diff) |
mh update (from tds.zip, rm old useless info in ctan2tds)
git-svn-id: svn://tug.org/texlive/trunk@10100 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/mh/mathtools.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/mh/mathtools.dtx | 198 |
1 files changed, 191 insertions, 7 deletions
diff --git a/Master/texmf-dist/source/latex/mh/mathtools.dtx b/Master/texmf-dist/source/latex/mh/mathtools.dtx index 585ec5d9b9c..3b43779df59 100644 --- a/Master/texmf-dist/source/latex/mh/mathtools.dtx +++ b/Master/texmf-dist/source/latex/mh/mathtools.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2004-2007 by Morten Hoegholm <mh.ctan@gmail.com> +% Copyright (C) 2004-2008 by Morten Hoegholm <mh.ctan@gmail.com> % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -66,7 +66,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: mathtools 2007/12/03 v1.03 (MH)} +\Msg{* Package: mathtools 2008/08/01 v1.06 (MH)} \Msg{************************************************************************} \keepsilent @@ -126,7 +126,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{mathtools.drv}% - [2007/12/03 v1.03 mathematical typesetting tools (MH)] + [2008/08/01 v1.06 mathematical typesetting tools (MH)] \documentclass{ltxdoc} \IfFileExists{fourier.sty}{\usepackage{fourier}}{} \addtolength\marginparwidth{-25pt} @@ -171,6 +171,17 @@ and the derived files }% } +\newcommand*\ProvidedBy[2]{% + \hskip1sp + \marginpar{% + \parbox[b]{\marginparwidth}{\small\sffamily\raggedright + \strut Feature provided by\\#1\\#2% + } + }% +} + + + \newcommand*\cttPosting[2]{% \hskip1sp \marginpar{% @@ -814,6 +825,15 @@ and the derived files % Note that this feature only works if you use \cs{eqref} or % \cs{refeq} to reference your equations. % +% When using \key{showonlyrefs} it might be usefull to be able to +% actually add a few equation numbers without having to actually +% refer to them. +% \begin{codesyntax} +% \SpecialUsageIndex{\noeqref}\cs{noeqref}\marg{label,label,\dots} +% \end{codesyntax} +% \FeatureRequest{Rasmus Villemoes}{2008/03/26} +% The syntax is somewhat similar to \cs{nocite}. +% % \subsection{Extensible symbols} % % The number of horizontally extensible symbols in standard \LaTeX{} @@ -1165,6 +1185,98 @@ and the derived files % \end{dcases*} % \] % +% +% \subsubsection{Emulating indented lines in alignments} +% \begin{codesyntax} +% \SpecialEnvIndex{\MoveEqLeft}\cs{MoveEqLeft}\oarg{number} +% \end{codesyntax} +% \ProvidedBy{Lars Madsen}{2008/06/05} +% In \cite{Swanson}, Ellen Swanson recommends that when ever one has +% a long displayed formula, spannig several lines, and it is +% unfeasible to align against a relation within the first line, then +% all lines in the display should be aligned at the left most edge of +% the first line, and all subsequent lines should be indented by 2em +% (or if needed by a smaller amount). That is we are talking about +% displayes that end up looking like this +% \begin{align*} +% \MoveEqLeft \framebox[10cm][c]{Long first line}\\ +% & = \framebox[6cm][c]{ \hphantom{g} 2nd line}\\ +% & \leq \dots +% \end{align*} +% Traditionally one could do this by starting subsequent lines by +% \verb+&\qquad ...+, but that is tedious. Instead the example above +% was made using \cs{MoveEqLeft}: +% \begin{verbatim} +% \begin{align*} +% \MoveEqLeft \framebox[10cm][c]{Long first line}\\ +% & = \framebox[6cm][c]{ \hphantom{g} 2nd line}\\ +% & \leq \dots +% \end{align*} +% \end{verbatim} +% \cs{MoveEqLeft} is placed instead of the \verb+&+ on the first +% line, and will effectively \emph{move} the entire first line +% \oarg{number} of ems to the left (default is 2). If you choose to +% align to the right of the relation, use \cs{MoveEqLeft}\verb+[3]+ +% to accommodate the extra distance to the alignment point: +% \begin{verbatim} +% \begin{align*} +% \MoveEqLeft[3] \framebox[10cm][c]{Part 1}\\ +% = {} & \framebox[8cm][c]{2nd line}\\ +% & + \framebox[4cm][c]{ last part} +% \end{align*} +% \end{verbatim} +% \begin{align*} +% \MoveEqLeft[3] \framebox[10cm][c]{Long first line}\\ +% = {} & \framebox[6cm][c]{ 2nd line}\\ +% & + \framebox[4cm][c]{ last part} +% \end{align*} +% +% \subsubsection{Adding arrows between lines in an alignment} +% +% \begin{codesyntax} +% \SpecialEnvIndex{\ArrowBetweenLines}\cs{ArrowBetweenLines}\oarg{symbol}\\ +% \SpecialEnvIndex{\ArrowBetweenLines*}\cs{ArrowBetweenLines*}\oarg{symbol} +% \end{codesyntax} +% \hskip1sp +% \marginpar{% +% \parbox[b]{\marginparwidth}{\small\sffamily\raggedright +% \strut Evolved from a request by\\Christian +% Bohr-Halling\\2004/03/31\\on dk.edb.tekst% +% } +% }% +% To add, say $\Updownarrow$ between two lines in an alignment use +% \cs{ArrowBetweenLines} and the \env{alignat} environment: +% \begin{verbatim} +% \begin{alignat*}{2} +% && \framebox[1.5cm]{} &= \framebox[3cm]{}\\ +% \ArrowBetweenLines % \Updownarrow is the default +% && \framebox[1.5cm]{} &= \framebox[2cm]{} +% \end{alignat*} +% \end{verbatim} +% resulting in +% \begin{alignat*}{2} +% && \framebox[1.5cm]{} &= \framebox[3cm]{}\\ +% \ArrowBetweenLines +% && \framebox[1.5cm]{} &= \framebox[2cm]{} +% \end{alignat*} +% Note the use of \verb+&&+ starting each \emph{regular} line of +% math. For adding the arrow on the right, use +% \cs{ArrowBetweenLines*}\oarg{symbol}, and end each line of math +% with \verb+&&+. +% \begin{verbatim} +% \begin{alignat*}{2} +% \framebox[1.5cm]{} &= \framebox[3cm]{} &&\\ +% \ArrowBetweenLines*[\Downarrow] +% \framebox[1.5cm]{} &= \framebox[2cm]{} && +% \end{alignat*} +% \end{verbatim} +% resulting in +% \begin{alignat*}{2} +% \framebox[1.5cm]{} &= \framebox[3cm]{} &&\\ +% \ArrowBetweenLines*[\Downarrow] +% \framebox[1.5cm]{} &= \framebox[2cm]{} && +% \end{alignat*} +% % \subsection{Short intertext} % % @@ -1743,11 +1855,16 @@ and the derived files % \emph{Math mode}, Version 1.71, % 2004/07/06. % (Available from CTAN as file \texttt{Voss-Mathmode.pdf}.) -% +% +% \bibitem{Swanson} +% Ellen Swanson, +% \emph{Mathematics into type}. +% American Mathematical Society, updated edition, 1999. +% Updated by Arlene O'Sean and Antoinette Schleyer. % \end{thebibliography} % % -% \StopEventually{} +% \StopEventually{} % % % \section{Options and package loading} @@ -1757,7 +1874,7 @@ and the derived files % \begin{macrocode} %<*package> \ProvidesPackage{mathtools}% - [2007/12/03 v1.03 mathematical typesetting tools (MH)] + [2008/08/01 v1.06 mathematical typesetting tools (MH)] % \end{macrocode} % \begin{macrocode} \RequirePackage{keyval,calc} @@ -2133,6 +2250,22 @@ and the derived files % \end{macrocode} % \end{macro} % +% \begin{macro}{\noeqref} +% \changes{v1.04}{2008/03/26}{Added \cs{noeqref} (daleif)} +% Macro for adding numbers to non-refered equations. Syntax similar +% to \cs{nocite}. +% \begin{macrocode} +\MHInternalSyntaxOff +\newcommand\noeqref[1]{\@bsphack + \@for\@tempa:=#1\do{% + \edef\@tempa{\expandafter\@firstofone\@tempa}% + \if@filesw\protected@write\@auxout{}% + {\string\MT@newlabel{\@tempa}}\fi} + \@esphack} +\MHInternalSyntaxOn +% \end{macrocode} +% \end{macro} +% % \subsection{Extensible arrows etc.} % % \begin{macro}{\xleftrightarrow} @@ -2746,6 +2879,7 @@ and the derived files % \subsection{Paired delimiters} % % \begin{macro}{\DeclarePairedDelimiter} +% \changes{v1.06}{2008/08/01}{Made user command robust} % This macro defines |#1| to be a control sequence that takes either % a star or an optional argument. % \begin{macrocode} @@ -2776,7 +2910,7 @@ and the derived files % The user command comes here. Just check for the star and choose % the right internal command. % \begin{macrocode} - \newcommand{#1}{ + \DeclareRobustCommand{#1}{ \@ifstar {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _star:}} {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar:}} @@ -3214,6 +3348,56 @@ and the derived files % \end{macrocode} % \end{macro} % +% \subsection{An aid to alignment} +% +% \begin{macro}{\MoveEqLeft} +% \changes{v1.05}{2008/06/05}{Added \cs{MoveEqLeft} (daleif)} +% \changes{v1.05b}{2008/06/18}{We don't need \cs{setlength} here +% (daleif), after discussion about \cs{global} and \cs{setlength} on +% ctt} +% This is a very simple macro, we `pull' a line in an alignment +% backwards in order to simulate that all subsequent lines have been +% indented. Note that simply using \verb+\kern-2m+ after the +% \verb+&+ is not enough, then the alignemnt environment never +% detects that there are anything in the cell before the \verb+&+. +% \begin{macrocode} +\newcommand\MoveEqLeft[1][2]{% + \global\@tempdima=#1em% + \kern\@tempdima% + & + \kern-\@tempdima} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ArrowBetweenLines} +% \changes{v1.05}{2008/06/05}{Added \cs{ArrowBetweenLines} as it +% belongs here and not just in my \LaTeX book (daleif)} +% ????Implementation notes are needed???? +% \begin{macrocode} +\MHInternalSyntaxOff +\def\ArrowBetweenLines{\relax + \iffalse{\fi\ifnum0=`}\fi + \@ifstar{\ArrowBetweenLines@auxI{00}}{\ArrowBetweenLines@auxI{01}}} +\def\ArrowBetweenLines@auxI#1{% + \@ifnextchar[% + {\ArrowBetweenLines@auxII{#1}}% + {\ArrowBetweenLines@auxII{#1}[\Updownarrow]}} +\def\ArrowBetweenLines@auxII#1[#2]{% + \ifnum0=`{\fi \iffalse}\fi + \crcr + \noalign{\nobreak\vskip-\baselineskip\vskip-\lineskip}% + \noalign{\expandafter\in@\expandafter{\@currenvir}% + {alignedat,aligned,gathered}% + \ifin@ \else\notag\fi% + }% + \if#1 &&\quad #2\else #2\quad\fi + \\\noalign{\nobreak\vskip-\lineskip}} +\MHInternalSyntaxOn +% \end{macrocode} +% \end{macro} +% +% +% % \section{Macros by other people} % % \subsection{Short intertext} |