# Re: Preamble order and LyX layouts

A. Scottedward Hodel wrote:

I may just be being too picky. I was able to \def a LaTeX command with \ifthenelse very similar to what you describe: I just wanted to make in a \newenvironment, and these sort of commands don't seem to mesh well with that macro. My command was

\newcommand{\questxsol}[2]{
\ifthenelse{\equal{\notestype}{teacher}}{#2}
{ \ifthenelse{\equal{\questxenv}{example}} {#2}{#1} } }


The variable \notestype determines whether this is the student or teacher version, and the variable \questxenv indicates whether this solution is in a worked example, a homework problem, or an exam question. (I've been using a single LaTeX file that is \input inside a question/example/examQuestion environment so that the questions are modular and formatted according to how they're used.)


Suppose I use the \solutioncmd or \questxsol in LyX rather than a \newenvironment. How do I incorporate that command into a LyX paragraph environment, or is that cleanly possible?


You can define a paragraph to be of "command" type. Section headers, for example, are like this. This just determines whether LyX outputs:
\begin{whatever}...\end{whatever}