Sanders, Maarten (M.J.L.) wrote:
I am currently setting up a documentation system for our product (we
build process automation systems). We maintain about 35 installations,
all installations are more or less similar but still there an numerous
differences. Fot this I am looking to a nice solution for modular
content. I know about the version package and about the solution from
http://www.mail-archive.com/lyx-users@lists.lyx.org/msg12544.html
if(unit1)
{Some text about unit 1}
else
{Some text about all units except unit 1}
if{NOT unit 1 OR NOT unit 3}
{Some text about unit 2 and 6}
else
{Some specific notes about unit 3 and 1}
etc.
this is not easy and LyX is not the right editor for this.
Attached a solution using the \ifcase macro for printing
only text for the units 1..20 (in the example only for 1,2,3
You can define things like
\def\unitI{ ... }
\def\unitII{ ... }
and then \unitI inside the case part for unit I which prints
the argument of unitI.
Herbert
#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass article
\begin_preamble
\newcommand\firstL{2pt}
\newcommand\Abstand{2pt}
[EMAIL PROTECTED]
[EMAIL PROTECTED]@width\headwidth \vskip\Abstand%
[EMAIL PROTECTED]@width\headwidth \vskip-\headrulewidth}}%
\end_preamble
\language icelandic
\inputencoding latin1
\fontscheme default
\graphics default
\paperfontsize 10
\spacing single
\papersize a4paper
\paperpackage
\use_geometry 0
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\paperwidth 17cm
\paperheight 22cm
\leftmargin 1.2cm
\topmargin 1.4cm
\rightmargin 1.7cm
\bottommargin 1.4cm
\headsep 1cm
\secnumdepth 4
\tocdepth 4
\paragraph_separation indent
\defskip medskip
\quotes_language german
\quotes_times 2
\papercolumns 1
\papersides 2
\paperpagestyle fancy
\layout Section
A test with an optional case
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
def
\backslash
unit{2}
\end_inset
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
ifcase
\backslash
unit
\backslash
or% text for unit 1
\end_inset
\layout Standard
Some text about unit 1
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
or% text for unit 2
\end_inset
\layout Standard
Some text about unit 2
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
or% text for unit 3
\end_inset
\layout Standard
Some text about unit 3
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
else% text for units > 3
\end_inset
\layout Standard
Some text about all units except 1-3}
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
fi
\end_inset
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
def
\backslash
unit{4}
\end_inset
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
ifcase
\backslash
unit
\backslash
or% text for unit 1
\end_inset
\layout Standard
Some text about unit 1
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
or% text for unit 2
\end_inset
\layout Standard
Some text about unit 2
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
or% text for unit 3
\end_inset
\layout Standard
Some text about unit 3
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
else% text for units > 3
\end_inset
\layout Standard
Some text about all units except 1-3}
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
fi
\end_inset
\the_end