Go to page:

Search help:

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

OptionalEnvironmentArguments

Categories: LyxTricks
<< Equation numbering | Page list | FeynmanDiagrams >>

How to add optional arguments to environments

Many LaTeX environments accept optional arguments that influence their behavior. The theorem environment, for example, accepts an optional argument that is typeset after the theorem number, often used for the name of the theorem or to give credit to its discoverer. In LaTeX, this would be written thus: \begin{theorem}[Cohen, 1961] or \begin{theorem}[Schröder-Bernstein Theorem], with results like these:

Theorem 1.1 (Cohen, 1961).
Theorem 1.2 (Schröder-Bernstein Theorem).

LyX offers no obvious way to do this, but in fact it is quite simple. All you need to do is enter the optional argument as ERT immediately following the appearance of "Theorem 1.2", or whatever, in LyX. It works because the optional argument follows the environment declaration. A similar trick works, therefore, with enumerations. If you put "[Label]" in ERT immediately after the number, "2.", or whatever, "Label" will be used as the label.

LyxTricks

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2006-09-21 18:32 CEST