# Cannot use example from Theorems module

2 messages
Open this post in threaded view
|
Report Content as Inappropriate

## Cannot use example from Theorems module

 I am unable to use 'example' environment from any of the Theorems modules because \example is apparently defined elsewhere. Lyx adds the line "\newtheorem{example}[thm]{\protect\examplename}" on which LaTeX says that "Command \example already defined". You can reproduce the error by creating a new paper and trying with any of the Theorems modules. I am on Lyx 2.2.2 for Mac. Any ideas how to fix it?
 Here is my quick fix. Place the definition of \exmpl in the preamble     \theoremstyle{definition}     \newtheorem{exmpl}{\protect\examplename}[section]     \providecommand{\examplename}{Example} And then wrap examples in your text like so: \begin{exmpl} "body of the example" \end{exmpl}. LaTeX code should be in Tex code block (cmd+L on Mac).