summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/simurgh/simurgh-empheq.sty
blob: 00a8fbbc96e646d04f251d6fad003392706d2be2 (plain)
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{simurgh-empheq}[2013/09/22 v0.01b changes to `empheq.sty']
\MHInternalSyntaxOn
\def\EQ_post_process:{%
  \EQ_initialize:
  \EQ_begin_equation:
  \MH_if_boolean:nT {outer_mult}{
    \setkeys{\MT_options_name:}{
      firstline-afterskip=0pt,
      lastline-preskip=0pt,
      multlined-width=0pt,
    }
    \ifodd \l_EQ_alignmentmode_int
      \setkeys{\MT_options_name:}{multlined-pos=b}
    \else:
      \setkeys{\MT_options_name:}{multlined-pos=t}
    \fi:
      \g@addto@macro\EQ_complete_mathdisplay:{
        \begin{MTmultlined}\relax}
  }
  \g@addto@macro\EQ_complete_mathdisplay:\EQ_mathbody:
  \MH_if_boolean:nT {outer_mult}{
    \g@addto@macro\EQ_complete_mathdisplay:{\end{MTmultlined}}
  }
  \EQ_end_equation:
  \edef\EQ_hyperref_link_fint{\number\Hy@linkcounter}
  \savecounters@
  \EQ_typeset_tags:
  \edef\l_EQ_equation_fint{\number\c@equation}
  \restorecounters@
  \Hy@linkcounter=\EQ_hyperref_link_fint
  \settowidth\l_EQ_totalwidth_dim{%
    $\EQ_left_side:\EQ_innerbox:{}\EQ_right_side:$}%
  \MH_if_boolean:nTF {outer_mult}
    { \def\EQ_next:{_mult} }
    { \def\EQ_next:{} }
  \@nameuse{EQ_modify_linewidth_
            \romannumeral\l_EQ_equationtype_int\EQ_next: :}%
  \EQ_typeset_display:
  \@nameuse{find_displaywidth_
           \romannumeral\l_EQ_equationtype_int\EQ_next: :}
  \MH_addtolength:dn
    \l_EQ_totalwidth_dim{\l_EQ_displaywidth_dim}
  \savebox\EQ_mathdisplay_box[\l_EQ_totalwidth_dim][c]{%
    $\EQ_left_side:
    \EQ_innerbox:{%
      \if_case:w \l_EQ_alignmentmode_int\or:
        \makebox[\l_EQ_displaywidth_dim][c]
          {\usebox{\EQ_mathdisplay_box}}%
      \or:
        \makebox[\l_EQ_displaywidth_dim][c]
          {\usebox{\EQ_mathdisplay_box}}%
      \or:
        \if@RTL\makebox[\l_EQ_displaywidth_dim][r]{%op
          \if_num:w \l_EQ_equationtype_int=5 \else:
            \if_num:w \l_EQ_equationtype_int=6 \else:
              \kern-\@mathmargin
            \fi:
          \fi:
          \usebox{\EQ_mathdisplay_box}}\else%
          \makebox[\l_EQ_displaywidth_dim][l]{%op
          \if_num:w \l_EQ_equationtype_int=5 \else:
            \if_num:w \l_EQ_equationtype_int=6 \else:
              \kern-\@mathmargin
            \fi:
          \fi:
          \usebox{\EQ_mathdisplay_box}}\fi%
      \or:
        \if@RTL\makebox[\l_EQ_displaywidth_dim][r]{%
          \if_num:w \l_EQ_equationtype_int=5 \else:
            \if_num:w \l_EQ_equationtype_int=6 \else:
              \kern-\@mathmargin
            \fi:
          \fi:
          \usebox{\EQ_mathdisplay_box}}\else%
          \makebox[\l_EQ_displaywidth_dim][l]{%
          \if_num:w \l_EQ_equationtype_int=5 \else:
            \if_num:w \l_EQ_equationtype_int=6 \else:
              \kern-\@mathmargin
            \fi:
          \fi:
          \usebox{\EQ_mathdisplay_box}}\fi%
      \fi:}%
    \EQ_right_side:$}%
  \begin{AmSequation*}
  \@nameuse{EQ_place_display_
           \romannumeral\l_EQ_equationtype_int\EQ_next: :}
  \if_dim:w \g_EQ_widesttag_dim>\z@
  \MH_set_boolean_T:n {show_manual_tags}
    \if_case:w \l_EQ_alignmentmode_int
    \or: \EQ_place_tag:N r %#1
    \or: \EQ_place_tag:N l %#2
    \or: \EQ_place_tag:N r %#3
    \or: \EQ_place_tag:N l %#4
    \fi:
  \fi:
  \end{AmSequation*}
  \global\c@equation=\l_EQ_equation_fint\relax
}
\AtBeginDocument{%
  \@ifpackageloaded{fancybox}{%
    \@ifpackageloaded{color}{\definecolor{shadowcolor}{rgb}{0,0,0}}%
    {\renewcommand*\textcolor[2]{\normalcolor{#2}}}%
    \renewcommand*\shadowbox{%
      \@ifstar{\MH_set_boolean_T:n {shadowbox_star}
               \VerbBox\EQ_shadowbox:n}
              {\MH_set_boolean_F:n {shadowbox_star}
               \VerbBox\EQ_shadowbox:n}}
    \def\EQ_shadowbox:n #1{%
      \sbox{\z@}{\fbox{#1}}%
      \MH_if_boolean:nTF {shadowbox_star}{
        \MH_setlength:dn \@tempdima{\z@}%
      }{
        \MH_setlength:dn \@tempdima{\dp\z@+\shadowsize}%
      }
      \raisebox{\@tempdima}{%
        \if@RTL\makebox[\z@][r]{%
          \kern\shadowsize \textcolor{shadowcolor}{%
            \rule[-\dp\z@-\shadowsize]{\wd\z@}{\shadowsize}}%
        }%
        \else\makebox[\z@][l]{%
          \kern\shadowsize \textcolor{shadowcolor}{%
            \rule[-\dp\z@-\shadowsize]{\wd\z@}{\shadowsize}}%
        }\fi%
        \usebox\z@\textcolor{shadowcolor}{%
          \rule[-\dp\z@-\shadowsize]{\shadowsize}{\ht\z@+\dp\z@}}}}%
  }{}%
}
\MHInternalSyntaxOff


\endinput