summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/misc/ifthenpl.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex209/contrib/misc/ifthenpl.sty
Initial commit
Diffstat (limited to 'macros/latex209/contrib/misc/ifthenpl.sty')
-rw-r--r--macros/latex209/contrib/misc/ifthenpl.sty22
1 files changed, 22 insertions, 0 deletions
diff --git a/macros/latex209/contrib/misc/ifthenpl.sty b/macros/latex209/contrib/misc/ifthenpl.sty
new file mode 100644
index 0000000000..c7092375a3
--- /dev/null
+++ b/macros/latex209/contrib/misc/ifthenpl.sty
@@ -0,0 +1,22 @@
+%
+% small extension for ifthen style -- TeX \newif's
+%
+% e.g., \ifthen{\boolean{@twoside}}{}{}
+%
+\def\boolean#1{1=1\fi\noexpand\csname if#1\endcsname\def\noexpand\@tempa{1=1}%
+\else\def\noexpand\@tempa{1=0}\fi\ifnum\noexpand\@tempa}
+%
+%
+%
+% \ifthenelse{\dimenequal{10pt}{20pt}}{}{} like #1 = #2
+% \ifthenelse{\dimenless{10pt}{20pt}}{}{} like #1 < #2
+% \ifthenelse{\dimengreater{10pt}{20pt}}{}{} like #1 > #2
+%
+\def\dimenequal#1#2{1=1\fi\noexpand\ifdim #1=#2 \def\noexpand\@tempa{1=1}
+\else\def\noexpand\@tempa{1=0}\fi\ifnum\noexpand\@tempa}
+%
+\def\dimenless#1#2{1=1\fi\noexpand\ifdim #1<#2 \def\noexpand\@tempa{1=1}
+\else\def\noexpand\@tempa{1=0}\fi\ifnum\noexpand\@tempa}
+%
+\def\dimengreater#1#2{1=1\fi\noexpand\ifdim #1>#2 \def\noexpand\@tempa{1=1}
+\else\def\noexpand\@tempa{1=0}\fi\ifnum\noexpand\@tempa}