On Mon, Nov 17, 2014 at 5:39 PM, Richard Heck <rgh...@lyx.org> wrote:
> On 11/17/2014 04:57 PM, Bruce Momjian wrote:

> Second, it is possible to use LyX layout to modify how branches are output.
> E.g., you could do this in local layout:
>
> Format 41
> InsetLayout Branch:IfEmployer
> LatexType Command
> LatexName ifemployer
> Preamble
> \newcommand\ifemployer[1]{\ifx\employer\undefined\relax\else #1\fi}
> EndPreamble
> End
>
> Now if you define a branch called "IfEmployer" and activate it, it'll give
> you LaTeX output as:
>
> \ifemployer{this is the content.}
>
> and that will be included or not conditionally on whether \employer is
> defined.

Very cool. I like this solution.

Scott

Reply via email to