diff options
author | Karl Berry <karl@freefriends.org> | 2010-07-14 16:40:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-07-14 16:40:34 +0000 |
commit | 57e485197587d08aa2ca05ce2cc95e8063edd4cc (patch) | |
tree | b718954bc819b66d11005b7bcf266aae7ed63952 /Master/texmf-dist/source/latex/mh/mathtools.dtx | |
parent | ff69d312a2c79a3d20d1084c44d579da6770a0a7 (diff) |
mh update (13jul10)
git-svn-id: svn://tug.org/texlive/trunk@19447 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 | 434 |
1 files changed, 402 insertions, 32 deletions
diff --git a/Master/texmf-dist/source/latex/mh/mathtools.dtx b/Master/texmf-dist/source/latex/mh/mathtools.dtx index 3b43779df59..5af5ac8c1a0 100644 --- a/Master/texmf-dist/source/latex/mh/mathtools.dtx +++ b/Master/texmf-dist/source/latex/mh/mathtools.dtx @@ -66,7 +66,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: mathtools 2008/08/01 v1.06 (MH)} +\Msg{* Package: mathtools 20010/07/11 v1.08 (MH)} \Msg{************************************************************************} \keepsilent @@ -76,7 +76,7 @@ This is a generated file. -Copyright (C) 2002-2007 by Morten Hoegholm <mh.ctan@gmail.com> +Copyright (C) 2002-2010 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 @@ -126,7 +126,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{mathtools.drv}% - [2008/08/01 v1.06 mathematical typesetting tools (MH)] + [2010/07/11 v1.08 mathematical typesetting tools (MH)] \documentclass{ltxdoc} \IfFileExists{fourier.sty}{\usepackage{fourier}}{} \addtolength\marginparwidth{-25pt} @@ -139,7 +139,7 @@ and the derived files \providecommand*\email[1]{\href{mailto:#1}{\texttt{#1}}} \providecommand*\mode[1]{\texttt{[#1]}} \providecommand*\file[1]{\texttt{#1}} -\usepackage{xcolor,varioref} +\usepackage{xcolor,varioref,amssymb} \makeatletter \newcommand*\thinfbox[2][black]{\fboxsep0pt\textcolor{#1}{\rulebox{{\normalcolor#2}}}} \newcommand*\thinboxed[2][black]{\thinfbox[#1]{\ensuremath{\displaystyle#2}}} @@ -259,7 +259,7 @@ and the derived files % % \GetFileInfo{mathtools.drv} % -% \CheckSum{2004} +% \CheckSum{2311} % % \title{The \pkg{mathtools} package\thanks{This file has version number % \fileversion, last revised \filedate.}} @@ -826,14 +826,26 @@ and the derived files % \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. +% actually add a few equation numbers without directly refering 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}. % +% \medskip\noindent\textbf{BUG:} Currently there is a bug between +% \key{showonlyrefs} and the \pkg{ntheorem} package, then the +% \pkg{ntheorem} option \key{thmmarks} is active. The shown equation +% numbers may come out wrong (seems to be multiplied by 2). The +% easiest fix is to add the following line +% \begin{verbatim} +% \usepackage[overload,ntheorem]{empheq} +% \end{verbatim} +% before loading \pkg{ntheorem}. The \pkg{empheq} package fixes some +% problems with \pkg{ntheorem} and lets \pkg{mathtools} get correct +% access to the equation numbers again. +% % \subsection{Extensible symbols} % % The number of horizontally extensible symbols in standard \LaTeX{} @@ -989,6 +1001,7 @@ and the derived files % the original definitions of \cs{overbrace} and \cs{underbrace}. % % +% % % \subsection{New mathematical building blocks} % @@ -1137,7 +1150,22 @@ and the derived files % \cs{end}\arg{dcases}\\ % \SpecialEnvIndex{dcases*} % \cs{begin}\arg{dcases*} \meta{math_column} |&| \makebox[\widthof{\meta{math\_column}}][l]{\meta{text\_column}} -% \cs{end}\arg{dcases*} +% \cs{end}\arg{dcases*}\\ +% \SpecialEnvIndex{rcases} +% \cs{begin}\arg{rcases}\texttt{~~} \meta{math_column} |&| \makebox[\widthof{\meta{math\_column}}][l]{\meta{math\_column}} +% \cs{end}\arg{rcases}\\ +% \SpecialEnvIndex{rcases*} +% \cs{begin}\arg{rcases*}\texttt{~} \meta{math_column} |&| \makebox[\widthof{\meta{math\_column}}][l]{\meta{text\_column}} +% \cs{end}\arg{rcases*}\\ +% \SpecialEnvIndex{drcases} +% \cs{begin}\arg{drcases}\texttt{~} \meta{math_column} |&| \makebox[\widthof{\meta{math\_column}}][l]{\meta{math\_column}} +% \cs{end}\arg{drcases}\\ +% \SpecialEnvIndex{drcases*} +% \cs{begin}\arg{drcases*} \meta{math_column} |&| \makebox[\widthof{\meta{math\_column}}][l]{\meta{text\_column}} +% \cs{end}\arg{drcases*}\\ +% \SpecialEnvIndex{cases*} +% \cs{begin}\arg{cases*}\texttt{~} \meta{math_column} |&| \makebox[\widthof{\meta{math\_column}}][l]{\meta{text\_column}} +% \cs{end}\arg{cases*} % \end{codesyntax} % \FeatureRequest{Lars Madsen}{2004/07/01} % Anyone who have tried to use an integral in the regular @@ -1184,7 +1212,9 @@ and the derived files % \int x-3\, dx & Integral is display style % \end{dcases*} % \] -% +% The environments \env{rcases}, \env{rcases*}, \env{drcases} and +% \env{drcases*} are equivalent to \env{cases} and \env{dcases}, but +% here the brace is placed on the right instead of on the left. % % \subsubsection{Emulating indented lines in alignments} % \begin{codesyntax} @@ -1231,6 +1261,36 @@ and the derived files % & + \framebox[4cm][c]{ last part} % \end{align*} % +% \subsubsection{Boxing a single line in an alignment} +% +% The \texttt{amsmath} package provie the \cs{boxed} macro to box +% material in math mode. But this of course will not work if the box +% should cross an alignment point. We provide a macro that can. +% \hskip1sp +% \marginpar{% +% \parbox[b]{\marginparwidth}{\small\sffamily\raggedright +% \strut Evolved from a request by\\Merciadri Luca\\ +% 2010/06/28\\on comp.text.tex% +% } +% }% +% \begin{codesyntax} +% \SpecialEnvIndex{\Aboxed}\cs{Aboxed}\marg{left hand side +% \quad\texttt{\textnormal{\&}}\quad right hand side} +% \end{codesyntax} +% Example +% \begin{verbatim} +% \begin{align*} +% \Aboxed{ f(x) & = \int h(x)\, dx} \\ +% & = g(x) +% \end{align*} +% \end{verbatim} +% Resulting in: +% \begin{align*} +% \Aboxed{ f(x) & = \int h(x)\, dx} \\ +% & = g(x) +% \end{align*} +% +% % \subsubsection{Adding arrows between lines in an alignment} % % \begin{codesyntax} @@ -1375,7 +1435,43 @@ and the derived files % \] % \end{itemize} % -% +% \begin{codesyntax} +% \SpecialUsageIndex{\DeclarePairedDelimiterX} +% \cs{DeclarePairedDelimiterX}\marg{cmd}\oarg{num args}\marg{left_delim}\marg{right_delim}\texttt{\%}\\ +% \marg{normal replacement code}\marg{starred replacement code} +% \end{codesyntax} +% \ProvidedBy{Lars Madsen}{2010/06/15} +% Sometimes \cs{DeclarePairedDelimiter} just is not enough, +% especially if one wants to hide syntax inside the macro. For +% example one might want to implement an inner product taking two +% arguments such that the separator symbol can be hidden inside the +% macro itself (e.g.\ if a journal style require a semi-colon instead +% of a comma). Therefore we have the generalized +% \cs{DeclarePairedDelimiterX}. +% In this setting \verb|\DeclarePairedDelimiter\abs\lvert\rvert| is +% the same as +% \begin{verbatim} +% \DeclarePairedDelimiterX\abs[1]\lvert\rvert{#2}{#1} +% \end{verbatim} +% OK, this need some explanation: \oarg{num args} is required, and +% should be 1--8 arguments. The starred and non-starred replacement +% code is a bit special. The starred macro takes \meta{num args}, +% mandatory arguments, so \texttt{\#1}\dots refers to these +% arguments. But the non-starred version also have the optional +% argument which corresponds to \texttt{\#1}, so the mandatory +% arguments start at \texttt{\#2} and stops at \meta{num args} plus one. +% \begin{verbatim} +% \DeclarePairedDelimiterX\innerp[2]{\langle}{\rangle}{#2,#3}{#1,#2} +% \end{verbatim} +% Inside the starred replacement one can use \cs{middle} to scale and +% inner delimiter to the same height as the outer. In the non-starred, +% we get the optional argument in \texttt{\#1} so we can use that if +% needed. As an example let us define a bra-ket: +% \begin{verbatim} +% \DeclarePairedDelimiterX\braket[2]{\langle}{\rangle}% +% {#2\,#1\vert\,#3}{#1\,\middle\vert\,#2} +% \end{verbatim} +% % % \subsection{Special symbols} % @@ -1433,6 +1529,14 @@ and the derived files % In this case the command \cs{ordinarycolon} typesets an~\ldots\ % ordinary colon (what a surprise). % +% \medskip +% \noindent\textbf{Warning:} \texttt{centercolon} \emph{does not} +% work with languages that make use of an active colon, most notably +% French. Sadly the \texttt{babel} package does not distinguish +% between text and math when it comes to active characters. Nor does +% it provide any hooks to deal with math. So currently no general +% solution exists for this problem. +% % \begin{codesyntax} % \SpecialUsageIndex{\coloneqq}\cs{coloneqq}\texttt{~~~~~} % \SpecialUsageIndex{\Coloneqq}\cs{Coloneqq}\texttt{~~~~~} @@ -1467,6 +1571,45 @@ and the derived files % a \coloneqq b \quad c \Colonapprox d \quad e \dblcolon f % \] % +% +% +% \subsubsection{A few missing symbols} +% +% Most provided math font sets are missing the symbols \cs{nuparrow} +% and \cs{ndownarrow} (i.e.\ negated up- and downarrow) plus a `big' +% version of \cs{times}. Therefore we will provide constructed +% versions of these whenever they are not already available. +% \begin{codesyntax} +% \SpecialUsageIndex{\nuparrow}\cs{nuparrow}\\ +% \SpecialUsageIndex{\ndownarrow}\cs{ndownarrow}\\ +% \SpecialUsageIndex{\bigtimes}\cs{bigtimes} +% \end{codesyntax} +% +% \emph{Note:} that these symbols are constructed via +% features from the \pkg{graphicx} package, and thus may not display +% correctly in most DVI previewers. Also note that \cs{nuparrow} and +% \cs{ndownarrow} are constructed via \cs{nrightarrow} and +% \cs{nleftarrrow} respectively, so these needs to be +% present. Usually this is done via \pkg{amssymb}, but some packages +% may be incompatible with \pkg{amssymb} so the user will have to +% load \pkg{amssymb} or a similar package, that provides +% \cs{nrightarrow} and \cs{nleftarrow}, themselves. +% +% With those requirements in place, we have +% \begin{verbatim} +% \[ +% \lim_{a\ndownarrow 0} f(a) \neq \bigtimes_n X_n \qquad +% \frac{ \bigtimes_{k=1}^7 B_k \nuparrow \Omega }{2} +% \] +% \end{verbatim} +% \[ +% \lim_{a\ndownarrow 0} f(a) \neq \bigtimes_n X_n \qquad +% \frac{ \bigtimes_{k=1}^7 B_k \nuparrow \Omega }{2} +% \] +% +% +% +% % \section{A tribute to Michael J.~Downes} % % Michael J.~Downes (1958--2003) was one of the major architects @@ -1874,10 +2017,10 @@ and the derived files % \begin{macrocode} %<*package> \ProvidesPackage{mathtools}% - [2008/08/01 v1.06 mathematical typesetting tools (MH)] + [2010/07/11 v1.08 mathematical typesetting tools (MH)] % \end{macrocode} % \begin{macrocode} -\RequirePackage{keyval,calc} +\RequirePackage{keyval,calc,graphicx} \RequirePackage{mhsetup}[2007/12/03] \MHInternalSyntaxOn % \end{macrocode} @@ -2920,17 +3063,82 @@ and the derived files % \end{macrocode} % \end{macro} % +% \begin{macro}{\DeclarePairedDelimiterX} +% \changes{v1.08}{2010/06/10}{Added \cs{DeclarePairedDelimiterX}} +% It has turned out that it is convenient to have a more general +% version of \cs{DeclarePairedDelimiter}. In this version the user +% can specify the number of arguments the created macro has, and they +% can specify the code for the inner part of the macro. Other than +% that the code is fairly similar to \cs{DeclarePairedDelimiter} +% \begin{macrocode} +\def\MHempty{} +\def\DeclarePairedDelimiterX#1[#2]#3#4#5#6{% + \@ifdefinable{#1}{ +% \end{macrocode} +% The constructor takes six arguments, the name of the macro, the +% number of arguments (1-8), the left and right delimiter, the inner +% code for the `normal' macro, and the inner code for the starred +% macro. First we verify that the number of arguments fit. +% \begin{macrocode} + \ifnum#2>8\relax + \PackageError{mathtools}{No~ more~ than~ 8~ arguments}{} + \else + \ifnum#2<1\relax + \PackageError{mathtools}{Macro~ need~ 1~ or~ more~ arguments}{} + \fi + \fi +% \end{macrocode} +% We store the number of arguments in a temp counter. The starred +% macro has this exact number of arguments, whereas the un-starred +% also have the optional argument. +% \begin{macrocode} + % store the argument number in a temp counter + \@tempcnta=#2 + \@xp\@xp\@xp + \newcommand + \@xp\csname MT_delim_\MH_cs_to_str:N #1 _star:\endcsname + [\@tempcnta] + { + \left#3 #6 \right#4 + } + \advance\@tempcnta by 1 + \@xp\@xp\@xp + \newcommand + \@xp\csname MT_delim_\MH_cs_to_str:N #1 _nostar:\endcsname +% \end{macrocode} +% Here we do things a little differently than with +% \cs{DeclarePairedDelimiter}. The optional argument have \cs{MHempty} +% as the default. This is locally changed when we scale the +% delimiters, such that it can eat the l/r if needed. +% \begin{macrocode} + [\@tempcnta][\MHempty] + { + \mathopen{\let\MHempty\@gobble\@nameuse {\MH_cs_to_str:N ##1 l} #3} + #5 + \mathclose{\let\MHempty\@gobble\@nameuse {\MH_cs_to_str:N ##1 r} #4} + } + \DeclareRobustCommand{#1}{ + \@ifstar + {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _star:}} + {\@nameuse{MT_delim_\MH_cs_to_str:N #1 _nostar:}} + } + } +} +% \end{macrocode} +% \end{macro} +% % \subsection{A \texttt{\textbackslash displaystyle} \env{cases} environment} % % \begin{macro}{\MT_start_cases:nnn} % We define a single command that does all the hard work. +% \changes{v1.08}{2010/06/10}{made \cs{MT_start_cases:nnnn} more general} % \begin{macrocode} -\def\MT_start_cases:nnn #1#2#3{ % #1=sep,#2=preamble,#3=delim +\def\MT_start_cases:nnnn #1#2#3#4{ % #1=sep,#2=lpreamble,#3=rpreamble,#4=delim \RIfM@\else \nonmatherr@{\begin{\@currenvir}} \fi \MH_group_align_safe_begin: - \left#3 + \left#4 \vcenter \bgroup \Let@ \chardef\dspbrk@context\@ne \restore@math@cr \let \math@cr@@\AMS@math@cr@@ @@ -2942,8 +3150,8 @@ and the derived files % the separation between the columns. It could be a \cs{quad} or % something entirely different. % \begin{macrocode} - \strut@$\m@th \displaystyle{##}$\hfil \strut@ - #2 + \strut@#2 \strut@ + #3 \crcr } % \end{macrocode} @@ -2960,28 +3168,46 @@ and the derived files % \begin{macro}{\newcases} % \begin{macro}{\renewcases} % Easy creation of new \env{cases}-like environments. +% \changes{v1.08}{2010/06/10}{changed to match the change in \cs{MT_start_cases:nnnn}} % \begin{macrocode} -\newcommand*\newcases[5]{% #1=name, #2=sep, #3=preamble, #4=left, #5=right +\newcommand*\newcases[6]{% #1=name, #2=sep, #3=preamble, #4=left, #5=right \newenvironment{#1} - {\MT_start_cases:nnn {#2}{#3}{#4}} - {\MH_end_cases:\right#5} + {\MT_start_cases:nnnn {#2}{#3}{#4}{#5}} + {\MH_end_cases:\right#6} } -\newcommand*\renewcases[5]{ +\newcommand*\renewcases[6]{ \renewenvironment{#1} - {\MT_start_cases:nnn {#2}{#3}{#4}} - {\MH_end_cases:\right#5} + {\MT_start_cases:nnnn {#2}{#3}{#4}{#5}} + {\MH_end_cases:\right#6} } % \end{macrocode} % \begin{environment}{dcases} % \begin{environment}{dcases*} +% \begin{environment}{rcases} +% \begin{environment}{rcases*} +% \begin{environment}{drcases} +% \begin{environment}{drcases*} +% \begin{environment}{cases*} % \env{dcases} is a traditional cases with display style math in % both columns, while \env{dcases*} has text in the second column. +% \changes{v1.08}{2010/06/10}{changed to match the change in +% \cs{newcases} plus added rcases and drcases} % \begin{macrocode} -\newcases{dcases}{\quad}{$\m@th\displaystyle{##}$\hfil}{\lbrace}{.} -\newcases{dcases*}{\quad}{{##}\hfil}{\lbrace}{.} +\newcases{dcases}{\quad}{$\m@th\displaystyle{##}$\hfil}{$\m@th\displaystyle{##}$\hfil}{\lbrace}{.} +\newcases{dcases*}{\quad}{$\m@th\displaystyle{##}$\hfil}{{##}\hfil}{\lbrace}{.} +\newcases{rcases}{\quad}{$\m@th{##}$\hfil}{$\m@th{##}$\hfil}{.}{\rbrace} +\newcases{rcases*}{\quad}{$\m@th{##}$\hfil}{{##}\hfil}{.}{\rbrace} +\newcases{drcases}{\quad}{$\m@th\displaystyle{##}$\hfil}{$\m@th\displaystyle{##}$\hfil}{.}{\rbrace} +\newcases{drcases*}{\quad}{$\m@th\displaystyle{##}$\hfil}{{##}\hfil}{.}{\rbrace} +\newcases{cases*}{\quad}{$\m@th{##}$\hfil}{{##}\hfil}{\lbrace}{.} % \end{macrocode} % \end{environment} % \end{environment} +% \end{environment} +% \end{environment} +% \end{environment} +% \end{environment} +% \end{environment} % \end{macro} % \end{macro} % @@ -3353,13 +3579,13 @@ and the derived files % \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+&+. +% (daleif), after discussion about \cs{global} and \cs{setlength} +% on ctt} This is a very simple macro, we `move' 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 is anything (though simulated) in the cell +% before the \verb+&+. % \begin{macrocode} \newcommand\MoveEqLeft[1][2]{% \global\@tempdima=#1em% @@ -3369,6 +3595,34 @@ and the derived files % \end{macrocode} % \end{macro} % +% \begin{macro}{\Aboxed} +% \changes{v1.08}{2010/06/29}{Added \cs{Aboxed}} +% The idea from \cs{MoveEqLeft} can be used for other things. Here we +% create a macro that will allow a user to box a single line in an +% alignment. +% \begin{macrocode} +\newcommand\Aboxed[1]{\@Aboxed#1\ENDDNE} +% \end{macrocode} +% Idea: get the left and right part +% typeset them in a \cs{boxed} AFTER an \& and pull it backwards +% but in order to get the horizontal placement to work. As with +% \cs{MoveEqLeft} we need to set some appropriate space to the left +% of the \& +% \begin{macrocode} +\def\@Aboxed#1\ENDDNE{% + \settowidth\@tempdima{$\displaystyle#1{}$}% + \addtolength\@tempdima{\fboxsep}% + \addtolength\@tempdima{\fboxrule}% + \global\@tempdima=\@tempdima + \kern\@tempdima + & + \kern-\@tempdima + \boxed{#1#2} +} +% \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)} @@ -3384,7 +3638,19 @@ and the derived files {\ArrowBetweenLines@auxII{#1}[\Updownarrow]}} \def\ArrowBetweenLines@auxII#1[#2]{% \ifnum0=`{\fi \iffalse}\fi - \crcr +% \end{macrocode} +% It turns out that for some reason the \cs{crcr} (next) removes the +% automatic equation number replacement. The replacement hack seems to +% the trick, though I have no idea why \cs{crcr} broke things (/daleif). +% \changes{v1.08}{2010/06/15}{fixed eq num replacement bug} +% \begin{macrocode} +% \crcr + \expandafter\in@\expandafter{\@currenvir}% + {alignedat,aligned,gathered}% + \ifin@ \else + \notag + \fi% + \\ \noalign{\nobreak\vskip-\baselineskip\vskip-\lineskip}% \noalign{\expandafter\in@\expandafter{\@currenvir}% {alignedat,aligned,gathered}% @@ -3396,7 +3662,111 @@ and the derived files % \end{macrocode} % \end{macro} % +% \section{A few extra symbols} +% +% Most math font sets are missing three symbols: \cs{nuparrow}, +% \cs{ndownarrow} and \cs{bigtimes}. We provide \emph{simulated} +% versions of these symbols in case they are missing. +% +% \subsection{Negated up- and down arrows} +% +% Note that the \cs{nuparrow} and the \cs{ndownarrow} are made from +% \cs{nrightarrow} and \cs{nleftarrow}, so these have to be +% present. If they are not, we throw an error at use. The +% implementation details are due to Enrico Gregorio +% (\url{http://groups.google.com/group/comp.text.tex/msg/689cc8bd604fdb51}), +% the basic idea is to reflect and rotate existing negated +% arrows. Note that the reflection and rotation will not show up i +% most DVI previewers. +% \begin{macro}{\MH_nrotarrow:NN} +% \changes{v1.07}{2008/08/11}{Added support for \cs{nuparrow} and \cs{ndownaddow}} +% First a common construction macro. +% \begin{macrocode} +\def\MH_nrotarrow:NN #1#2{% + \setbox0=\hbox{$\m@th#1\uparrow$}\dimen0=\dp0 + \setbox0=\hbox{% + \reflectbox{\rotatebox[origin=c]{90}{$\m@th#1\mkern2.22mu #2$}}}% + \dp0=\dimen0 \box0 \mkern2.3965mu +} +% \end{macrocode} +% \end{macro} +% The negated arrows are then made using this macro on respectively +% \cs{nrightarrow} and \cs{nleftarrow} +% \begin{macro}{\MH_nuparrow:} +% \begin{macro}{\MH_ndownarrow:} +% \begin{macrocode} +\def\MH_nuparrow: {% + \mathrel{\mathpalette\MH_nrotarrow:NN\nrightarrow} } +\def\MH_ndownarrow: {% + \mathrel{\mathpalette\MH_nrotarrow:NN\nleftarrow} } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\nuparrow} +% \begin{macro}{\ndownarrow} +% Next we provide \cs{nuparrow} and \cs{ndownarrow} at begin +% document. Since they depend on \cs{nrightarrow} and +% \cs{nleftarrow} we test for these and let the macros throw an +% error if they are missing. +% \begin{macrocode} +\AtBeginDocument{% + \@ifundefined{nrightarrow}{% + \providecommand\nuparrow{% + \PackageError{mathtools}{\string\nuparrow\space~ is~ + constructed~ from~ \string\nrightarrow,~ which~ is~ not~ + provided.~ Please~ load~ the~ amssymb~ package~ or~ similar}{} + }}{ \providecommand\nuparrow{\MH_nuparrow:}} + \@ifundefined{nleftarrow}{% + \providecommand\ndownarrow{% + \PackageError{mathtools}{\string\ndownarrow\space~ is~ + constructed~ from~ \string\nleftarrow,~ which~ is~ not~ + provided.~ Please~ load~ the~ amssymb~ package~ or~ similar}{} + }}{ \providecommand\ndownarrow{\MH_ndownarrow:}} } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \subsection{Providing bigtimes} +% +% The idea is to use the original \cs{times} and then scale it +% accordingly. Again the implementation details have been improved by +% Enrico Gregorio +% (\url{http://groups.google.com/group/comp.text.tex/msg/9685c9405df2ff94}). % +% \begin{macro}{\MH_bigtimes_scaler:N} +% \begin{macro}{\MH_bigtimes_inner:} +% \begin{macro}{\MH_csym_bigtimes:} +% \changes{v1.07}{2008/08/11}{Added support for \cs{bigtimes}} +% \begin{macrocode} +\def\MH_bigtimes_scaler:N #1{% + \vcenter{\hbox{#1$\m@th\mkern-2mu\times\mkern-2mu$}}} +% \end{macrocode} +% This is then combined with \cs{mathchoice} to form the inner parts +% of the macro +% \begin{macrocode} +\def\MH_bigtimes_inner: { + \mathchoice{\MH_bigtimes_scaler:N \huge} % display style + {\MH_bigtimes_scaler:N \LARGE} % text style + {\MH_bigtimes_scaler:N {}} % script style + {\MH_bigtimes_scaler:N \footnotesize} % script script style +} +% \end{macrocode} +% And thus the internal prepresentaion of the \cs{bigtimes} macro. +% \begin{macrocode} +\def\MH_csym_bigtimes: {\mathop{\MH_bigtimes_inner:}\displaylimits} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\bigtimes} +% In the end we provide \cs{bigtimes} if otherwise not defined. +% \begin{macrocode} +\AtBeginDocument{ + \providecommand\bigtimes{\MH_csym_bigtimes:} +} +% \end{macrocode} +% \end{macro} % % \section{Macros by other people} % |