In a .tex
document, I'm using the comment
package to produce two different versions (let's say : versionA and versionB) of the document. Each version contains different parts (it could be paragraphs, equations,...). If I use \includecomment{versionA}
, it will include all the content between \begin{versionA}
and \end{versionA}
. Now, let's say some of the parts in each version are marked with a *
. How can I ask latex to compile only the *
parts in one version ?
It may be clearer on the following example. Let's say I have
\documentclass[10pt,a4paper]{article}
\usepackage{comment}
\includecomment{versionA}
\excludecomment{versionB}
\begin{document}
\begin{versionA}
*part1
part2
*part3
\end{versionA}
\begin{versionB}
part1
*part2
\end{versionB}
\end{document}
I would like something which enables me to do : "compile all the content of versionA" or "compile only the content marked with * in versionA" (same for versionB). I hope this is clear!
\include
and\includeonly
would imply having multiple .tex documents.\begin{versionC}
and\end{versionC}
around the parts in the versionA you do not want (the non starred ones) and add\excludecomment{versionC}
to your preamble.\begin{versionC}
and\end{versionC}
around the starred parts, it works fine ! I just didn't think I could have two\includecomment
or\excludecomment
in the preamble.