{optional-arguments} concerns commands and environments that accept optional arguments. For example the \sqrt command can be used as \sqrt[3]{x}.

learn more… | top users | synonyms

2
votes
1answer
135 views

\newcommand that restricts the value of an argument

When defining a macro, is it possible to restrict the value of an argument, so that if the thing followed it is a number, then it takes it as an argument, but if it is not, then it is just empty. To ...
62
votes
5answers
6k views

Different command definitions with and without optional argument

I want to define a command that expands to two completely different things depending on whether I supply, or not, an optional argument. For example, \mycmd{normal} -> something(normal) ...
13
votes
2answers
314 views

How can one put a “[” after \item?

The following does not compile because of the "[" after the \item. I presume it is because LaTeX expects a "]" as per the \item[option] syntax. However, I just want to insert the "[" character into ...