Continuing experimenting with conditional text, I am getting a code with a number of options: some dialogs in english are translated, some other options (not shown in the MWE) enable the document be compiled with or without the graphics. In order to enable an final conversion into a docbook format, I have also made a macro to eliminate explicit reference to chapters, and page numbers. There are other variants. The number of options begins to be a problem for each revision. I would like to be able to generate (compile) most variants sequentially without a manual change of parameters in the code. I have just discovered makefiles, and I am wondering if a makefile could be used to generate all the different variants of the document and how. I have considered locating the lines of code containing the options that need to be changed in subfiles and would be optionnally used for compilation. What would be the best approach ?
\documentclass[a5paper, 11pt,oneside]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}%
\usepackage{ifthen}
\usepackage[english, frenchb]{babel}% Pour franciser LaTeX
\def\pagenum{n} %page numbering {n} to eliminate
\makeatletter
\ifthenelse{\equal{\pagenum}{n}}{\let\ps@plain\ps@empty}{}%first page of chapters
\makeatother
%====================
\def\lang {ef} %variable used for conditional text e=english, f=french, ef=english with footnotes
\newcommand{\CondText}[2]{%
\ifthenelse{\equal{\lang}{e}}{{\selectlanguage{english}\emph{#1}}}{}%
\ifthenelse{\equal{\lang}{ef}}{{\selectlanguage{english}\emph{#1}}%
\footnote{\selectlanguage{french} #2}}{}%
\ifthenelse{\equal{\lang}{f}}{{\selectlanguage{french} #2}}{}%
}%
\begin{document}
\ifthenelse{\equal{\pagenum}{n}}{\pagestyle{empty}}{}%
\ifthenelse{\equal{\pagenum}{n}}{\chapter*}{\chapter}{L'auberge}
\CondText {--- Sir, the manager needs to see you before you go !}{--- Monsieur, le patron veut vous voir avant votre départ !}\medskip
Some text in french\dots{}
\end{document}
book. 2) Declare all the options of classbookand those of the packages you load as options of your custom class. 3) Inside your custom class, move the options around to the corresponding class or package (as explained here). 4) Create a makefile using Martin Scharrer's trick. – jub0bs Nov 19 '13 at 17:39\opt{f}{\def\lang {f}} \opt{e}{\def\lang {e}} \opt{ef}{\def\lang {ef}}
– Yves Nov 19 '13 at 20:08