summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/misc/ifthen-addi.sty
blob: c7092375a3cf86cda55061a5dcc29128d535f1aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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}