Ralph Boland wrote:
> 
> > http://www.educat.hu-berlin.de/~voss/lyx/IfThen/ifthen.html#ifthen

> In my case I have to deal with proceeding and electronic versions
> of papers or paper vs chapters of my thesis etc.  Rather than
> have multiple copies of these documents and then
> have to update them all when I make a change I would like
> to store them all into one lyx document.  Herbert's solution
> allows me to do this but requires that I use a lot of ERT
> (evil red text) and abandon much of the advantage of
> using lyx over latex.

you can define your own lyx-paragraph-layouts. for example 
save the attached layouts in ~/.lyx/layouts as option.inc
and insert in ~/.lyx/layouts/article.layout the line
Input option.inc

Restart lyx and you'll get two more lyx paragraph-layouts
OptionTrue
OptionFalse

choosing the first the text appears in red and for the
second in green. the boolean variable myOption is predefined
as true, so the text in green will be ignored. changing this
default in latex preamble or anywhere in the text with
\setboolean{myOption}{false}

the red text is ignored. 

Herbert




-- 
http://www.educat.hu-berlin.de/~voss/lyx/
# Extended textclass definition file. 
# Author : Herbert Voss <[EMAIL PROTECTED]>
# 
# General
Preamble
 \usepackage{ifthen}
 \newboolean{myOption}
 \setboolean{myOption}{true}
 \newcommand\OptionTrue[1]{%
    \ifthenelse{\boolean{myOption}}{#1}{}
 }
 \newcommand\OptionFalse[1]{%
    \ifthenelse{\boolean{myOption}}{}{#1}
 }
EndPreamble

#===================================================================
# Style OptionTrue - Herbert Voss 010627
#===================================================================
Style OptionTrue
  Margin                Static
  LatexType             Command
  LatexName             OptionTrue
  ParIndent             MM
  ParSkip               0.4
  Align                 Block
  AlignPossible         Block, Left, Right, Center
  LabelType             No_Label
  Font
    Color               Red
  EndFont
End

#===================================================================
# Style OptionFalse - Herbert Voss 010627
#===================================================================
Style OptionFalse
  Margin                Static
  LatexType             Command
  LatexName             OptionFalse
  ParIndent             MM
  ParSkip               0.4
  Align                 Block
  AlignPossible         Block, Left, Right, Center
  LabelType             No_Label
  Font
    Color               Green
  EndFont
End


Reply via email to