I am trying to avoid modularizing a document into separate files (because it gets translated into 10 languages!) Instead, I am trying my luck with the comments package.

Let's say I have three software manuals for three variants of the program:

  1. appname-demo.tex
  2. appname-pro.tex
  3. appname.tex


The problem seems to me that overlapping includes and excludes would both write to comment.cut. This would cause the file to possibly be empty during an embedded (sequential) read.

From the comment.sty source code:

The comment environments use two auxiliary commands. You can get nifty special effects by redefining them. [...] \def\CommentCutFile{comment.cut}


Does not typeset.


  {\includecomment{include-pro}} % TRUE, so show pro stuff
  {\excludecomment{exclude-demo}} % TRUE, so hide stuff

%\specialcomment{include-pro-functionality}% Attempt at changing `\CommentCutFile`
%  {\begingroup\def\CommentCutFile{include-pro.cut}}{\endgroup}
%\specialcomment{hide-in-demo}% Attempt at changing `\CommentCutFile`
%  {\begingroup\def\CommentCutFile{exclude-demo.cut}}{\endgroup}

\section{Normal Functions}

\section{Paid-Version Only Functions}

\section{Professional Functions}

% Overlapping Comments Test
\section{Paid-Version Only Functions}
\subsection{Pro-Version Only Embedded}  


I'd like to close this question. I am going to go with Ulrike Fischer and say that you can't [currently] nest comments.

It might be possible by creating separate files for each nested comment, but this would require more time than its worth. Perhaps someday...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.