summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/akktex/akkconditional.sty
blob: f7fdf38ae5f8f9ca8ff5c504cffbee68c26e0696 (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
%=====================================================================================================================================
% Package akkconditional by Igor Akkerman (c) 2004, 2005
% Package providing utilities for handling conditionals.
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License (latest version).
%
% The latest version of this license can be found at
%     http://www.latex-project.org/lppl.txt
%
% This file may only be distributed together with the full 'AkkTeX' bundle.
%=====================================================================================================================================
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{akkconditional}[2005/04/30 1.1.1 by Igor Akkerman (c) 2004, 2005 Package providing utilities for handling conditionals.]
%=====================================================================================================================================

\RequirePackage{ifthen}
%------------------------------------------------------------------------------

\newcommand \setnewboolean[2] {\newboolean{#1}\setboolean{#1}{#2}}

\newcommand \ifthen[2]        {\ifthenelse{#1}{#2}{}}
\newcommand \ifelse[2]        {\ifthenelse{#1}{}{#2}}
\newcommand \ifbool[3]        {\ifthenelse{\boolean{#1}}{#2}{#3}}
\newcommand \ifbooltrue[2]    {\ifthen{\boolean{#1}}{#2}}
\newcommand \ifboolfalse[2]   {\ifelse{\boolean{#1}}{#2}}

%--------------------------
% \ifset[<unsetstring>]{<expression>}{<code>}
% Executes <code> if <expression> is not <unsetstring>; does nothing otherwise.
% {<unsetstring> defaults to the empty string}
%--------------------------
% \ifthenelseset[<unsetstring>]{<expression>}{<thencode>}{<elsecode>}
% Executes <thencode> if <expression> is not <unsetstring>; <elsecode> otherwise.
% {<unsetstring> defaults to the empty string}
%--------------------------
\newcommand \ifset[3][]         {\ifelse{\equal{#2}{#1}}{#3}}
\newcommand \ifthenelseset[4][] {\ifthenelse{\equal{#2}{#1}}{#4}{#3}}
%--------------------------