Cannot use example from Theorems module

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Cannot use example from Theorems module

Boris
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?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot use example from Theorems module

Boris
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).
Loading...