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!
Best Answer
This will allow you to get all (and only) the starred parts of your document I have added some indentation in order to highlight the different groups of version):
This code will allow you to get all the starred parts from the A version (to get the ones from the B version just invert
versionA
andversionB
in theinclude/excludecomment
commands in the preamble):