On Mon, Nov 17, 2014 at 05:39:38PM -0500, Richard Heck wrote:
> On 11/17/2014 04:57 PM, Bruce Momjian wrote:
> >On Mon, Nov 17, 2014 at 04:41:37PM -0500, Scott Kostyshak wrote:
> >>On Mon, Nov 17, 2014 at 3:44 PM, Bruce Momjian <[email protected]> wrote:
> >>>I know I can use Insert/File/Child Document to insert a LyX document
> >>>into an existing LyX document.  Is there any way to _conditionally_
> >>>include the document based on a TeX define, e.g.:
> >>>
> >>>         \ifx \employer \include{/presentations/employer/head_bumper} \fi
> >>>
> >>>but if you put this in a TeX red block, it doesn't work as \include must
> >>>be processed by LyX.
> >>>
> >>>I would like to do this so I can define a TeX variable in my LaTeX
> >>>preamble and have it control the addition of slides.
> >>Would a branch do what you want?
> >Yeah, thank you.  While I don't know how to activate/deactivate the
> >branch based on a define, it does give me a simple way to turn stuff
> >on/off.  I have been with LyX for 15 years and it never ceases to amaze
> >me.
> 
> There are some other options. The simplest is to do it this way:
> 
> PUT IN ERT: \ifx\employer\undefined\relax\else[\ERT]
> 
> ...now enter a LyX include box...or any other LyX content...
> 
> PUT IN ERT: \fi
> 
> This is an extremely powerful construct.

Thanks, that worked perfectly.  Now a single preamble lines controls
everything.

-- 
  Bruce Momjian  <[email protected]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +

Reply via email to