I am writing a document for a software which has two versions. Most of the content in the document is the same except few specific details. Right now, I am using the conditionals to build the document for a specific file, like so,
\usepackage{etoolbox}
..
\newtoggle{version5}
\togglefalse{version5}
\iftoggle{version5} {
\title{Version 5 document}
} {
\title{Version 6 document}
}
\begin{document}
\chapter{Chapter 1}
\iftoggle{version5} {
\section{Version 5 section}
} {
\section{Version 6 section}
}
\end{document}
This works prefectly, but the problem is everytime I need either of the document, I need to toggle
the variables each time. Is there a way to build both the document in a single run?