I have some standard-texts, but some portion of it is different. But of these different parts only a few exists.
For instance I want:
\mytext{...}{a} \mytext{...}{b}
That produces:
\section{Item: ...}\label{item...} This is a standard item. Items of type a are very precious. \section{Item: ...}\label{item...} This is a standard item. Items of type b are cheap.
A simple solution to this would be to define commands mytexta and mytextb, but as I have more options I want more something like an if or switch in programming languages. Has anyone a solution for this problem?
The
ifthenpackage (which is included in a standard LaTeX installation) defines a command\ifthenelse, which is used like this:so you could do something similar to:
For LaTeX programming, I’d recommend getting a copy of The LaTeX Companion. It’s a really good reference for this stuff.