Answer by Ulrich Diez for How can I check in LaTeX (or plain TeX) whether a...
A non-expandable variant of the test which does without whatsoever extensions:\documentclass{article}\makeatletter\DeclareRobustCommand\ckeckfor[1]{% \begingroup...
View ArticleAnswer by Raphael for How can I check in LaTeX (or plain TeX) whether a...
The package xifthen provides \isundefined which apparently has slightly different semantics:This test differs from \@ifundefined in that it takes a real command—and not a command name—as argument, and...
View ArticleAnswer by Martin Scharrer for How can I check in LaTeX (or plain TeX) whether...
The etoolbox provides two macros for this:\ifdef{<control sequence>}{<true>}{<false>}Expands to <true> if the <control sequence> is defined, and to <false>...
View ArticleAnswer by Joseph Wright for How can I check in LaTeX (or plain TeX) whether a...
The LaTeX kernel standard macro here is \@ifundefined, used as\@ifundefined{foo} {% % \foo not defined } {% % \foo defined }%In earlier LaTeX2e releases, this test was not 'expandable' and would cause...
View ArticleAnswer by Peter Grill for How can I check in LaTeX (or plain TeX) whether a...
Is this what you are looking for:\documentclass[12pt]{article}\newcommand{\checkfor}[1]{% \ifcsname#1\endcsname% ... command '#1' exists ...% \else% ... command '#1' does not exist ...%...
View ArticleHow can I check in LaTeX (or plain TeX) whether a command exists, by name?
I'm looking for a LaTeX way to control macro expansion, contingent on some macro being defined or not. I'm looking for something like this (but then actually working):\newcommand[1]{\checkfor}{...
View Article
More Pages to Explore .....