TeX/ifhmode

From Wikibooks, open books for an open world
< TeX
Jump to: navigation, search

[edit] Synopsis

\ifhmode <TeX code 1> [\else <TeX code 2>] \fi

[edit] Description

The \ifhmode command denotes the start of an if-then-else control structure that tests whether TeX is currently in either horizontal mode or restricted horizontal mode. As indicated in the Synopsis, the \else part is optional. <TeX code 1> is processed if TeX is in one of the horizontal modes, otherwise it is ignored. If the \else section is included and TeX is not in one of the horizontal modes then <TeX code 2> is processed; otherwise it is ignored.

[edit] Examples

Personal tools
Namespaces
Variants
Actions
Navigation
Community
Toolbox
Sister projects
Print/export