summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/hybrid-latex/latex/pymacros.sty
blob: 5d63bb8b321b17939bd1de8f1f220ec32863fe3c (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
\font\@displayfont=pzdr at 10pt
% \providecommand*{\@None}{\hbox{\@displayfont\char'067}}% 067 = light cross, 070 = bold cross
\providecommand*{\@None}{\hbox{(??)}}
% ---------------------------------------------------------------------
\providecommand*{\colonEq}{\mathrel{\vcenter{\baselineskip0.5ex\lineskiplimit0pt\hbox{.}\hbox{.}}}=}% centred colon
\providecommand*{\pytag}[2]{\expandafter\def\csname py@#1\endcsname{#2}}
% ---------------------------------------------------------------------
\providecommand*{\py}{\@ifstar\@py\@@py}
\providecommand*{\@py}[1]{\ttTag{#1}\colonEq\py{#1}}% places tag immediately to the left
\providecommand*{\@@py}[1]{\@ifundefined{py@#1}{\@None}{\csname py@#1\endcsname}}% shows just the value, nothing else
% ---------------------------------------------------------------------
\providecommand*{\Py}{\@ifstar\@Py\@@Py}
\providecommand*{\@Py}[2][\hfill]{\py{#2}\def\@currentlabel{#2}#1\llap{(\ttTag{#2})}}% for use in dmath* etc.
\providecommand*{\@@Py}[1]{\py{#1}\tag{\ttTag{#1}}}% for use in align* etc.
% ---------------------------------------------------------------------
\providecommand*{\Dmath}{\@ifstar\@Dmath\@@Dmath}
\providecommand*{\@Dmath}[2][]{\begin{dmath*}[#1]#2\end{dmath*}}%
\providecommand*{\@@Dmath}[2][]{\begin{dmath}[#1]#2\end{dmath}}%
% ---------------------------------------------------------------------
\providecommand*{\ttTag}[1]{\hbox{\small\tt\detokenize{#1}}}
\providecommand*{\pglabel}[1]{\phantomsection\label{#1}}% fixes a problem with hyperref and label
% see https://tex.stackexchange.com/questions/193380/hyperref-pageref-links-point-to-first-page
% ---------------------------------------------------------------------
\let\Input=\input