Quantcast
Channel: How can I check in LaTeX (or plain TeX) whether a command exists, by name? - TeX - LaTeX Stack Exchange
Browsing latest articles
Browse All 6 View Live

Image may be NSFW.
Clik here to view.

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 Article



Answer 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 Article

Answer 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 Article

Answer 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 Article

Answer 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 Article


How 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
Browsing latest articles
Browse All 6 View Live




Latest Images