Skip to content

Commit

Permalink
Drop \ifthenelse (plk#1348)
Browse files Browse the repository at this point in the history
  • Loading branch information
moewew committed Mar 24, 2024
1 parent 4175cbe commit 2bf42f7
Show file tree
Hide file tree
Showing 21 changed files with 100 additions and 71 deletions.
5 changes: 3 additions & 2 deletions tex/latex/biblatex/cbx/alphabetic.cbx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

\newbibmacro*{textcite:postnote}{%
\usebibmacro{postnote}%
\ifthenelse{\value{multicitecount}=\value{multicitetotal}}
\ifnumequal{\value{multicitecount}}{\value{multicitetotal}}
{\setunit{}%
\printtext{%
\ifbool{cbx:parens}
Expand Down Expand Up @@ -109,7 +109,8 @@
\pagetrackerfalse%
\DeferNextCitekeyHook%
\usebibmacro{textcite:init}}
{\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0}
{\ifboolexpr{test {\iffirstcitekey}
and test {\ifnumgreater{\value{multicitetotal}}{0}}}
{\protected@xappto\cbx@savedcites{()(\thefield{multipostnote})}%
\global\clearfield{multipostnote}}
{}%
Expand Down
5 changes: 3 additions & 2 deletions tex/latex/biblatex/cbx/authortitle-comp.cbx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
\printdelim{extpostnotedelim}\bibopenparen}}
{\setunit{\printdelim{postnotedelim}}}%
\printfield{postnote}%
\ifthenelse{\value{multicitecount}=\value{multicitetotal}}
\ifnumequal{\value{multicitecount}}{\value{multicitetotal}}
{\setunit{}%
\printtext{%
\ifbool{cbx:parens}
Expand Down Expand Up @@ -154,7 +154,8 @@
\pagetrackerfalse%
\DeferNextCitekeyHook%
\usebibmacro{cite:init}}
{\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0}
{\ifboolexpr{test {\iffirstcitekey}
and test {\ifnumgreater{\value{multicitetotal}}{0}}}
{\protected@xappto\cbx@savedcites{()(\thefield{multipostnote})}%
\global\clearfield{multipostnote}}
{}%
Expand Down
8 changes: 4 additions & 4 deletions tex/latex/biblatex/cbx/authortitle-ibid.cbx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
\newbibmacro*{cite}{%
\global\boolfalse{cbx:loccit}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\printnames{labelname}%
\setunit*{\printdelim{nametitledelim}}%
Expand All @@ -28,7 +28,7 @@
\newbibmacro*{citetitle}{%
\global\boolfalse{cbx:loccit}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\usebibmacro{cite:title}}}%
{\usebibmacro{cite:shorthand}}}
Expand All @@ -43,7 +43,7 @@
{\usebibmacro{prenote}}
{}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\usebibmacro{cite:title}}}%
{\usebibmacro{cite:shorthand}}}
Expand All @@ -67,7 +67,7 @@
{\usebibmacro{postnote}}}

