I'd like to be able to generate different versions of a document using some kind of print command inside an \ifthenelse
statement. Here's an example of what I would like to do. I'd like to do it this way because my document is quite long and has many sections. I think it would be easier for me to do something like this rather than define all the text inside the \ifthenelse
statement.
\documentclass{article}
\usepackage{ifthen}
\begin{document}
\newcommand{\docVersion}[1]
{
% normally, text would go where the commands \printA{} and \printB{} would go
\ifthenelse{\equal{#1}{group A version}}{\printA{}}{}
\ifthenelse{\equal{#1}{group B version}}{\printB{}}{}
}
% so here, I could define that I want group A's version
\docVersion{group A version}
% and only this would be printed
\printA{Some stuff for group A here.}
% and this would not
\printB{Some stuff for group B here.}
% and this would be printed also
Some stuff for both groups here.
\end{document}
\newif
can do (oretoolbox
's\newboolean
, etc.). If you want a conditional with more than 2 outcomes,\ifcase
could come in handy (orexpl3
's\str_case:nnTF
, etc.).