From 7861879d3e5c051b1d2f2a3318b028c5a3a159aa Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 3 Jul 2021 21:05:14 +0000 Subject: ifallfalse (3jul21) git-svn-id: svn://tug.org/texlive/trunk@59821 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/ifallfalse/ifallfalse.sty | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/ifallfalse/ifallfalse.sty (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/ifallfalse/ifallfalse.sty b/Master/texmf-dist/tex/latex/ifallfalse/ifallfalse.sty new file mode 100644 index 00000000000..1de8858f96b --- /dev/null +++ b/Master/texmf-dist/tex/latex/ifallfalse/ifallfalse.sty @@ -0,0 +1,43 @@ +%% +%% This is file `ifallfalse.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ifallfalse.dtx (with options: `package') +%% This work may be distributed and/or modified under +%% the conditions the LaTeX Project Public License (LPPL), +%% either version 1.3 of this license or (at your option) +%% any later version. The latest version of this license +%% can be found in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{ifallfalse}[2021/07/01 v1.0.0 Compare string against set of other strings] + +\newenvironment{allfalse}[2] +{ + \def\comparedstring{#1} + \def\logicbody{#2} +} +{ + \logicbody +} +\newcommand*\@allfalsename{allfalse} + +\newcommand{\orcheck}[1]{ + \ifx\@currenvir\@allfalsename + \protected@edef\logicbody{ + \ifnum\pdfstrcmp{\comparedstring}{#1}=0\else\logicbody\fi + } + \else + \PackageError{ifallfalse}{ + \protect\orcheck\space should be nested within the allfalse environment + }{} + \fi +} +\endinput +%% +%% End of file `ifallfalse.sty'. -- cgit v1.2.3