-
Notifications
You must be signed in to change notification settings - Fork 7
/
empheq.dtx
4576 lines (4538 loc) · 160 KB
/
empheq.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse meta-comment
%
% Copyright (C) 2002-2007 by Morten Hoegholm
% Copyright (C) 2012-2019 by Lars Madsen
% Copyright (C) 2020 by Lars Madsen, The LaTeX3 Project
%
% 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
% Lars Madsen, The LaTeX3 Project
%
% This work consists of the main source file empheq.dtx
% and the derived files
% empheq.sty, empheq.pdf, empheq.ins, empheq.drv.
%
% Distribution:
% CTAN:macros/latex/contrib/mh/empheq.dtx
% CTAN:macros/latex/contrib/mh/empheq.pdf
%
% Unpacking:
% (a) If empheq.ins is present:
% tex empheq.ins
% (b) Without empheq.ins:
% tex empheq.dtx
% (c) If you insist on using LaTeX
% latex \let\install=y\input{empheq.dtx}
% (quote the arguments according to the demands of your shell)
%
% Documentation:
% (a) If empheq.drv is present:
% latex empheq.drv
% (b) Without empheq.drv:
% latex empheq.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 empheq.dtx
% makeindex -s gind.ist empheq.idx
% pdflatex empheq.dtx
% makeindex -s gind.ist empheq.idx
% pdflatex empheq.dtx
%
% Installation:
% TDS:tex/latex/mh/empheq.sty
% TDS:doc/latex/mh/empheq.pdf
% TDS:source/latex/mh/empheq.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: empheq 2024/08/09 v2.17 empheq}
\Msg{************************************************************************}
\keepsilent
\askforoverwritefalse
\preamble
This is a generated file.
Copyright (C) 2002-2007 by Morten Hoegholm
Copyright (C) 2012-2019 by Lars Madsen
Copyright (C) 2020- by Lars Madsen, The LaTeX3 Project
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
Lars Madsen, The LaTeX3 Project
This work consists of the main source file empheq.dtx
and the derived files
empheq.sty, empheq.pdf, empheq.ins, empheq.drv.
\endpreamble
\generate{%
\file{empheq.ins}{\from{empheq.dtx}{install}}%
\file{empheq.drv}{\from{empheq.dtx}{driver}}%
\usedir{tex/latex/mh}%
\file{empheq.sty}{\from{empheq.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{* empheq.sty}
\Msg{*}
\Msg{* To produce the documentation run the file `empheq.drv'}
\Msg{* through LaTeX.}
\Msg{*}
\Msg{* Happy TeXing!}
\Msg{*}
\Msg{************************************************************************}
\endbatchfile
%</install>
%<*ignore>
\fi
%</ignore>
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{empheq.drv}%
[2024/08/09 v2.17 Emphasizing equations]
\documentclass{ltxdoc}
\usepackage{mathpazo}
\usepackage[overload]{empheq}
\usepackage{xcolor,varioref,booktabs,fancybox,iftex}
\usepackage[overload]{textcase}
\iftutex\else
\usepackage[T1]{fontenc}
\fi
\pagestyle{headings}
\hyphenation{emph-eq}
\makeatletter
\providecommand*\pkg[1]{\textsf{#1}}
\providecommand*\cls[1]{\textsf{#1}}
\providecommand*\env[1]{\texttt{#1}}
\providecommand*\email[1]{\href{mailto:#1}{\texttt{#1}}}
\providecommand*\mode[1]{\texttt{[#1]}}
\providecommand*\file[1]{\texttt{#1}}
\addtolength\marginparwidth{-30pt}
\newcommand\lineref[1]{
\begingroup
% \p@CodelineNo \normalfont \scriptsize 475
\let\p@CodelineNo\relax
\let\normalfont\relax
%\let\scriptsize\relax
\ref{#1}
\endgroup
}
\newcommand*\AddDescribe[3]{%
\@namedef{Describe#1}{\leavevmode\@bsphack\begingroup\MakePrivateLetters
\@nameuse{Describe@#1}}
\@namedef{Describe@#1}##1{\endgroup
\marginpar{\raggedleft\@nameuse{PrintDescribe#1}{##1}}%
\@nameuse{Special#1Index}{##1}\@esphack\ignorespaces}
\@namedef{Special#1Index}##1{\@bsphack
\index{##1\actualchar{\protect\ttfamily ##1}
(#2)\encapchar usage}%
\index{#3:\levelchar##1\actualchar{\protect\ttfamily ##1}\encapchar
usage}\@esphack}
\@namedef{PrintDescribe#1}##1{\strut \MacroFont ##1\ }%
\@namedef{Print#1Name}##1{\strut \MacroFont ##1\ }%
}
\AddDescribe{Color}{color}{colors}
\AddDescribe{KeyFamily}{key family}{key families}
\newcommand*\DescribeDelimiter[1]{%
\cs{#1}&\SpecialMkhIndex{empheq#1}\cs{empheq}\texttt{#1} &
\SpecialMkhIndex{empheqbig#1}\cs{empheqbig}\texttt{#1} &
$\@nameuse{#1}$\tabularnewline}
\newcommand*\SpecialMkhIndex[1]{%
\@bsphack
\index{#1\actualchar{\protect\ttfamily \protect\bslash\space#1}
(` $\bslash#1$ ')\encapchar usage}%
\@esphack
}
\newcommand\TabDescribeOption[3][(default)]{%
\SpecialOptIndex{#2}\opt{#2} & #3 \tabularnewline
}
\newcommand*\TabDescribeAmsKey[2][]{%
\SpecialKeyIndex{#2}\env{#2} &
\texttt{\{#2#1\}} &
\SpecialKeyIndex{#2*}\env{#2*} &
\texttt{\{#2*#1\}} \tabularnewline
}
\newcommand*\TabDescribeOptKey[3][]{%
\SpecialKeyIndex{#2}\key{#2} &
\texttt{#2=}\meta{#3} & #1 \tabularnewline
}
\newenvironment{codesyntax}
{\par\small\addvspace{4.5ex plus 1ex}%
\vskip -\parskip
\noindent
\begin{tabular}{|l|}\hline\ignorespaces}%
{\\\hline\end{tabular}\nobreak\par\nobreak
\vspace{2.3ex}\vskip -\parskip\noindent\ignorespacesafterend}
\makeatletter
\newcommand*\FeatureRequest[2]{%
\hskip1sp
\marginpar{%
\parbox[b]{\marginparwidth}{\small\sffamily\raggedright
\strut Feature request by\\#1\\#2%
}
}%
}
\newcommand*\cttPosting[2]{%
\hskip1sp
\marginpar{%
\parbox[b]{\marginparwidth}{\small\sffamily\raggedright
\strut Posted on \texttt{comp.text.tex} \\#1\\#2%
}%
}%
}
\expandafter\def\expandafter\MakePrivateLetters\expandafter{%
\MakePrivateLetters \catcode`\_=11\relax
}
\providecommand*\SpecialOptIndex[1]{%
\@bsphack
\index{#1\actualchar{\protect\ttfamily #1}
(option)\encapchar usage}%
\index{options:\levelchar#1\actualchar{\protect\ttfamily #1}\encapchar
usage}\@esphack}
\providecommand*\opt[1]{\texttt{#1}}
\providecommand*\SpecialKeyIndex[1]{%
\@bsphack
\index{#1\actualchar{\protect\ttfamily #1}
(key)\encapchar usage}%
\index{keys:\levelchar#1\actualchar{\protect\ttfamily #1}\encapchar
usage}\@esphack}
\providecommand*\key[1]{\textsf{#1}}
\providecommand*\keyfam[1]{\textsf{#1}}
\providecommand*\eTeX{$\m@th\varepsilon$-\TeX}
\def\MTmeta#1{%
\ensuremath\langle
\ifmmode \expandafter \nfss@text \fi
{%
\meta@font@select
\edef\meta@hyphen@restore
{\hyphenchar\the\font\the\hyphenchar\font}%
\hyphenchar\font\m@ne
\language\l@nohyphenation
#1\/%
\meta@hyphen@restore
}\ensuremath\rangle
\endgroup
}
\makeatother
\DeclareRobustCommand\meta{\begingroup\MakePrivateLetters\MTmeta}%
\def\MToarg#1{{\ttfamily[}\meta{#1}{\ttfamily]}\endgroup}
\DeclareRobustCommand\oarg{\begingroup\MakePrivateLetters\MToarg}%
\def\MHmarg#1{{\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}\endgroup}
\DeclareRobustCommand\marg{\begingroup\MakePrivateLetters\MHmarg}%
\def\MHarg#1{{\ttfamily\char`\{#1\ttfamily\char`\}}\endgroup}
\DeclareRobustCommand\arg{\begingroup\MakePrivateLetters\MHarg}%
\def\MHcs#1{\texttt{\char`\\#1}\endgroup}
\DeclareRobustCommand\cs{\begingroup\MakePrivateLetters\MHcs}
\def\MHbool#1{{\ttfamily #1}\endgroup}
\DeclareRobustCommand\bool{\begingroup\MakePrivateLetters\MHbool}%
\def\endverbatim{\if@newlist
\leavevmode\fi\endtrivlist\vspace{-\baselineskip}}
\expandafter\let\csname endverbatim*\endcsname =\endverbatim
\let\MTtheindex\theindex
\def\theindex{\MTtheindex\MakePrivateLetters}
\newcommand*\widefbox[1]{\fbox{\hspace{1em}#1\hspace{1em}}}
\definecolor{myblue}{rgb}{.8, .8, 1}
\newcommand*\mybluebox[1]{%
\colorbox{myblue}{\hspace{1em}#1\hspace{1em}}}
\newenvironment{important}[2][]{%
\setkeys{EmphEqEnv}{#2}%
\setkeys{EmphEqOpt}{box=\mybluebox,#1}%
\EmphEqMainEnv}%
{\endEmphEqMainEnv}
\definecolor{shadecolor}{cmyk}{0,0,0.41,0}
\definecolor{light-blue}{cmyk}{0.25,0,0,0}
\newsavebox{\mysaveboxM} % M for math
\newsavebox{\mysaveboxT} % T for text
\newcommand*\Garybox[2][Example]{%
\sbox{\mysaveboxM}{#2}%
\sbox{\mysaveboxT}{\fcolorbox{black}{light-blue}{#1}}%
\sbox{\mysaveboxM}{%
\parbox[b][\ht\mysaveboxM+.5\ht\mysaveboxT+.5\dp\mysaveboxT][b]{%
\wd\mysaveboxM}{#2}%
}%
\sbox{\mysaveboxM}{%
\fcolorbox{black}{shadecolor}{%
\makebox[\linewidth-10em]{\usebox{\mysaveboxM}}%
}%
}%
\usebox{\mysaveboxM}%
\makebox[0pt][r]{%
\makebox[\wd\mysaveboxM][c]{%
\raisebox{\ht\mysaveboxM-0.5\ht\mysaveboxT
+0.5\dp\mysaveboxT-0.5\fboxrule}{\usebox{\mysaveboxT}}%
}%
}%
}
\newcommand\EmphEqpart{%
\def\partname{\EmphEqpartname}%
\part}
\def\EmphEqpartname{Part}
\makeatother
\usepackage{graphicx}
\usepackage[final,breaklinks=true,hyperindex=false]{hyperref}
\renewcommand*\usage[1]{\textit{\hyperpage{#1}}}
\OnlyDescription
\begin{document}
\DocInput{empheq.dtx}
\end{document}
%</driver>
% \fi
% \changes{v2.17}{2024/08/09}{Fixed typo in manual}
% \changes{v2.16}{2020/03/24}{fixed several bugs related to amsart/-book}
% \changes{v2.15}{2017/03/31}{Fixed a bug in relation to the AMS
% classes and completed prefixing macros belonging to \pkg{mhsetup}
% and \pkg{empheq}}
% \changes{v2.14}{2014/07/16}{Updated maintenance and contact info}
%
% \changes{v2.11}{2004/08/03}{Removed interface to the obsolete empheq
% package \pkg{empheq07}}
%
% \changes{v2.10}{2004/07/26}{Rewrote most of the documentation}
%
% \changes{v2.10}{2004/07/26}{Moved options \texttt{fixamsmath} and
% \texttt{donotfixamsmathbugs} to \pkg{mathtools}}
%
% \changes{v2.10}{2004/07/26}{Added support for \pkg{showkeys}}
%
% \changes{v2.00}{2004/04/14}{Added options \opt{overload},
% \opt{overload2}, \texttt{fixamsmath}, and
% \texttt{donotfixamsmathbugs} plus descriptions of their use}
%
% \changes{v1.06}{2004/03/13}{Upgraded license to LPPL version 1.3}
%
% \changes{v1.00}{2004/02/15}{Complete rewrite of the package hence
% no description of the changes made}
%
% \changes{v0.7a}{2004/02/15}{Made the old package obsolete and
% changed its name to \pkg{empheq-obsolete}}
%
% \changes{v0.7}{2003/05/11}{Added further examples and changed
% existing ones}
% \changes{v0.6b}{2003/03/04}{Added example for changing margins
% inside the boxtype}
% \changes{v0.6a}{2003/01/28}{Minor updates to documentation}
%
% \changes{v0.5}{2002/12/30}{First experimental and very limited
% release}
%
% \GetFileInfo{empheq.drv}
% \CheckSum{2635}
%
% \title{The \pkg{empheq} package\thanks{This file has version number
% \fileversion, last revised \filedate.}\\
% Emphasizing equations in \LaTeXe}
% \author{Morten Hoegholm, Lars Madsen, The LaTeX3 Project}
%
% \date{\filedate}
%
% \maketitle
%
% \begin{abstract}
% \noindent The \pkg{empheq} package can best be described as a visual markup
% extension to \pkg{amsmath}. In short it offers a)~a multi line
% equivalent of \cs{boxed} from \pkg{amsmath} and b)~a way to
% produce arbitrary delimiters that span entire math displays.
% \end{abstract}
%
% \tableofcontents
%
% \clearpage
% \EmphEqpart{Basic user's guide}
%
% There can be little doubt that the de facto standard for
% mathematical typesetting in \LaTeX{} is the \pkg{amsmath} package.
% For the creation of \pkg{empheq}, a visual markup package for use
% in math, it made perfect sense to have \pkg{amsmath} as the
% backbone.
%
% The main idea of \pkg{empheq} is to maintain the familiar syntax
% of the \pkg{amsmath} environments while still providing an easy
% way of specifying markup instructions. This manual is plastered
% with examples showing just how.
%
%
% \section{Basic use of the package}
%
% So what is it \pkg{empheq} does? Well, it allows you to produce
% displays like this:
% \begin{subequations}
% \begin{empheq}[
% box=\mybluebox,
% right={\;\makebox[.9em]{$\raisebox{-.5\totalheight+\fontdimen22\textfont2}
% {\resizebox{!}{\EmphEqdisplayheight+\EmphEqdisplaydepth}{!}}$}},
% left={X=Y\Rightarrow\empheqlbrace}
% ]{alignat=3}
% A_1&=b_1 & \qquad c_1&=d_1 & \qquad e_1&= f_1
% \tag*{\_A\raisebox{1ex}{silly}\raisebox{-1ex}{tag}\_}\\
% A_2&=b_2 & \qquad c_2&=d_2 & \qquad e_2&= f_2 \\
% A_3&=b_3 & \qquad c_3&=d_3 & \qquad e_3&= f_3
% \end{empheq}
% \end{subequations}
% In short \pkg{empheq} enables the user to put things on every side
% of the display without said user having to worry about what
% happens to the equation numbers. For example you can now have a
% display containing multiple lines and still get the effect of the
% \cs{boxed} command from \pkg{amsmath}.
%
%
% \subsection{Using the \env{empheq} environment}
%
% The package defines a single environment
% \SpecialEnvIndex{empheq}\env{empheq} and the usage is kind of
% straightforward:
% \begin{codesyntax}
% |\begin{empheq}|\oarg{markup instructions}\marg{\AmS{} env_name}\\
% \mbox{}\quad\meta{contents of \AmS{} environment}\\
% |\end{empheq}|
% \end{codesyntax}
% A first minimal example file would then be something like
% \begin{verbatim}
% \documentclass{minimal}
% \usepackage{empheq}
% \begin{document}
% \begin{empheq}{align*}
% a&=b \tag{*}\\
% E&=mc^2 + \int_a^a x\, dx
% \end{empheq}
% \end{document}
% \end{verbatim}
% This gives the following display:
% \begin{empheq}{align*}
% a&=b \tag{*}\\
% E&=mc^2 + \int_a^a x\, dx
% \end{empheq}
% Maybe not the most impressive example, but as you can see the
% contents of the environment are exactly the same as for the regular
% \env{align*} evironment from \pkg{amsmath}. The rest of the \AmS{}
% environments are chosen the same way by typing the name as the
% mandatory argument of \env{empheq} with the exception of the
% \env{alignat} environment. For this you have to specify the number
% of columns as shown below.
% \begin{verbatim}
% \begin{empheq}{alignat=2}
% a &= b &\quad c &= d \\
% \text{this} &= \text{that} &\quad \mathit{fish}&\neq fish
% \end{empheq}
% \end{verbatim}
% \begin{empheq}{alignat=2}
% a &= b &\quad c &= d \\
% \text{this} &= \text{that} &\quad \mathit{fish}&\neq fish
% \end{empheq}
% To choose the starred version of \env{alignat}, simply type
% \arg{alignat*=2} instead in the above example.
%
% The supported \AmS{} environments are listed in Table
% \vref{tab:environments}. Not supported is the standard \LaTeX{}
% \env{eqnarray} environment as it is fundamentally
% deficient.\footnote{See for instance
% \url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=eqnarray}}
%
% \begin{table}
% \centering
% \begin{tabular}{llll}\toprule
% Environment & Usage & Environment & Usage \\ \midrule
% \TabDescribeAmsKey{equation}
% \TabDescribeAmsKey{align}
% \TabDescribeAmsKey{gather}
% \TabDescribeAmsKey{flalign}
% \TabDescribeAmsKey[=\textrm{\meta{cols}}]{alignat}
% \TabDescribeAmsKey{multline} \bottomrule
% \end{tabular}
% \caption{The supported \pkg{amsmath}
% environments}\label{tab:environments}
% \end{table}
%
%
% \subsection{Markup instructions}
%
% The optional argument of the \env{empheq} environment will take
% markup instructions consisting of a $\meta{key}=\meta{value}$ list
% of assignments. There are currently five such keys (a sixth is
% added for naming consistency). They're shown in Table
% \vref{tab:keys}.
%
% \begin{table}
% \centering
% \begin{tabular}{llp{13em}}\toprule
% Key & Usage & Additional Info \tabularnewline \midrule
% \TabDescribeOptKey{box}{box command}
% \TabDescribeOptKey{innerbox}{box command}
% \TabDescribeOptKey[Use \cs{text}\arg{...} if you need text
% material.]{left}{math material}
% \TabDescribeOptKey[Use \cs{text}\arg{...} if you need text
% material.]{right}{math material}
% \TabDescribeOptKey[Alias for \key{box}.]{outerbox}{box command}
% \TabDescribeOptKey[Contents must be horizontally centered;
% can only be used in \mode{fleqn} mode.]
% {marginbox}{box command}
% \bottomrule
% \end{tabular}
% \caption{The six keys for the optional argument of the
% \env{empheq} environment}\label{tab:keys}
% \end{table}
%
% \begin{codesyntax}
% \SpecialKeyIndex{left}\key{left}
% \end{codesyntax}
% The key \key{left} is for material put on the left side of the
% display. The material is typeset in math mode and centered
% vertically.
% \begin{verbatim}
% \begin{empheq}[left=L\Rightarrow]{align}
% a&=b\\
% E&=mc^2 + \int_a^a x\, dx
% \end{empheq}
% \end{verbatim}
% \begin{empheq}[left=L\Rightarrow]{align}
% a&=b\\
% E&=mc^2 + \int_a^a x\, dx
% \end{empheq}
%
%
% \begin{codesyntax}
% \SpecialKeyIndex{right}\key{right}
% \end{codesyntax}
% As there is a \key{left} key it hopefully comes as no surprise
% that there is a companion \key{right} key for typesetting material
% on the right side of the display.
% \begin{verbatim}
% \begin{empheq}[right=\Leftarrow R]{align}
% a&=b\\
% E&=mc^2 + \int_a^a x\, dx
% \end{empheq}
% \end{verbatim}
% \begin{empheq}[right=\Leftarrow R]{align}
% a&=b\\
% E&=mc^2 + \int_a^a x\, dx
% \end{empheq}
%
% \begin{codesyntax}
% \SpecialKeyIndex{box}\key{box}\\
% \SpecialKeyIndex{outerbox}\key{outerbox}
% \end{codesyntax}
% The key \key{box} specifies the kind of box you would like to put
% around the display. It can be any kind of box, as long as the
% contents of the box are situated on the baseline like in a
% \fbox{\cs{fbox}}.
% \begin{verbatim}
% \begin{empheq}[box=\fbox]{align}
% a&=b\\
% E&=mc^2 + \int_a^a x\, dx
% \end{empheq}
% \end{verbatim}
% \begin{empheq}[box=\fbox]{align}
% a&=b\\
% E&=mc^2 + \int_a^a x\, dx
% \end{empheq}
% The key \key{outerbox} is an alias for \key{box} and is added for
% naming consistency with the key described below.
%
% \begin{codesyntax}
% \SpecialKeyIndex{innerbox}\key{innerbox}
% \end{codesyntax}
% There is also an \key{innerbox} key. It is not very interesting
% unless you use one of the other keys.
% \begin{verbatim}
% \begin{empheq}[innerbox=\fbox,
% left=L\Rightarrow]{align}
% a&=b\\
% E&=mc^2 + \int_a^a x\, dx
% \end{empheq}
% \end{verbatim}
% \begin{empheq}[innerbox=\fbox,
% left=L\Rightarrow]{align}
% a&=b\\
% E&=mc^2 + \int_a^a x\, dx
% \end{empheq}
%
% \begin{codesyntax}
% \SpecialKeyIndex{marginbox}\key{marginbox}
% \end{codesyntax}
% \FeatureRequest{Uwe Siart}{2003/12/08}
% The last key is the \key{marginbox} key. If you typeset your math
% in \mode{fleqn} mode\footnote{Sorry, but I can't show you because
% this manual features centered math displays.} you may want the
% math display and not the outer box to align at the left margin (or
% rather: the indentation). If you make sure the contents of the
% outer box are centered horizontally inside the box, \key{marginbox}
% will align it properly. You shouldn't set both \key{box} and
% \key{marginbox} at the same time, as this is surely not what you
% want and the package will silently use the last one in the list.
%
%
% \begin{quote}
% \textbf{Warning}: \pkg{keyval} treats commas and equal signs as
% separator and assignment signs which in turn means that if you
% want to typeset either of them, they \emph{must}---and believe me,
% it's really important---be enclosed in braces. In short:
% \begin{description}
% \item[{\makebox[3em][l]{Good}}] \texttt{[left=\{(A,B)=(1,0)\}]}
% \item[{\makebox[3em][l]{Bad}}] \texttt{[left=(A,B)=(1,0)]}
% \end{description}
% \end{quote}
%
% \begin{codesyntax}
% \SpecialUsageIndex{\empheqset}\cs{empheqset}\marg{markup instructions}
% \end{codesyntax}
% \FeatureRequest{Uwe Siart}{2004/01/13}
% You can also set the keys globally\footnote{Or rather: outside the
% scope of the \env{empheq} environment. The settings will still
% obey scoping rules.} with the command
% \cs{empheqset}. This means that
% \begin{verbatim}
% \empheqset{marginbox=\psframebox}
% \end{verbatim}
% will force a |box=\psframebox| in all occurrences of the
% \env{empheq} environment, but an explicitly given \key{box} or
% \key{marginbox} will override this setting. You can only use the
% keys listed in this section as arguments to \cs{empheqset}; not
% the \AmS\ environments.
%
%
%
% \subsection{What won't work in the \env{empheq} environment}
%
% \begin{codesyntax}
% \SpecialUsageIndex{intertext}\cs{intertext}\marg{text}\\
% \SpecialUsageIndex{displaybreak}\cs{displaybreak}\oarg{num}
% \end{codesyntax}
% Now we've seen some of the things that work in the \env{empheq}
% environment but we also have to take note of what won't work. As
% this package provides a way to box multi line math displays it can
% come as no surprise that using either \cs{intertext}\footnote{And
% thus also \cs{shortintertext} (\pkg{mathtools}).} or
% \cs{displaybreak} inside the \env{empheq} environment makes no
% sense. Should you however happen to try them anyway, you'll
% experience that \cs{intertext} issues an error message and
% \cs{displaybreak} issues a warning. The reason only \cs{intertext}
% gives an error message is that you'll get output very different
% from what you expect, and that is not the case (so much at least)
% with \cs{displaybreak}. But of course, you'll never see either
% message because you read the manual!
% \begin{codesyntax}
% Very long lines
% \end{codesyntax}
% The standard \AmS\ environments will move the equation number if a
% line gets too close to it. Due to implementation, this feature is
% \emph{not} carried correctly to the \env{empheq} environments, so keep
% equation lines short then applying \env{empheq} to them.
%
% \subsection{Special delimiters}
%
% As you've seen a few pages back, it's possible to add material on
% both sides of the math display. When doing so you often need a
% delimiter that scales to fit the entire display, so it comes as no
% surprise that \pkg{empheq} provides such delimiters.
% \begin{codesyntax}
% \cs{empheql}\meta{delim_name} \cs{empheqbigl}\meta{delim_name}\\
% \cs{empheqr}\meta{delim_name} \cs{empheqbigr}\meta{delim_name}
% \end{codesyntax}
% For example one might need a large brace like the one in the
% \env{cases} environment:
% \begin{verbatim}
% \begin{empheq}[left=\empheqlbrace, right=\empheqrbrace]{align}
% E&=mc^2 \\
% Y&= \sum_{n=1}^\infty \frac{1}{n^2}
% \end{empheq}
% \end{verbatim}
% \begin{empheq}[left=\empheqlbrace, right=\empheqrbrace]{align}
% E&=mc^2 \\
% Y&= \sum_{n=1}^\infty \frac{1}{n^2}
% \end{empheq}
% The naming scheme is \cs{empheq}\meta{delimiter name} and
% \cs{empheqbig}\meta{delimiter name}. Thus \cs{empheqrbrace}
% produces an auto-scaling right brace with same size as the math
% display while \cs{empheqbigrbrace} produces an even bigger version
% that spans the inner box plus the math display inside it. For a
% complete list of supported delimiters see Table
% \vref{tab:delimiters}.
%
% \begin{table}
% \centering
% \begin{tabular}{lllc} \toprule
% \multicolumn{3}{c}{\textbf{Delimiter}}\\ \cmidrule{1-3}
% \multicolumn{1}{c}{Original} & \multicolumn{1}{c}{Normal} &
% \multicolumn{1}{c}{Bigger} & Symbol\\ \midrule
% \DescribeDelimiter{lbrace} \DescribeDelimiter{rbrace}
% \DescribeDelimiter{lbrack} \DescribeDelimiter{rbrack} \midrule
% \DescribeDelimiter{langle} \DescribeDelimiter{rangle}
% \DescribeDelimiter{lparen} \DescribeDelimiter{rparen} \midrule
% \DescribeDelimiter{lvert} \DescribeDelimiter{rvert}
% \DescribeDelimiter{lVert} \DescribeDelimiter{rVert} \midrule
% \DescribeDelimiter{lfloor} \DescribeDelimiter{rfloor}
% \DescribeDelimiter{lceil} \DescribeDelimiter{rceil} \bottomrule
% \end{tabular}
% \caption{The supported auto-scaling delimiters in
% \pkg{empheq}}\label{tab:delimiters}
% \end{table}
%
%
%
% \section{Taking things a little further}
%
% So far we have covered the basic functions of \pkg{empheq}: the
% markup instructions and the predefined auto-scaling delimiters.
% There is more to \pkg{empheq} however, and we'll cover that in
% this section.
%
% \subsection{Loading the package}
%
% The package has two main requirements: One is the
% \pkg{mathtools}\footnote{By the same author and is distributed
% with \pkg{empheq}. See its documentation for more information.}
% package which provides \pkg{empheq} with a lot of necessary tools
% for doing its thing. The other one is \pkg{amsmath} of course, and
% to make the loading procedure as easy as possible, you can simply
% substitute
% \begin{verbatim}
% \usepackage[leqno,fleqn,intlimits]{amsmath}
% \end{verbatim}
% with
% \begin{verbatim}
% \usepackage[leqno,fleqn,intlimits]{empheq}
% \end{verbatim}
% \pkg{empheq} makes sure that the \pkg{amsmath} options are passed
% on and loaded by \pkg{amsmath}. The same goes for the options
% provided by \pkg{mathtools}.
%
%
% \subsubsection{Compatibility with the old version}
%
% The current version (\fileversion) of \pkg{empheq} is incompatible with
% versions prior to and including~0.7e. If you have documents produced
% with versions prior to~0.7e, then you have to load the package
% \pkg{empheq07} instead. \pkg{empheq07} now exists as a separate package
% with its own documentation, but I strongly recommend switching
% to the new version because it is so much better.
%
% \subsection{Package options}
%
% In addition to the \pkg{amsmath} options, \pkg{empheq} itself
% provides a string of options listed in Table \vref{tab:options}.
%
% \begin{table}[ht]
% \centering
% \begin{tabular}{lp{21em}} \toprule
% Option & Short description \tabularnewline \midrule
% \TabDescribeOption[]{overload}
% {Lets you use the \pkg{empheq} visual markup extensions
% transparently in an existing document.}
% \TabDescribeOption[]{overload2}
% {A wild version of \opt{overload}. Use with care.}
% \TabDescribeOption[]{ntheorem}
% {A support module for users of \pkg{ntheorem} and its
% \opt{thmmarks} and \opt{thref} options.}
% \TabDescribeOption[]{newmultline}
% {With v2.10 of \pkg{empheq} the syntax for \env{multline} and
% \env{multlined} has been improved immensely.}
% \TabDescribeOption[]{oldmultline}
% {Support for the somewhat strange syntax for \env{multline} and
% \env{multlined} in v2.00.}
% \bottomrule
% \end{tabular}
% \caption{Supported options in the \pkg{empheq} package}
% \label{tab:options}
% \end{table}
%
%
% \begin{codesyntax}
% \SpecialOptIndex{ntheorem}\opt{ntheorem}
% \end{codesyntax}
% The \pkg{ntheorem} package is supported by means of the
% \opt{ntheorem} option. In order for this to work properly, an
% \pkg{amsmath} bug\footnote{See the \LaTeX{} Bugs Database
% \url{http://www.latex-project.org/cgi-bin/ltxbugs2html} under
% \AmS-\LaTeX{} problem report 3624.} is fixed. For more information
% on this option see \S \vref{sec:ntheorem-support}.
%
% \subsubsection{Using \env{multline}}
%
% \begin{codesyntax}
% \SpecialOptIndex{newmultline}\opt{newmultline}\\
% \SpecialOptIndex{oldmultline}\opt{oldmultline}
% \end{codesyntax}
% Those familiar with v2.00 of this package will recognize the
% somewhat weird syntax for using \env{multline} and
% \env{multlined}. The good news is that since v2.10 there is now a
% much improved syntax available. The option \opt{newmultline}
% (default) selects this better interface, while the old interface
% is provided for compatibility reasons by the \opt{oldmultline}
% option.
%
%
% \begin{codesyntax}
% \SpecialUsageIndex{\shoveleft}\cs{shoveleft}\oarg{dimen}\marg{arg}\\
% \SpecialUsageIndex{\shoveright}\cs{shoveright}\oarg{dimen}\marg{arg}
% \end{codesyntax}
% With the new interface you also get an extended syntax for
% \cs{shoveleft} and \cs{shoveright} as shown in the example below.
% \begin{verbatim}
% \begin{empheq}{multline}
% \framebox[.65\columnwidth]{First line} \\
% \framebox[.5\columnwidth]{Second line} \\
% \shoveleft{L+E+F+T} \\
% \shoveright{R+I+G+H+T} \\
% \shoveleft[1cm]{L+E+F+T} \\
% \shoveright[\widthof{$R+I+G+H+T$}]{R+I+G+H+T} \\
% \framebox[.65\columnwidth]{Last line}
% \end{empheq}
% \end{verbatim}
% \begin{empheq}{multline}
% \framebox[.65\columnwidth]{First line} \\
% \framebox[.5\columnwidth]{Second line} \\
% \shoveleft{L+E+F+T} \\
% \shoveright{R+I+G+H+T} \\
% \shoveleft[1cm]{L+E+F+T} \\
% \shoveright[\widthof{$R+I+G+H+T$}]{R+I+G+H+T} \\
% \framebox[.65\columnwidth]{Last line}
% \end{empheq}
%
%
% There are however a few differences in the output between the
% original \pkg{amsmath} version of \env{multline} and the one
% \pkg{empheq} provides. In \pkg{amsmath} a centered line in
% \env{multline} is centered on the page without taking into account
% the \cs{multlinegap}, \cs{multlinetaggap}, and the tag width. Thus
% \pkg{amsmath} can sometimes give you horrible output without
% giving you any warning as shown below.
% \begin{verbatim}
% \begin{multline}
% \framebox[.65\columnwidth]{First line} \\
% \framebox[.9\columnwidth]{Loooong line} \\
% \framebox[.65\columnwidth]{Last line} \tag{wide tag}
% \end{multline}
% \end{verbatim}
% \begin{AmSmultline}
% \framebox[.65\columnwidth]{First line} \\
% \framebox[.9\columnwidth]{Loooong line} \\
% \framebox[.65\columnwidth]{Last line} \tag{wide tag}
% \end{AmSmultline}
% In \pkg{empheq} these parameters are taken into account, so the
% same input will produce this in \pkg{empheq}:
% \begin{verbatim}
% \begin{empheq}{multline}
% \framebox[.65\columnwidth]{First line} \\
% \framebox[.9\columnwidth]{Loooong line} \\
% \framebox[.65\columnwidth]{Last line} \tag{wide tag}
% \end{empheq}
% \end{verbatim}
% \begin{multline*}
% \framebox[.65\columnwidth]{First line} \\
% \framebox[.9\columnwidth]{Loooong line} \\
% \framebox[.65\columnwidth]{Last line} \tag{wide tag}
% \end{multline*}
% This results in an
% \begin{verbatim}
% Overfull \hbox (30.03783pt too wide) in paragraph ...
% \end{verbatim}
% message in the log file, indicating a visual problem. I think this
% behavior is more sensible than the one the original \env{multline}
% environment provides.
%
% \begin{codesyntax}
% \SpecialEnvIndex{MTmultlined}\cs{begin}\arg{MTmultlined}\oarg{pos}\oarg{width}
% \meta{contents} \cs{end}\arg{MTmultlined}
% \end{codesyntax}
% When you choose the \opt{oldmultline} option you may still want to
% use the much improved \env{multlined} environment defined in
% \pkg{mathtools} but unfortunately there will be a name clash.
% Instead you can access it under the name \env{MTmultlined}.
%
%
%
% \subsubsection{The \opt{overload} option}\label{sec:overload}
%
% \begin{codesyntax}
% \SpecialOptIndex{overload}\opt{overload}\\
% \SpecialOptIndex{overload2}\opt{overload2}
% \end{codesyntax}
% \FeatureRequest{Lars Madsen}{2004/03/25}
% The \opt{overload} option redefines the original \AmS{}
% environments so that they take an optional argument.
% \begin{codesyntax}
% \cs{begin}\marg{\AmS{} env_name}\oarg{markup instructions}\\
% \meta{contents of \AmS{} environment}\\
% \cs{end}\marg{\AmS{} env_name}
% \end{codesyntax}
% For example
% \begin{verbatim}
% \begin{gather}[box=\widefbox]
% a = b
% \end{gather}
% \end{verbatim}
% is then actually short for
% \begin{verbatim}
% \begin{empheq}[box=\widefbox]{gather}
% a = b
% \end{empheq}
% \end{verbatim}
% All the \AmS{} environments are supported by this option except
% for the pseudo environment |\[ ... \]| (it's not really an
% environment), \footnote{With the option \opt{oldmultline} the
% \env{multline} and \env{multline*} environments aren't supported
% either because their syntax in \pkg{empheq} then differs from their
% syntax in \pkg{amsmath}.} because a)~you don't really need markup
% instructions for a one line display, and b)~would you really like
% a syntax like
% \begin{verbatim}
% \[[box=\fbox] a=b \]
% \end{verbatim}
% where it's difficult to see whether or not there is a typo?
% Choosing \opt{overload} is meant for people who don't want to
% change their entire document into \pkg{empheq} syntax. I have no
% problems with that; just be careful when you fiddle with
% \cs{empheqset} as it will affect \emph{all} math displays!
%
%
% There is of course a catch (well, two actually): These redefined
% environments don't run as fast as the regular ones (about three
% times as slow), but in this day and age I seriously doubt you'll
% be able to tell the difference unless you have a vast number of
% equations. The other catch is that you cannot use \cs{intertext}
% and \cs{displaybreak} as described earlier. If you find yourself
% wanting to use one of these features in say, an \env{align}
% environment, you have to use the original \env{align} environment.
% Luckily it is available if you call it like this:
% \begin{codesyntax}
% \cs{begin}\arg{AmS\meta{\rmfamily \AmS{} env_name}} \\
% \texttt{~~}\meta{contents of \AmS{} environment}\\
% \cs{end}\arg{AmS\meta{\rmfamily \AmS{} env_name}}
% \end{codesyntax}
% For example the original \env{align} environment could be selected
% with
% \begin{verbatim}
% \begin{AmSalign}
% ...
% \end{AmSalign}
% \end{verbatim}
% These original versions with prefix \texttt{AmS} exist for all the
% environments.
%
%
% The option \opt{overload2} activates the overloading feature
% for the pseudo environment |\[ ... \]|, although I doubt you'll
% find it useful. Beware that this definition is fragile unless you
% have \eTeX{} as \LaTeX{} engine.\footnote{\eTeX{} has been the
% default engine for \LaTeX{} in most major distributions since
% 2003.} Not surprisingly \opt{overload2} activates
% \opt{overload}.
%
%
%
% Before you get all excited about these options, you should take
% note of some aspects of centered math displays in \pkg{amsmath}.
% In certain circumstances truly centering the display is not always
% the best solution as in this example:
% \begin{center}
% \mbox{}\hfill
% \framebox[.75\linewidth]{Wide math display; not adjusted}%
% \hfill\mbox{}%
% \makebox[0pt][r]{Wide Tag}
% \end{center}