\newbibmacro*{textcite:postnote}{%
\ifthenelse{\iffieldundef{postnote}\OR\boolean{cbx:loccit}}
\ifboolexpr{test {\iffieldundef{postnote}} or bool {cbx:loccit}}
{\ifbool{cbx:parens}
{\bibcloseparen}
{}}
Expand Down
11 changes: 6 additions & 5 deletions tex/latex/biblatex/cbx/authortitle-icomp.cbx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

\newbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\iffieldequals{namehash}{\cbx@lasthash}
{\setunit{\compcitedelim}}
Expand All @@ -46,7 +46,7 @@

\newbibmacro*{citetitle}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\usebibmacro{cite:title}}}%
{\usebibmacro{cite:shorthand}}%
Expand All @@ -65,7 +65,7 @@
{\usebibmacro{prenote}}
{}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\usebibmacro{cite:title}}}%
{\usebibmacro{cite:shorthand}}%
Expand Down Expand Up @@ -102,7 +102,7 @@
\printdelim{extpostnotedelim}\bibopenparen}}
{\setunit{\printdelim{postnotedelim}}}%
\printfield{postnote}}%
\ifthenelse{\value{multicitecount}=\value{multicitetotal}}
\ifnumequal{\value{multicitecount}}{\value{multicitetotal}}
{\setunit{}%
\printtext{%
\ifbool{cbx:parens}
Expand Down Expand Up @@ -183,7 +183,8 @@
\pagetrackerfalse%
\DeferNextCitekeyHook%
\usebibmacro{cite:init}}
{\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0}
{\ifboolexpr{test {\iffirstcitekey}
and test {\ifnumgreater{\value{multicitetotal}}{0}}}
{\protected@xappto\cbx@savedcites{()(\thefield{multipostnote})}%
\global\clearfield{multipostnote}}
{}%
Expand Down
8 changes: 5 additions & 3 deletions tex/latex/biblatex/cbx/authortitle-tcomp.cbx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@
\iffieldundef{shorthand}
{\usebibmacro{cite:title}}%
{\usebibmacro{cite:shorthand}}}
{\ifthenelse{\ifsingletitle\AND
\(\iffieldundef{prenote}\OR\value{citecount}>1\)}
{\ifboolexpr{test {\ifsingletitle}
and
(test{\iffieldundef{prenote}}
or test {\ifnumgreater{\value{citecount}}{1})}
{\printtext[bibhyperref]{\printnames{labelname}}}
{\printnames{labelname}
\setunit{%
Expand All @@ -75,7 +77,7 @@
\global\booltrue{cbx:parens}%
\printdelim{extpostnotedelim}\bibopenparen}}%
\printfield{postnote}%
\ifthenelse{\value{multicitecount}=\value{multicitetotal}}
\ifnumequal{\value{multicitecount}}{\value{multicitetotal}}
{\setunit{}%
\printtext{%
\ifbool{cbx:parens}
Expand Down
6 changes: 4 additions & 2 deletions tex/latex/biblatex/cbx/authortitle-terse.cbx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
\iffieldundef{shorthand}
{\usebibmacro{cite:title}}%
{\usebibmacro{cite:shorthand}}}
{\ifthenelse{\ifsingletitle\AND
\(\iffieldundef{prenote}\OR\value{citecount}>1\)}
{\ifboolexpr{test {\ifsingletitle}
and
(test{\iffieldundef{prenote}}
or test {\ifnumgreater{\value{citecount}}{1})}
{\printtext[bibhyperref]{\printnames{labelname}}}
{\printnames{labelname}%
\setunit{%
Expand Down
18 changes: 10 additions & 8 deletions tex/latex/biblatex/cbx/authortitle-ticomp.cbx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\iffieldequals{namehash}{\cbx@lasthash}
{\setunit{\compcitedelim}%
Expand All @@ -28,7 +28,7 @@

\renewbibmacro*{citetitle}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\iffieldequals{namehash}{\cbx@lasthash}
{\setunit{\compcitedelim}}
Expand All @@ -42,7 +42,7 @@
\iffieldequals{namehash}{\cbx@lasthash}
{\setunit{\compcitedelim}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\usebibmacro{cite:title}}}%
{\usebibmacro{cite:shorthand}}}
Expand All @@ -51,12 +51,14 @@
{\usebibmacro{prenote}}
{}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\usebibmacro{cite:title}}}%
{\usebibmacro{cite:shorthand}}}
{\ifthenelse{\ifsingletitle\AND
\(\iffieldundef{prenote}\OR\value{citecount}>1\)}
{\ifboolexpr{test {\ifsingletitle}
and
(test{\iffieldundef{prenote}}
or test {\ifnumgreater{\value{citecount}}{1})}
{\printtext[bibhyperref]{\printnames{labelname}}}
{\printnames{labelname}
\setunit{%
Expand All @@ -66,7 +68,7 @@
{\usebibmacro{prenote}}
{}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\usebibmacro{cite:title}}}%
{\usebibmacro{cite:shorthand}}}}%
Expand All @@ -85,7 +87,7 @@
\global\booltrue{cbx:parens}%
\printdelim{extpostnotedelim}\bibopenparen}}%
\printfield{postnote}%
\ifthenelse{\value{multicitecount}=\value{multicitetotal}}
\ifnumequal{\value{multicitecount}}{\value{multicitetotal}}
{\setunit{}%
\printtext{%
\ifbool{cbx:parens}
Expand Down
23 changes: 14 additions & 9 deletions tex/latex/biblatex/cbx/authoryear-comp.cbx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@

\newbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\ifboolexpr{test {\ifnameundef{labelname}}
or test {\iffieldundef{labelyear}}}
{\usebibmacro{cite:label}%
\setunit{\printdelim{nonameyeardelim}}%
\usebibmacro{cite:labeldate+extradate}%
\usebibmacro{cite:reinit}}
{\iffieldequals{namehash}{\cbx@lasthash}
{\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
\(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
{\ifboolexpr{test {\iffieldequals{labelyear}{\cbx@lastyear}}
and (test {\ifnumequal{\value{multicitecount}}{0}}
or test {\iffieldundef{postnote}})}
{\setunit{\addcomma}%
\usebibmacro{cite:extradate}}
{\setunit{\compcitedelim}%
Expand All @@ -53,8 +55,9 @@
{\usebibmacro{cite:label}%
\usebibmacro{cite:reinit}}
{\iffieldequals{namehash}{\cbx@lasthash}
{\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
\(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
{\ifboolexpr{test {\iffieldequals{labelyear}{\cbx@lastyear}}
and (test {\ifnumequal{\value{multicitecount}}{0}}
or test {\iffieldundef{postnote}})}
{\setunit{\addcomma}%
\usebibmacro{cite:extradate}}
{\setunit{\compcitedelim}%
Expand All @@ -70,8 +73,9 @@
\newbibmacro*{textcite}{%
\iffieldequals{namehash}{\cbx@lasthash}
{\iffieldundef{shorthand}
{\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
\(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
{\ifboolexpr{test {\iffieldequals{labelyear}{\cbx@lastyear}}
and (test {\ifnumequal{\value{multicitecount}}{0}}
or test {\iffieldundef{postnote}})}
{\setunit{\addcomma}%
\usebibmacro{cite:extradate}}
{\setunit{\compcitedelim}%
Expand Down Expand Up @@ -145,7 +149,7 @@

\newbibmacro*{textcite:postnote}{%
\usebibmacro{postnote}%
\ifthenelse{\value{multicitecount}=\value{multicitetotal}}
\ifnumequal{\value{multicitecount}}{\value{multicitetotal}}
{\setunit{}%
\printtext{%
\ifbool{cbx:parens}
Expand Down Expand Up @@ -226,7 +230,8 @@
\pagetrackerfalse%
\DeferNextCitekeyHook%
\usebibmacro{cite:init}}
{\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0}
{\ifboolexpr{test {\iffirstcitekey}
and test {\ifnumgreater{\value{multicitetotal}}{0}}
{\protected@xappto\cbx@savedcites{()(\thefield{multipostnote})}%
\global\clearfield{multipostnote}}
{}%
Expand Down
11 changes: 6 additions & 5 deletions tex/latex/biblatex/cbx/authoryear-ibid.cbx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
\newbibmacro*{cite}{%
\global\boolfalse{cbx:loccit}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\ifboolexpr{test {\ifnameundef{labelname}}
or test {\iffieldundef{labelyear}}}
{\usebibmacro{cite:label}%
\setunit{\printdelim{nonameyeardelim}}}
{\printnames{labelname}%
Expand All @@ -31,7 +32,7 @@
\newbibmacro*{citeyear}{%
\global\boolfalse{cbx:loccit}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\iffieldundef{labelyear}
{\usebibmacro{cite:label}}
Expand Down Expand Up @@ -59,7 +60,7 @@
{\usebibmacro{prenote}}
{}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\ifboolexpr{test {\ifciteibid} and not test {\iffirstonpage}}
{\usebibmacro{cite:ibid}}
{\iffieldundef{labelyear}
{\usebibmacro{cite:label}}
Expand Down Expand Up @@ -97,7 +98,7 @@
{\usebibmacro{postnote}}}

\newbibmacro*{textcite:postnote}{%
\ifthenelse{\iffieldundef{postnote}\OR\boolean{cbx:loccit}}
\ifboolexpr{test {\iffieldundef{postnote}} or bool {cbx:loccit}}
{\ifbool{cbx:parens}
{\bibcloseparen}
{}}
Expand Down
Loading

0 comments on commit 2bf42f7

Please sign in to comment.