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/empheq07.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/empheq07.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/mh/empheq07.dtx | 1506 |
1 files changed, 0 insertions, 1506 deletions
diff --git a/Master/texmf-dist/source/latex/mh/empheq07.dtx b/Master/texmf-dist/source/latex/mh/empheq07.dtx deleted file mode 100644 index a8921940f1a..00000000000 --- a/Master/texmf-dist/source/latex/mh/empheq07.dtx +++ /dev/null @@ -1,1506 +0,0 @@ -% \iffalse meta-comment -% -% Copyright (C) 2002-2007 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 -% version 1.3 of this license or (at your option) any later -% version. The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of -% LaTeX version 2005/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% This Current Maintainer of this work is Morten Hoegholm. -% -% This work consists of the main source file empheq07.dtx -% and the derived files -% empheq07.sty, empheq07.pdf, empheq07.ins, empheq07.drv. -% -% Distribution: -% CTAN:macros/latex/contrib/mh/empheq07.dtx -% CTAN:macros/latex/contrib/mh/empheq07.pdf -% -% Unpacking: -% (a) If empheq07.ins is present: -% tex empheq07.ins -% (b) Without empheq07.ins: -% tex empheq07.dtx -% (c) If you insist on using LaTeX -% latex \let\install=y\input{empheq07.dtx} -% (quote the arguments according to the demands of your shell) -% -% Documentation: -% (a) If empheq07.drv is present: -% latex empheq07.drv -% (b) Without empheq07.drv: -% latex empheq07.dtx; ... -% The class ltxdoc loads the configuration file ltxdoc.cfg -% if available. Here you can specify further options, e.g. -% use A4 as paper format: -% \PassOptionsToClass{a4paper}{article} -% -% Programm calls to get the documentation (example): -% pdflatex empheq07.dtx -% makeindex -s gind.ist empheq07.idx -% pdflatex empheq07.dtx -% makeindex -s gind.ist empheq07.idx -% pdflatex empheq07.dtx -% -% Installation: -% TDS:tex/latex/mh/empheq07.sty -% TDS:doc/latex/mh/empheq07.pdf -% TDS:source/latex/mh/empheq07.dtx -% -%<*ignore> -\begingroup - \def\x{LaTeX2e} -\expandafter\endgroup -\ifcase 0\ifx\install y1\fi\expandafter - \ifx\csname processbatchFile\endcsname\relax\else1\fi - \ifx\fmtname\x\else 1\fi\relax -\else\csname fi\endcsname -%</ignore> -%<*install> -\input docstrip.tex -\Msg{************************************************************************} -\Msg{* Installation} -\Msg{* Package: empheq07 2007/12/03 v0.7e empheq07 (MH)} -\Msg{************************************************************************} - -\keepsilent -\askforoverwritefalse - -\preamble - -This is a generated file. - -Copyright (C) 2002-2007 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 -version 1.3 of this license or (at your option) any later -version. The latest version of this license is in - http://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of -LaTeX version 2005/12/01 or later. - -This work has the LPPL maintenance status "maintained". - -This Current Maintainer of this work is Morten Hoegholm. - -This work consists of the main source file empheq07.dtx -and the derived files - empheq07.sty, empheq07.pdf, empheq07.ins, empheq07.drv. - -\endpreamble - -\generate{% - \file{empheq07.ins}{\from{empheq07.dtx}{install}}% - \file{empheq07.drv}{\from{empheq07.dtx}{driver}}% - \usedir{tex/latex/mh}% - \file{empheq07.sty}{\from{empheq07.dtx}{package}}% -} - -\obeyspaces -\Msg{************************************************************************} -\Msg{*} -\Msg{* To finish the installation you have to move the following} -\Msg{* file into a directory searched by TeX:} -\Msg{*} -\Msg{* empheq07.sty} -\Msg{*} -\Msg{* To produce the documentation run the file `empheq07.drv'} -\Msg{* through LaTeX.} -\Msg{*} -\Msg{* Happy TeXing!} -\Msg{*} -\Msg{************************************************************************} - -\endbatchfile -%</install> -%<*ignore> -\fi -%</ignore> -%<*driver> -\NeedsTeXFormat{LaTeX2e} -\ProvidesFile{empheq07.drv}% - [2007/12/03 v0.7e Emphasizing equations (MH)] -\documentclass{ltxdoc} -\usepackage{empheq07} -\usepackage{color,fancybox,ifpdf} -\ifpdf\else - \usepackage{pstricks} -\fi -\definecolor{lightblue}{rgb}{.8, .8, 1} -\OnlyDescription -\begin{document} -\DocInput{empheq07.dtx} -\end{document} -%</driver> -% \fi -% \DeclareRobustCommand{\mode}[1]{\texttt{#1}} -% \DeclareRobustCommand{\env}[1]{\textsf{#1}} -% \DeclareRobustCommand{\pkg}[1]{\texttt{#1}} -% \DeclareRobustCommand{\EQ}{\pkg{empheq07}} -% -% \changes{v0.7d}{2004/07/27}{Changed name to \pkg{empheq07} by request -% of Robin Fairbairns} -% -% \changes{v0.7c}{2004/04/01}{Separated \pkg{empheq} and -% \pkg{empheq-obsolete}} -% -% \changes{v0.7b}{2004/03/13}{Upgraded license to LPPL version 1.3. -% The package is still obsolete} -% -% \changes{v0.7a}{2004/02/15}{This package is now obsolete and has -% changed its name to \pkg{empheq-obsolete}} -% -% \changes{v0.6a}{2003/01/28}{Minor updates to documentation.} -% -% \changes{v0.5}{2002/12/30}{First experimental and very limited release} -% \newif\ifBonusExample -% \ifpdf\else -% \BonusExampletrue -% \fi -% \GetFileInfo{empheq07.drv} -% \CheckSum{1273} -% \title{The \EQ\ package\thanks{This file -% has version number \fileversion, last -% revised \filedate.}\\Emphasizing equations in \LaTeXe -% \thanks{Thanks to Lars Madsen for asking for the subtle feature -% that evolved into this package.}} -% \author{Morten H\o gholm} -% \date{\filedate} -% -% \maketitle -% -% -% \begin{abstract} -% \noindent The \EQ\ package automatically detects several \pkg{amsmath} -% environments and the size of the displayed math material. The user -% interface makes it easy to add various kinds of visual markup to -% these equations. -% \end{abstract} -% \tableofcontents -% \section{Important Notice} -% -% This package (\EQ\ \fileversion) is no longer supported. See the -% documentation of \pkg{empheq} for more details. -% -% -% \section{Introduction} -% Users who have wanted to put a system of equations inside boxes has -% hitherto been forced to use the features of \pkg{fancybox} or the \cmd{\boxed} command -% of \pkg{amsmath}. Both alternatives have serious limitations though. -% \pkg{fancybox} allows only \env{eqnarray}-style equations and at -% the end of the day they aren't all that pretty. Most mathematical -% typesetting in \LaTeX\ is done with the aid of \pkg{amsmath} -% anyway, but it only offers the single line quick-fix \cmd{\boxed}. -% What we really want is something that will enable us to do -% something along the likes of this: -% \begin{subequations}\label{eq:1} -% \begin{empheq}[boxtype=\fbox,Left= {\tilde{S}=1 \Rightarrow\empheqlbrace}] -% \begin{align} -% a&=\int_{-2}^3{t}b^t \, dt \quad\text{and} \label{eq:1a}\\ -% c&=d-a \label{eq:1b} -% \end{align} -% \end{empheq} -% \end{subequations} -% As you can see, \EQ\ can do all the tricks the \pkg{cases} package -% by Donald Arseneau can do and more. It even supports -% \env{subequations}---as shown in equations \eqref{eq:1a} and -% \eqref{eq:1b}---from \pkg{amsmath} without complaining. -% -% In order to combine the best of two worlds the \EQ\ package -% tries to take advantage of the widespread features of \pkg{amsmath}. -% As it should be well known if you read this, \pkg{amsmath} has -% amongst its arsenal of structures \env{align}, \env{gather}, \env{alignat} and \env{multline}. -% \EQ\ works with these as well as their starred -% variants. -% -% ``But what about \env{equation}?'' you say. \env{equation} is (in -% my opinion) merely a poor man's \env{gather}. If you really want -% to use \EQ's features on a one-liner (no pun intended) go with -% \env{gather}. Anyway the real goal of this package is to do nifty -% tricks with multi line equations \ldots -% -% -% \section{Examples} -% \changes{v0.7}{2003/05/11}{Added further examples and changed existing ones} -% Any options given to \EQ\ is passed on to \pkg{amsmath}, thus the -% line\par -% \cmd{\usepackage}\oarg{options}|{empheq07}|\\ -% will load \pkg{amsmath} with exactly those options. \EQ\ doesn't -% redefine anything so to use it in an existing document you need -% only replace \pkg{amsmath} with \EQ---no harm done. -% -% -% \EQ\ is \emph{really} easy to use; you simply put an \env{empheq} -% environment around your \pkg{amsmath} environment: -% \begin{verbatim} -% \begin{empheq} -% \begin{align} -% E&=mc^2 \\ -% Y&= \sum_{n=1}^\infty \frac{1}{n^2} -% \end{align} -% \end{empheq} -% \end{verbatim} -% \begin{empheq} -% \begin{align} -% E&=mc^2 \\ -% Y&= \sum_{n=1}^\infty \frac{1}{n^2} -% \end{align} -% \end{empheq} -% Impressed? No? Well then I guess it's about time I told you about -% the \emph{optional} argument of the \env{empheq} environment. It allows -% you control what material to put on either side of the math and -% the sort of box to go around it all. That means that we can say -% \begin{verbatim} -% \begin{empheq}[boxtype=\fbox] -% \begin{align} -% E&=mc^2 \\ -% Y&= \sum_{n=1}^\infty \frac{1}{n^2} -% \end{align} -% \end{empheq} -% \end{verbatim} -% to obtain the display -% \begin{empheq}[boxtype=\fbox] -% \begin{align} -% E&=mc^2 \\ -% Y&= \sum_{n=1}^\infty \frac{1}{n^2} -% \end{align} -% \end{empheq} -% This requires the use of the \pkg{keyval} package from the tools -% bundle, which is undoubtedly installed on your system. When using -% the \pkg{keyval} package there are a few things we need to keep in -% mind. In mathematical typesetting `|=|' and `|,|' are quite -% frequently used, thus requiring the user to enclose them in -% braces: -% \begin{verbatim} -% \begin{empheq}[boxtype=\fbox, -% Left={(a,b)=(c,i) \Rightarrow\empheqlbrace}] -% \begin{alignat}{2} -% (a,b)&= (\cos^a c, \tan^b i)&& \quad\text{for $i>1$}\\ -% (a,b)&= (\arccos x^a, \arctan i^b)&& \quad\text{for $i\leq1$} -% \end{alignat} -% \end{empheq} -% \end{verbatim} -% \begin{empheq}[boxtype=\fbox, -% Left={(a,b)=(c,i) \Rightarrow\empheqlbrace}] -% \begin{alignat}{2} -% (a,b)&= (\cos^a c, \tan^b i)&& \quad\text{for $i>1$}\\ -% (a,b)&= (\arccos c^a, \arctan i^b)&& \quad\text{for $i\leq1$} -% \end{alignat} -% \end{empheq} -% The same with \env{cases} from \pkg{amsmath} for comparison: -% \[ -% \boxed{(a,b)=(c,i) \Rightarrow -% \begin{cases} (a,b)= (\cos^a c, \tan^b i)& \text{for $i>1$}\\ -% (a,b)= (\arccos x^a, \arctan i^b)& \text{for $i\leq1$} -% \end{cases}} -% \] -% Notice that \env{cases} uses an array for the conditions, so you -% have to force \cmd{\displaystyle} yourself. This is not needed with -% \EQ\ as you're already using a \cmd{\displaystyle} environment such as -% \env{gather} etc. -% -% \changes{v0.6b}{2003/03/04}{Added example for changing margins inside the boxtype.} -% Observe what can be done if we replace -% |\fbox| with another framed box and add some space on all sides: -% \begin{verbatim} -% \definecolor{lightblue}{rgb}{.8, .8, 1} -% \begin{empheq}[boxtype={\setlength{\fboxsep}{10pt}% -% \colorbox{lightblue}}, -% Right={\empheqrbrace \beta}] -% . -% . -% . -% \end{empheq} -% \end{verbatim} -% \begin{empheq}[boxtype={\setlength{\fboxsep}{10pt}% -% \colorbox{lightblue}},Right={\empheqrbrace \beta}] -% \begin{align} -% a&=\int_{-2}^3{t}b^t \, dt \quad\text{and}\\ -% c&=d-a -% \end{align} -% \end{empheq} -% -% As a convenience for the user, it is also possible to declare -% delimiters with the commands -% \cmd{\DeclareRightDelimiter}\marg{delimiter} and its companion -% \cmd{\DeclareLeftDelimiter}\marg{delimiter}. For instance the commands -% \begin{quote} -% |\DeclareRightDelimiter{\rangle}| defines \cmd{\empheqrangle} -% \end{quote} -% and -% \begin{quote} -% |\DeclareLeftDelimiter{\langle}| defines \cmd{\empheqlangle}. -% \end{quote} -% The usage is simple. \DeclareRightDelimiter{\rangle} \DeclareLeftDelimiter{\langle} -% \begin{verbatim} -% \begin{empheq}[Right=\empheqrangle, -% Left=\empheqlangle] -% \begin{gather} -% a=b \\ -% c=d -% \end{gather} -% \end{empheq} -% \end{verbatim} -% \begin{empheq}[Right=\empheqrangle,Left=\empheqlangle] -% \begin{gather} -% a=b \\ -% c=d -% \end{gather} -% \end{empheq} -% \cmd{\DeclareRightDelimiter} and its companion have an optional -% argument which controls spacing (default is a negative thinspace), -% but beware: It will simply overwrite the original definition and -% it might not look all that pretty as the following example shows: -% \DeclareRightDelimiter[\>]{\rangle} -% \DeclareLeftDelimiter[\mkern-10mu]{\langle} -% \begin{verbatim} -% \DeclareRightDelimiter[\>]{\rangle} -% \DeclareLeftDelimiter[\mkern-10mu]{\langle} -% \end{verbatim} -% \begin{empheq}[Right=\empheqrangle,Left=\empheqlangle] -% \begin{gather} -% a=b \\ -% c=d -% \end{gather} -% \end{empheq} -% -% These examples will have given you a glimpse of the possibilities -% \EQ\ offers. In particular the commands \cmd{\empheqlbrace} and -% \cmd{\empheqrbrace} produce braces just tall enough to encompass -% the display. You can of course use \cmd{\big...} delimiters if you -% want. -% -% \ifBonusExample -% If you want you can even create your own box and use it with -% \env{empheq}. In the following silly example I have created -% \cmd{\ErrorBox} with \pkg{PSTricks} to achieve a disturbing -% effect: -% \makeatletter -% \newcommand{\ErrorBox}[1]{% -% \setlength{\@tempdima}{\heightof{#1}}% -% \addtolength{\@tempdima}{\depthof{#1}}% -% \setlength{\@tempdimb}{\widthof{#1}}% -% \psset{yunit=\@tempdima}% -% \psset{xunit=\@tempdimb}% -% \psframebox[fillstyle=vlines,linestyle=none,hatchsep=.2\@tempdimb,hatchcolor=red,hatchangle=-60]{% -% \rlap{\kern.5\@tempdimb\makebox[0pt]{{\Large\color{gray} \textbf{Error!}}}}#1}% -% } -% \makeatother -% \begin{empheq}[boxtype=\ErrorBox] -% \begin{align*} -% E&=mc^3 \\ -% F&=G\frac{m+M}{r^2} -% \end{align*} -% \end{empheq} -% Remember one thing when creating your own box: Make it -% symmetrical. -% \fi -% -% \section{Bugs and shortcomings} -% This package (\EQ) is not supported anymore. Try with the new -% version and see if it works; if not, then contact me. See how in -% the manual of \pkg{empheq}. -% -% \StopEventually{} -% \section{Implementation} -% \subsection{Strategy} -% -% Whenever \pkg{amsmath} is typesetting a display environment it -% actually does it twice; the first for the ``measuring'' phase and -% the second for the ``production'' phase. The \EQ\ package uses a -% similar approach: -% \begin{itemize} -% \item Collects the input in a token register for later use. -% \item Typesets the input in the background and checks certain values to determine the kind of math structure you just typed. -% \item Based on the given information, alterations are made to various lengths. -% \item Then the equations are typeset again and stored in a box -% for easy retrieval. -% \item Finally the saved box is put into a box of the user's liking. -% Any material to the right or left of the math structure (added with -% the |Left| and |Right| keys) are put into the box as well. -% \end{itemize} -% Assuming we have found out which \pkg{amsmath} structure the -% user typed, there are still a few things we need to sort out -% before we proceed. -% -% First of all the equation number should still be aligned with -% those of the ordinary math structures, which is a problem as soon -% as the additions we make to the left and the right -% differ---presumably they will. And when we are in \mode{fleqn} -% mode, we should make sure that the structure is shifted just -% enough to the right so that all equations still are right -% adjusted. Therefore we need to make clever changes to the -% line width to make sure the margins come out right. -% -% Then assuming we have overcome all of this there's still the final -% step: Placing the math structure in the appropriate box at the -% appropriate position. Once again we need to do some manipulation -% with spacing to make it just right. -% -% \subsection{Preliminary actions} -% -% To avoid clashes with other packages, all private commands will contain the sequence \verb|@emphEQ@|. -% -% We will need \pkg{amsmath} of course and it would be nice if \EQ\ -% would recognize all the \pkg{amsmath} options so we make that -% happen. To make sure the user has an updated system the newest -% release of \pkg{amsmath} is required. -% -% \pkg{calc} is used to increase readability of the code -% (thus making it \emph{far} easier to write too) and \pkg{keyval} -% is used for user friendliness. They should all be part of any -% \LaTeX\ system. -% \begin{macrocode} -%<*package> -\ProvidesPackage{empheq07}% - [2007/12/03 v0.7e Emphasizing equations (MH)] -\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{amsmath}} -\ProcessOptions\relax -\RequirePackage{amsmath}[2000/07/18] -\RequirePackage{calc,keyval} -% \end{macrocode} -% \begin{macro}{\if@emphEQ@FLL}\begin{macro}{\if@emphEQ@FLR}\begin{macro}{\if@emphEQ@L}\begin{macro}{\if@emphEQ@R} -% There are four available layouts for mathematical displays: -% |[fleqn,leqno]| (FLL), |[fleqn,reqno]| (FLR), |[leqno]| (L) and |[reqno]| (R). We create four \TeX\ conditionals -% to make the algorithm easier to read as well as to speed up things a bit. -% \begin{macrocode} -\newif\if@emphEQ@FLL -\newif\if@emphEQ@FLR -\newif\if@emphEQ@L -\newif\if@emphEQ@R -% \end{macrocode} -%\end{macro}\end{macro}\end{macro}\end{macro} -% We then perform a simple test to determine the current mode. -% \begin{macrocode} -\if@fleqn - \iftagsleft@ - \@emphEQ@FLLtrue - \else - \@emphEQ@FLRtrue - \fi -\else - \iftagsleft@ - \@emphEQ@Ltrue - \else - \@emphEQ@Rtrue - \fi -\fi -% \end{macrocode} -% \begin{macro}{\if@emphEQ@gather}\begin{macro}{\if@emphEQ@align}\begin{macro}{\if@emphEQ@alignat} -% \begin{macro}{\if@emphEQ@multline}\begin{macro}{\if@emphEQ@NoNumEq} -% Since we're going to determinate which math structure the user has -% input, we create some more conditionals to improve speed and -% readability. Furthermore it will show crucial to know whether or -% not the equation counter has been stepped since \env{multline$*$} -% and \env{multline} don't have exactly the same structure. -% \begin{macrocode} -\newif\if@emphEQ@gather -\newif\if@emphEQ@align -\newif\if@emphEQ@alignat -\newif\if@emphEQ@multline -\newif\if@emphEQ@NoNumEq -% \end{macrocode} -% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} -% -% -% -% \begin{macro}{\@emphEQ@Box}\begin{macro}{\@emphEQ@BoxWidth} -% \begin{macro}{\@emphEQ@displaywidth}\begin{macro}{\@emphEQ@mathbody} -% We need a single box to hold the math structure, a length so we -% can remember the size of the displayed math for later use and a -% token register for the math environment. -% \begin{macrocode} -\newsavebox{\@emphEQ@Box} -\newlength{\@emphEQ@BoxWidth} -\newlength{\@emphEQ@displaywidth} -\newtoks\@emphEQ@mathbody -% \end{macrocode} -% \end{macro}\end{macro}\end{macro}\end{macro} -% \begin{macro}{\@emphEQ@Left}\begin{macro}{\@emphEQ@Right}\begin{macro}{\@emphEQ@lwd}\begin{macro}{\@emphEQ@rwd} -% Here are some vital parts: The additional informations the user -% want to display on either side of the math structure are saved by -% \cmd{\@emphEQ@Left} and \cmd{\@emphEQ@Right} and \cmd{\@emphEQ@lwd} and \cmd{\@emphEQ@rwd} -% measure the width of them for later use. -% \begin{macrocode} -\newcommand{\@emphEQ@Left}{} -\newcommand{\@emphEQ@Right}{} -\newlength{\@emphEQ@lwd} -\newlength{\@emphEQ@rwd} -% \end{macrocode} -% \end{macro}\end{macro}\end{macro}\end{macro} -% \begin{macro}{\@emphEQ@boxtype}\begin{macro}{\@emphEQ@boxtypelength} -% \begin{macro}{\@emphEQ@shadowbox}\begin{macro}{\if@emphEQ@shadowbox} -% To make sure spacing is right when putting the math structure into -% a box, we need to know what kind of box it is: The width is -% extremely important. Often we will have to subtract or add half of -% an empty (but \emph{not} zero-width) box' width to certain -% lengths. When using an \cmd{\fbox} or \cmd{\colorbox} this is just -% \cmd{\fboxrule}+\cmd{\fboxsep}, but when using say, -% \cmd{\doublebox} of \pkg{fancybox} fame the necessity arises. -% \pkg{fancybox} also defines \cmd{\shadowbox} which needs extra -% taking care of, since it's asymmetrical unlike most other framed -% boxes. -% -% Thus we test whether or not \pkg{fancybox} has been loaded at the -% beginning of the document. If it has, we don't lift a finger; if -% it hasn't, we let \cmd{\fbox} be an alias for \cmd{\shadowbox}. -% Then we create a private version of \cmd{\shadowbox} for -% testing purposes and a conditional for the algorithm. -% \begin{macrocode} -\newcommand{\@emphEQ@boxtype}{} -\newlength{\@emphEQ@boxtypelength} -\AtBeginDocument{% - \@ifpackageloaded{fancybox}{}{% - \let\shadowbox=\fbox}} -\newcommand{\@emphEQ@shadowbox}{\shadowbox} -\newif\if@emphEQ@shadowbox -% \end{macrocode} -% \end{macro}\end{macro}\end{macro}\end{macro} -% \begin{macro}{\@emphEQ@templength}\begin{macro}{@emphEQ@EqCtr} -% We are almost ready to go. We only need two temporary little -% helpers: one length and one counter. -% \begin{macrocode} -\newlength{\@emphEQ@templength} -\newcounter{@emphEQ@EqCtr} -% \end{macrocode} -% \end{macro}\end{macro} -% -% \subsubsection{Faraway, so close}\label{sec:CloseEnough} -% \begin{macro}{\@emphEQ@CloseEnough} -% \changes{v0.6}{2003/01/10}{Added a test for lengths being almost identical} -% When determining the display type we will occasionally have to check if an equation of the -% form -% \[ -% \cmd{\totwidth@}-\cmd{\tagshift@}=\cmd{\linewidth} -% \] -% is true. However small rounding errors \emph{can} occur in -% \env{alignat} so we would rather see if the equation -% \[ -% -\delta<\cmd{\totwidth@}-\cmd{\tagshift@}-\cmd{\linewidth}<\delta -% \] -% holds for some sufficiently small $\delta>\text{$0$ pt}$. I have used $\delta=\text{$5$ sp}$. -% \begin{macrocode} -\newcommand{\@emphEQ@CloseEnough}[4]{% - \setlength{\@tempdima}{#1-#2}% - \ifdim\@tempdima>-5sp - \ifdim\@tempdima<5sp - #3 - \else - #4 - \fi - \else - #4 - \fi -} -% \end{macrocode} -% \end{macro} -% -% \subsection{Saving the input} -% \begin{macro}{\@emphEQ@MainEnv} -% \changes{v0.7}{2003/05/11}{Added use of token register to remove the -% need for an extra \cmd{\write} and \pkg{verbatim}} -% \begin{macro}{\end@emphEQ@MainEnv} -% \begin{macro}{\@emphEQ@get@body}\begin{macro}{\@emphEQ@findend} -% \begin{macro}{\@emphEQ@EnvName} -% We start out by saving the input in the token register -% \cmd{\@emphEQ@mathbody}. The method is heavily inspired by -% \pkg{tabularx} \dots\@ No need to copy the words of David Carlisle here---his code will do! -% \begin{macrocode} -\def\@emphEQ@MainEnv{% - \edef\@emphEQ@EnvName{\@currenvir}% - {\ifnum0=`}\fi - \@emphEQ@mathbody{}\@emphEQ@get@body -} -\let\end@emphEQ@MainEnv\relax -\long\def\@emphEQ@get@body#1\end{% - \@emphEQ@mathbody\expandafter{\the\@emphEQ@mathbody #1}% - \@emphEQ@findend -} -\def\@emphEQ@findend#1{% - \def\@tempa{#1}% - \ifx\@tempa\@emphEQ@EnvName - \expandafter\@emphEQ@PostProcess - \else - \@emphEQ@mathbody\expandafter{\the\@emphEQ@mathbody\end{#1}}% - \expandafter\@emphEQ@get@body - \fi -} -\def\@emphEQ@EnvName{@emphEQ@MainEnv} -% \end{macrocode} -% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro} -% \begin{macro}{@emphEQ@PostProcess} -% Now we can go on with the post processing, which is the real -% workhorse in this package. The first job is to test if we're -% using a \cmd{\shadowbox} and then we set some \pkg{amsmath} -% dimensions to zero---\pkg{amsmath} doesn't do this by itself, and -% for that we can be thankful. Otherwise you wouldn't be reading -% this now~;-) -% \begin{macrocode} -\newcommand*{\@emphEQ@PostProcess}{% - \ifx\@emphEQ@boxtype\@emphEQ@shadowbox - \@emphEQ@shadowboxtrue - \else - \@emphEQ@shadowboxfalse - \fi - \tagshift@=0pt \tagwidth@=0pt \totwidth@=0pt - \eqnshift@=0pt \alignsep@=0pt -% \end{macrocode} -% \subsection{The first pass} -% We then run the first pass to find out which environment we've -% got. However we have to store the equation counter because it is -% stepped in this pass, and we certainly don't want that to happen. -% As a side effect this will also tell us if the equations are -% numbered. -% -% If we are to put a brace to the left of the display, it would be -% rather pleasant to know just how high the structure is, since this -% will affect the height and more importantly the width the brace: -% we will need to know the \emph{exact} width of such material. -% Hence we put it in a box which is easy to measure and fiddle -% around with. To achieve this we put the contents of the token register -% \cmd{\@emphEQ@mathbody} in a \env{minipage} inside a \env{lrbox}. Alas, -% \env{lrbox} won't let us escape into display math mode, so we play -% a dirty trick on it and use a \env{minipage}, which will let us -% have our way with it. -% -% The \env{minipage} starts in horizontal mode and then goes -% straight to display math mode, thus adding some space before the -% display math. However there was nothing on the first line in the -% \env{minipage} thus leading \TeX\ to add a \cmd{\abovedisplayskip} -% before the display. We subtract this as fast as we can! -% Furthermore it showed in test runs, that an additional~1~pt had to -% be subtracted in the top---but not in the bottom. It has nothing -% to do with any of the standard page dimensions or parameters. -% Strange indeed. -% \begin{macrocode} - \setcounter{@emphEQ@EqCtr}{\value{equation}}% - \begin{lrbox}{\@emphEQ@Box}% - \begin{minipage}{\linewidth}% - \vskip-\abovedisplayskip\relax\vskip-1pt\relax - \the\@emphEQ@mathbody - \end{minipage}% - \end{lrbox}% -% \end{macrocode} -% We then look at the equation counter to see if we had any numbered -% equations and reset it if that was the case. If we used a -% \env{multline$*$} we can detect this by measuring |\tagwidth@|. -% \begin{macrocode} - \ifnum\value{equation}=\value{@emphEQ@EqCtr}% - \ifdim\tagwidth@>0pt - \else - \@emphEQ@NoNumEqtrue - \fi - \else - \setcounter{equation}{\value{@emphEQ@EqCtr}}% - \fi -% \end{macrocode} -% Now we can determine the various math environments. Firstly we -% measure an empty \cmd{\@emphEQ@boxtype}---we will need this -% information when the math structure is finally put into a box of -% this type, but we have to take it into account when calculating -% the allowable width of \env{multline} displays because we want to -% use the margins already set for this environment. -% \begin{macrocode} - \settowidth{\@emphEQ@boxtypelength}{\@emphEQ@boxtype{}}% -% \end{macrocode} -% The idea is that each of the \pkg{amsmath} multiple line -% environments can be singled out because it uses a certain -% dimension in a way none of the others use it. -% \begin{list}{}{} -% \item[\env{align}:] Uses \cmd{\alignsep@} and sets it to something -% positive. None of the others use it. -% \item[\env{multline}:] Doesn't use \cmd{\eqnshift@}. -% \item[\env{gather}:] Doesn't use \cmd{\tagshift@}. -% \item[\env{alignat}:] Can be determined because some dimensions -% will have special relations e.g., when in |[fleqn,reqno]| mode -% the equation -% \[ -% \cmd{\totwidth@}-\cmd{\tagshift@}=\cmd{\linewidth} -% \] -% holds\footnote{Well almost---they may be off by a few scaled points. -% See section~\ref{sec:CloseEnough} for further details.} -% and similarly for the other three display modes. See the -% code for these equations. -% \end{list} -% -% \subsubsection{\mode{[fleqn,leqno]}} -% ~ -% \begin{macrocode} - \if@emphEQ@FLL % fleqn and leqno - \ifdim\alignsep@>0pt % => align - \@emphEQ@aligntrue - \setlength{\@emphEQ@displaywidth}{\tagshift@-\@mathmargin}% - \else - \ifdim\eqnshift@=0pt % => multline %tagwidth@> - \@emphEQ@multlinetrue - \if@emphEQ@NoNumEq - \setlength{\@emphEQ@displaywidth}{% - \linewidth-\multlinegap-\@mathmargin - -\@emphEQ@boxtypelength}% - \else - \setlength{\@emphEQ@displaywidth}{% - \linewidth-\tagwidth@-\multlinegap - -\multlinetaggap-\@emphEQ@boxtypelength}% - \fi - \else - \ifdim\tagshift@=0pt % => gather - \@emphEQ@gathertrue - \setlength{\@emphEQ@displaywidth}{% - \totwidth@-\@mathmargin}% - \else - \ifdim\tagshift@=\totwidth@ % => alignat - \@emphEQ@alignattrue - \setlength{\@emphEQ@displaywidth}{% - \totwidth@-\@mathmargin}% - \else - %Nothing thus far... - \fi - \fi - \fi - \fi - \fi -% \end{macrocode} -% \subsubsection{\mode{[fleqn,reqno]}} -% ~ -% \begin{macrocode} - \if@emphEQ@FLR % fleqn and reqno - \ifdim\alignsep@>0pt % => align - \@emphEQ@aligntrue - \setlength{\@emphEQ@displaywidth}{% - \linewidth-\@mathmargin+\tagshift@}% - \else - \ifdim\eqnshift@=0pt % => multline - \@emphEQ@multlinetrue - \if@emphEQ@NoNumEq - \setlength{\@emphEQ@displaywidth}{% - \linewidth-\multlinegap-\@mathmargin - -\@emphEQ@boxtypelength}% - \else - \setlength{\@emphEQ@displaywidth}{% - \linewidth-\tagwidth@-\@mathmargin - -\multlinetaggap-\@emphEQ@boxtypelength}% - \fi - \else - \ifdim\tagshift@=0pt % => gather - \@emphEQ@gathertrue - \setlength{\@emphEQ@displaywidth}{% - \totwidth@-\@mathmargin}% - \else - \@emphEQ@CloseEnough{\totwidth@-\tagshift@}% - {\linewidth}% - {\@emphEQ@alignattrue - \setlength{\@emphEQ@displaywidth}% - {\totwidth@-\eqnshift@}}{}% - \fi - \fi - \fi - \fi -% \end{macrocode} -% \subsubsection{\mode{[reqno]}} -% ~ -% \begin{macrocode} - \if@emphEQ@R % reqno - \ifdim\alignsep@>0pt % => align - \@emphEQ@aligntrue - \setlength{\@emphEQ@displaywidth}{\totwidth@}% - \else - \ifdim\eqnshift@=0pt % => multline - \@emphEQ@multlinetrue - \if@emphEQ@NoNumEq - \setlength{\@emphEQ@displaywidth}{% - \linewidth-2\multlinegap - -\@emphEQ@boxtypelength}% - \else - \setlength{\@emphEQ@displaywidth}{% - \linewidth-\tagwidth@-\multlinegap - -\multlinetaggap-\@emphEQ@boxtypelength}% - \fi - \else - \ifdim\tagshift@=0pt % => gather - \@emphEQ@gathertrue - \setlength{\@emphEQ@displaywidth}{\totwidth@}% - \else - \@emphEQ@CloseEnough{\tagshift@}{-\eqnshift@}% - {\@emphEQ@alignattrue - \setlength{\@emphEQ@displaywidth}{\totwidth@}}{}% - \fi - \fi - \fi - \fi -% \end{macrocode} -% \subsubsection{\mode{[leqno]}} -% ~ -% \begin{macrocode} - \if@emphEQ@L % leqno - \ifdim\alignsep@>0pt % => align - \@emphEQ@aligntrue - \setlength{\@emphEQ@displaywidth}{\totwidth@}% - \else - \ifdim\eqnshift@=0pt % => multline - \@emphEQ@multlinetrue - \if@emphEQ@NoNumEq - \setlength{\@emphEQ@displaywidth}{% - \linewidth-2\multlinegap - -\@emphEQ@boxtypelength}% - \else - \setlength{\@emphEQ@displaywidth}{% - \linewidth-\tagwidth@-\multlinegap - -\multlinetaggap-\@emphEQ@boxtypelength}% - \fi - \else - \ifdim\tagshift@=0pt % => gather - \@emphEQ@gathertrue - \setlength{\@emphEQ@displaywidth}{\totwidth@}% - \else - \@emphEQ@CloseEnough{% - \linewidth-\eqnshift@}{\tagshift@}{% - \@emphEQ@alignattrue - \setlength{\@emphEQ@displaywidth}{\totwidth@}}% - {}% - \fi - \fi - \fi - \fi -% \end{macrocode} -% Phew! That was tedious, but necessary. I wish I could say it got -% better further down the road, but it doesn't. Now we can measure -% the width of the additional material on both sides of the math -% structure. We add braces here and there to avoid any -% \cmd{\thinmuskip}'s. -% \begin{macrocode} - \settowidth{\@emphEQ@lwd}{${\@emphEQ@Left}% - {\vphantom{\usebox{\@emphEQ@Box}}}$}% - \settowidth{\@emphEQ@rwd}{${\vphantom{\usebox{\@emphEQ@Box}}}% - {\@emphEQ@Right}$}% -% \end{macrocode} -% -% \subsection{The second pass} -% -% When we try to create an effect as in the preliminary example -% there are a few things we need to tell \LaTeX\ for the overall -% result to be acceptable. If the display math is centered, then the -% new one should also be centered. This means that when typesetting -% the math structure for the second time, we need to make -% adjustments to \cmd{\linewidth}, \cmd{\@mathmargin} etc.\ for the -% equation tag to be placed correctly. -% -% That process is extremely tedious, but there are only few -% shortcuts, so we just go through each of the four environments, check -% each of the four display modes and alter dimensions a we trudge -% along. First we check if we are trying to put something into an -% asymmetrical box and then make it symmetrical be removing the size -% of the shadow. -% \begin{macrocode} - \begin{lrbox}{\@emphEQ@Box}% - \if@emphEQ@shadowbox - \addtolength{\@emphEQ@boxtypelength}{-\shadowsize}% - \fi -% \end{macrocode} -% \subsubsection{\env{align}} -% ~ -% \begin{macrocode} - \if@emphEQ@align - \if@emphEQ@FLL - \begin{minipage}{\linewidth+\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}% - \addtolength{\@mathmargin}{\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}%% - \fi - \if@emphEQ@FLR - \begin{minipage}{\linewidth}% - \addtolength{\@mathmargin}{\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}%% - \fi - \if@emphEQ@L - \begin{minipage}{\linewidth+\@emphEQ@lwd-\@emphEQ@rwd}% - \fi - \if@emphEQ@R - \begin{minipage}{\linewidth-\@emphEQ@lwd+\@emphEQ@rwd}% - \fi - \fi -% \end{macrocode} -% \subsubsection{\env{gather}} -% ~ -% \begin{macrocode} - \if@emphEQ@gather - \if@emphEQ@FLL - \begin{minipage}{\linewidth+\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}% - \addtolength{\@mathmargin}{\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}%% - \fi - \if@emphEQ@FLR - \begin{minipage}{\linewidth}% - \addtolength{\@mathmargin}{\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}%% - \fi - \if@emphEQ@R - \setlength{\@emphEQ@templength}{\linewidth-\totwidth@ - -\eqnshift@}% - \begin{minipage}{\linewidth-\@emphEQ@lwd+\@emphEQ@rwd - +\@emphEQ@templength-\eqnshift@}% - \fi - \if@emphEQ@L - \setlength{\@emphEQ@templength}{\linewidth-\totwidth@ - -\eqnshift@}% - \begin{minipage}{\linewidth+\@emphEQ@lwd-\@emphEQ@rwd - -\@emphEQ@templength+\eqnshift@}% - \fi - \fi -% \end{macrocode} -% \subsubsection{\env{alignat}} -% ~ -% \begin{macrocode} - \if@emphEQ@alignat - \if@emphEQ@FLL - \begin{minipage}{\linewidth+\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}% - \addtolength{\@mathmargin}{\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}%% - \fi - \if@emphEQ@FLR - \begin{minipage}{\linewidth}% - \addtolength{\@mathmargin}{\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}%% - \fi - \if@emphEQ@L - \begin{minipage}{\linewidth+\@emphEQ@lwd-\@emphEQ@rwd}% - \fi - \if@emphEQ@R - \begin{minipage}{\linewidth-\@emphEQ@lwd+\@emphEQ@rwd}% - \fi - \fi -% \end{macrocode} -% \subsubsection{\env{multline}} -% ~ -% \begin{macrocode} - \if@emphEQ@multline - \if@emphEQ@FLL - \begin{minipage}{\linewidth}% - \if@emphEQ@NoNumEq - \addtolength{\@mathmargin}{\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}% - \if@emphEQ@shadowbox - \addtolength{\@mathmargin}{\shadowsize} - \fi% - \else - \addtolength{\multlinetaggap}{\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}% - \if@emphEQ@shadowbox - \addtolength{\multlinegap}{\shadowsize}% - \fi - \fi - \addtolength{\multlinegap}{\@emphEQ@rwd - +.5\@emphEQ@boxtypelength}% - \fi - \if@emphEQ@FLR - \begin{minipage}{\linewidth}% - \if@emphEQ@NoNumEq - \addtolength{\multlinegap}{\@emphEQ@rwd - +.5\@emphEQ@boxtypelength}% - \if@emphEQ@shadowbox - \addtolength{\multlinegap}{\shadowsize}% - \fi - \else - \addtolength{\multlinetaggap}{\@emphEQ@rwd - +.5\@emphEQ@boxtypelength}% - \if@emphEQ@shadowbox - \addtolength{\multlinetaggap}{\shadowsize}% - \fi - \fi - \addtolength{\@mathmargin}{\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}% - \fi - \if@emphEQ@L - \begin{minipage}{\linewidth}% - \if@emphEQ@NoNumEq - \addtolength{\multlinegap}{.5\@emphEQ@rwd - +.5\@emphEQ@lwd+.5\@emphEQ@boxtypelength}% - \if@emphEQ@shadowbox - \addtolength{\multlinegap}{.5\shadowsize}% - \fi - \else - \addtolength{\multlinetaggap}{\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}% - \addtolength{\multlinegap}{\@emphEQ@rwd - +.5\@emphEQ@boxtypelength}% - \if@emphEQ@shadowbox - \addtolength{\multlinegap}{\shadowsize}% - \fi - \fi - \fi - \if@emphEQ@R - \begin{minipage}{\linewidth}% - \if@emphEQ@NoNumEq - \addtolength{\multlinegap}{.5\@emphEQ@rwd - +.5\@emphEQ@lwd+.5\@emphEQ@boxtypelength}% - \if@emphEQ@shadowbox - \addtolength{\multlinegap}{.5\shadowsize} - \fi - \else - \addtolength{\multlinetaggap}{\@emphEQ@rwd - +.5\@emphEQ@boxtypelength}% - \addtolength{\multlinegap}{\@emphEQ@lwd - +.5\@emphEQ@boxtypelength}% - \if@emphEQ@shadowbox - \addtolength{\multlinetaggap}{\shadowsize} - \fi - \fi - \fi - \fi -% \end{macrocode} -% Finally we get to typeset the contents of \cmd{\@emphEQ@mathbody} for -% the second time\ldots -% \begin{macrocode} - \vskip-\abovedisplayskip\relax\vskip-1pt\relax - \the\@emphEQ@mathbody - \end{minipage}% - \end{lrbox}% -% \end{macrocode} -% -% \subsection{Putting it into the box} -% -% Because we were clever to start with---by measuring the width of -% the display math and storing it in -% \cmd{\@emphEQ@displaywidth}---we can now put it into a box of -% width -% \cmd{\@emphEQ@displaywidth}+\cmd{\@emphEQ@rwd}+\cmd{\@emphEQ@lwd}. -% This doesn't apply to \env{multline} though: it has to be set in a -% box of width \cmd{\@emphEQ@displaywidth}. -% \begin{macrocode} -\setlength{\@emphEQ@BoxWidth}{\@emphEQ@displaywidth+\@emphEQ@rwd - +\@emphEQ@lwd}% -% \end{macrocode} -% \subsubsection{\env{align}} -% ~ -% \begin{macrocode} -\if@emphEQ@align - \if@emphEQ@FLL - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% - \if@emphEQ@shadowbox \kern.5\shadowsize \fi - $\@emphEQ@Left$% - \kern-.5\@emphEQ@boxtypelength% - \kern-\@mathmargin - \kern-\@emphEQ@lwd - \usebox{\@emphEQ@Box}% - \kern-\@emphEQ@displaywidth - \kern-\@emphEQ@rwd - \kern-\@emphEQ@lwd - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@FLR - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% - \if@emphEQ@shadowbox \kern.5\shadowsize \fi - $\@emphEQ@Left$% - \kern-.5\@emphEQ@boxtypelength% - \kern-\@mathmargin - \kern-\@emphEQ@lwd - \usebox{\@emphEQ@Box}% - \kern-\alignsep@ - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@L - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% - %\kern\eqnshift@ - %\kern-\alignsep@ - $\@emphEQ@Left$% - \kern-\eqnshift@ - %\kern-\alignsep@ - \usebox{\@emphEQ@Box}% - %\kern-\eqnshift@ - \kern-\alignsep@ - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@R - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% - $\@emphEQ@Left$% - \kern-\eqnshift@ - \usebox{\@emphEQ@Box}% - \kern-\eqnshift@ - $\@emphEQ@Right$}}% - \fi -\fi -% \end{macrocode} -% \subsubsection{\env{alignat}} -% ~ -% \begin{macrocode} -\if@emphEQ@alignat - \if@emphEQ@FLL - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% - \if@emphEQ@shadowbox \kern.5\shadowsize \fi - $\@emphEQ@Left$% - \kern-.5\@emphEQ@boxtypelength - \kern-\@mathmargin - \kern-\@emphEQ@lwd - \usebox{\@emphEQ@Box}% - \kern\@mathmargin - \kern\@emphEQ@displaywidth - \kern-\linewidth - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@FLR - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% - \if@emphEQ@shadowbox \kern.5\shadowsize \fi - $\@emphEQ@Left$% - \kern-.5\@emphEQ@boxtypelength - \kern-\@mathmargin - \kern-\@emphEQ@lwd - \usebox{\@emphEQ@Box}% - \kern\@mathmargin - \kern\@emphEQ@displaywidth - \kern-\linewidth - \kern\@emphEQ@lwd - \kern.5\@emphEQ@boxtypelength - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@L - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% - $\@emphEQ@Left$% - \kern-\eqnshift@ - \usebox{\@emphEQ@Box}% - \kern-\eqnshift@ - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@R - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% - $\@emphEQ@Left$% - \kern-\eqnshift@ - \usebox{\@emphEQ@Box}% - \kern-\eqnshift@ - $\@emphEQ@Right$}}% - \fi -\fi -% \end{macrocode} -% \subsubsection{\env{gather}} -% ~ -% \begin{macrocode} -\if@emphEQ@gather - \if@emphEQ@FLL - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% - \if@emphEQ@shadowbox \kern.5\shadowsize \fi - $\@emphEQ@Left$% - \kern-.5\@emphEQ@boxtypelength - \kern-\@mathmargin - \kern-\@emphEQ@lwd - \usebox{\@emphEQ@Box}% - \kern-\linewidth - \kern\@mathmargin - \kern\@emphEQ@displaywidth - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@FLR - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][l]{% - \if@emphEQ@shadowbox \kern.5\shadowsize - \fi - $\@emphEQ@Left$% - \kern-.5\@emphEQ@boxtypelength - \kern-\@mathmargin - \kern-\@emphEQ@lwd - \usebox{\@emphEQ@Box}% - \kern-\linewidth - \kern.5\@emphEQ@boxtypelength - \kern\@mathmargin - \kern\@emphEQ@displaywidth - \kern\@emphEQ@lwd - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@L - \setlength{\tagwidth@}{\eqnshift@+\@emphEQ@rwd}% - \setlength{\@emphEQ@templength}{\linewidth-\totwidth@ - -\eqnshift@}% - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% - \ifdim\@emphEQ@templength<\tagwidth@ - \setlength{\tagwidth@}{\@emphEQ@templength - +\@emphEQ@lwd}% - \ifdim\tagwidth@<\eqnshift@ - \kern-\@emphEQ@templength - \kern\eqnshift@ - \fi - \else - \kern-\@emphEQ@lwd - \kern\@emphEQ@rwd - \kern-\@emphEQ@templength - \kern\eqnshift@ - \fi - $\@emphEQ@Left$% - \kern-\eqnshift@ - \usebox{\@emphEQ@Box}% - %\kern-\eqnshift@ - \kern-\@emphEQ@lwd - \kern\@emphEQ@rwd - \kern-\@emphEQ@templength - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@R - \setlength{\tagwidth@}{\eqnshift@+\@emphEQ@rwd}% - \setlength{\@emphEQ@templength}{\linewidth-\totwidth@ - -\eqnshift@}% - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@BoxWidth][c]{% - \kern-\@emphEQ@lwd - \kern\@emphEQ@rwd - \kern\@emphEQ@templength - \kern-\eqnshift@ - $\@emphEQ@Left$% - \ifdim\@emphEQ@templength>\tagwidth@ - \kern-\eqnshift@ - \else - \kern\@emphEQ@lwd - \kern-\@emphEQ@rwd - \kern-\@emphEQ@templength - \fi - \usebox{\@emphEQ@Box}% - \kern-\eqnshift@ - $\@emphEQ@Right$}}% - \fi -\fi -% \end{macrocode} -% \subsubsection{\env{multline}} -% -% \env{multline} is somewhat more difficult because \env{multline$*$} -% differs on several accounts. Thus we make use of our little test -% to see if the math structure was numbered to begin with -% (\verb|\if@emphEQ@NoNumEq|). -% \begin{macrocode} -\if@emphEQ@multline - \if@emphEQ@FLL - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@displaywidth][l]{% - \if@emphEQ@shadowbox \kern.5\shadowsize \fi - $\@emphEQ@Left$% - \kern-.5\@emphEQ@boxtypelength - \kern-\@emphEQ@lwd - \if@emphEQ@NoNumEq - \if@emphEQ@shadowbox \kern-\shadowsize \fi - \kern-\@mathmargin - \else - \kern-\tagwidth@ - \kern-\multlinetaggap - \fi - \usebox{\@emphEQ@Box}% - \kern-\@emphEQ@boxtypelength - \if@emphEQ@NoNumEq - \kern-\multlinegap - \else - \kern\multlinegap - \fi - \kern-\@emphEQ@rwd - \kern-\@emphEQ@lwd - \kern-\@mathmargin - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@FLR - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@displaywidth][l]{% - \if@emphEQ@shadowbox \kern.5\shadowsize \fi - $\@emphEQ@Left$% - \kern-.5\@emphEQ@boxtypelength - \kern-\@emphEQ@lwd - \kern-\@mathmargin - \usebox{\@emphEQ@Box}% - \kern-\@emphEQ@boxtypelength - \kern-\@emphEQ@rwd - \kern-\@emphEQ@lwd - \if@emphEQ@NoNumEq - \kern-\multlinegap - \else - \kern-\multlinetaggap - \fi - \kern-\@mathmargin - \kern-\tagwidth@ - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@L - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@displaywidth][l]{% - \if@emphEQ@shadowbox \kern.5\shadowsize \fi - $\@emphEQ@Left$% - \kern-.5\@emphEQ@boxtypelength - \kern-\@emphEQ@lwd - \if@emphEQ@NoNumEq - \kern-\multlinegap - \kern.5\@emphEQ@lwd - \kern-.5\@emphEQ@rwd - \if@emphEQ@shadowbox \kern-.5\shadowsize \fi - \else - \kern-\multlinetaggap - \kern-\tagwidth@ - \fi - \usebox{\@emphEQ@Box}% - \kern-.5\@emphEQ@boxtypelength - \if@emphEQ@NoNumEq - \kern.5\@emphEQ@rwd - \kern-.5\@emphEQ@lwd - \fi - \kern-\@emphEQ@rwd - \kern-\multlinegap - $\@emphEQ@Right$}}% - \fi - \if@emphEQ@R - \savebox{\@emphEQ@Box}{\makebox[\@emphEQ@displaywidth][l]{% - \if@emphEQ@shadowbox \kern.5\shadowsize \fi - $\@emphEQ@Left$% - \kern-.5\@emphEQ@boxtypelength - \if@emphEQ@NoNumEq - \if@emphEQ@shadowbox \kern-.5\shadowsize \fi - \kern-.5\@emphEQ@rwd - \kern.5\@emphEQ@lwd - \fi - \kern-\@emphEQ@lwd - \kern-\multlinegap - \usebox{\@emphEQ@Box}% - \kern-.5\@emphEQ@boxtypelength - \kern-\@emphEQ@rwd - \if@emphEQ@NoNumEq - \kern-\multlinegap - \kern-.5\@emphEQ@lwd - \kern.5\@emphEQ@rwd - \else - \kern-\multlinetaggap - \fi - \kern-\tagwidth@ - $\@emphEQ@Right$}}% - \fi -\fi -% \end{macrocode} -% -% \subsubsection{The final step} -% -% At last here comes the good part! We are now ready to place the -% box containing all of our math material. If we have used a -% \env{multline} we have to do a few kerning tricks but at least we -% would seem to know the drill by now\ldots To make sure vertical -% spacing is ok, we put it all into a simple math environment -% \verb|\[...\]|. -% \begin{macrocode} -\[ - \if@emphEQ@align - \if@emphEQ@L - \kern-\alignsep@ - \kern\eqnshift@ - \fi - \fi - \if@emphEQ@gather - \if@emphEQ@L - \kern-\@emphEQ@templength - \kern\eqnshift@ - \kern\@emphEQ@rwd - \kern-\@emphEQ@lwd - \fi - \if@emphEQ@R - \setlength{\tagwidth@}{\eqnshift@+\@emphEQ@rwd}% - \ifdim\@emphEQ@templength>\tagwidth@ - \kern-\@emphEQ@templength - \kern\eqnshift@ - \kern\@emphEQ@lwd - \else - \kern\@emphEQ@templength - \kern-\eqnshift@ - \kern\@emphEQ@rwd - \kern-\@emphEQ@lwd - \fi - \fi - \fi - \if@emphEQ@multline - \if@emphEQ@NoNumEq - % naught - \else - \if@emphEQ@FLL - \kern-\@mathmargin - \kern\tagwidth@ - \kern\multlinetaggap - \fi - \if@emphEQ@L - \kern\tagwidth@ - \kern\multlinetaggap - \kern-\multlinegap - \fi - \if@emphEQ@R - \kern-\tagwidth@ - \kern-\multlinetaggap - \kern\multlinegap - \fi - \fi - \else -% \end{macrocode} -% If we are using a \cmd{\shadowbox} in centered display mode, I -% would rather that the shadowsize is ignored when placing the box. -% Reason: I think it looks better. Judge for yourself: -% \begin{gather} -% a=b\\ -% \Phi(x)=\int_{-\infty}^x e^{-t^2/2}\, dt -% \end{gather} -% -% \begin{empheq}[boxtype=\shadowbox] -% \begin{gather} -% a=b\\ -% \Phi(x)=\int_{-\infty}^x e^{-t^2/2}\, dt -% \end{gather} -% \end{empheq} -% \begin{macrocode} - \if@emphEQ@shadowbox - \if@emphEQ@R - \kern\shadowsize - \fi - \if@emphEQ@L - \kern\shadowsize - \fi - \fi - \fi - \@emphEQ@boxtype{\usebox{\@emphEQ@Box}}% -% \end{macrocode} -% After all is done, we empty out the added material and the -% boxtype. -% \begin{macrocode} - \gdef\@emphEQ@Left{}\gdef\@emphEQ@Right{}% - \gdef\@emphEQ@boxtype{}% - \]% - \ifnum0=`{\fi}% - \expandafter\end\expandafter{\@emphEQ@EnvName}% -} -% \end{macrocode} -% -% \subsection{Going public\ldots} -% \begin{macro}{boxtype}\begin{macro}{Left}\begin{macro}{Right}\begin{macro}{empheq} -% In order to simplify the user interface, we make use of -% \pkg{keyval}. We define three keys to be used along with a more -% accessible version of \env{@emphEQ@MainEnv}. -% \changes{v0.7}{2003/05/11}{Changed the user interface slightly} -% \begin{macrocode} -\define@key{empheq}{boxtype}{\renewcommand\@emphEQ@boxtype{#1}} -\define@key{empheq}{Left}{\def\@emphEQ@Left{#1}} -\define@key{empheq}{Right}{\def\@emphEQ@Right{#1}} -\newenvironment{empheq}[1][]{\setkeys{empheq}{#1}\@emphEQ@MainEnv}% - {\end@emphEQ@MainEnv\ignorespacesafterend}% -% \end{macrocode} -% \end{macro}\end{macro}\end{macro}\end{macro} -% \begin{macro}{\DeclareLeftDelimiter} -% \changes{v0.7}{2003/05/11}{Added delimiter interface} -% \begin{macro}{\DeclareRightDelimiter} -% \changes{v0.7}{2003/05/11}{Added delimiter interface} -% It might come in handy to have delimiters of the appropriate size -% available to cover the math display as in \eqref{eq:1}. Therefore -% we define two commands that will create such delimiters once and -% for all. -% Use this as an inspiration for further kinds of delimiters. -% \begin{macrocode} -\newcommand{\DeclareLeftDelimiter}[2][\!]{% - \@namedef{empheq\expandafter\@gobble\string#2}{ - \left#2 - \vphantom{\usebox{\@emphEQ@Box}}% - \right.#1}} -\newcommand{\DeclareRightDelimiter}[2][\!]{% - \@namedef{empheq\expandafter\@gobble\string#2}{% - #1\left. - \vphantom{\usebox{\@emphEQ@Box}}% - \right#2}}% -\DeclareRightDelimiter{\rbrace} -\DeclareLeftDelimiter{\lbrace} -%</package> -% \end{macrocode} -% \end{macro}\end{macro}\end{macro} -% \Finale -\endinput |