I want to test if either inputenc or selinput are loaded. My problem now is to do complex boolean expressions and I have no clue how to do that with LaTeX.
The basic code would be something like this:
\AtBeginDocument{%
\ifpdftex{% only if pdftex
\ifthenelse{%
\not\isPackageLoaded{inputenc} \and \not\isPackageLoaded{selinput}
}%
{ raise warning }
{ everything ok }
}{}
}
however I assume that \not and \and and such are not available directly.
the code for testing is based on this (not fully tested)
\RequirePackage{scrlfile, etoolbox}%
\SetupIfPackageLoaded{inputenc}
\SetupIfPackageLoaded{selinput}
\newcommand\SetupIfPackageLoaded[1]{%
\providebool{TemplateIfPackageLoaded@#1}
\setboolean{TemplateIfPackageLoaded@#1}{false}
\AfterPackage{#1}{%
\setboolean{TemplateIfPackageLoaded@#1}{true}
}%
}%
\newcommand\isPackageLoaded[1]{%
\boolean{TemplateIfPackageLoaded@#1}
}
the code is for a package which I want to use to test errors in a LaTeX template mostly in the preamble.
ifthenpackage,etoolboxpackage, andexpl3provides calculation of boolean values. – Leo Liu Sep 22 '11 at 07:43