2

I want to comment out a whole section in order to save the text but not render it in the PDF. Is this possible?

5
  • Put a comment sign % at the beginning of every line of the section, use package comment or use a conditional test i wont show you, because it is bad.
    – Johannes_B
    Feb 25, 2015 at 19:44
  • Yes the verbatim package solves this problem to a very good degree. Feb 25, 2015 at 19:57
  • Hm, the conditional i wouldn't show has the highest vote count.
    – Johannes_B
    Feb 25, 2015 at 20:00
  • What do you mean @Johannes_B? I like the verbatim solution, how about you? Feb 25, 2015 at 20:13
  • @LoveLearning I like it too, but the other question has higher voted answers. Those work perfectly fine and i use the \iffalse trick myself everyday. But it isn't the cleanest of solutions.
    – Johannes_B
    Feb 25, 2015 at 20:19

1 Answer 1

6

As pointed out in the comments, there is a solution to this problem. For me, the verbatim package worked out the easiest. As given here

The solution is simply

\documentclass{article}
\usepackage{verbatim}
\begin{document}
    This text will be displayed
\begin{comment}
    This text will not be displayed.
\end{comment}
\end{document}

Not the answer you're looking for? Browse other questions tagged .