2

Possible Duplicate:
How to write hidden notes in a LaTeX file?

\documentclass{article}

\def\hide{\iffalse}

\def\show{\hi}

\begin{document}

111111

\hide

222222

\show

333333

\hide

444444

\show

555555

\end{document}
wu guiping
  • 21
  • 1
  • 1
  • 2

1 Answers1

6

You can use

\let\hide\iffalse
\let\unhide\fi% rather than \show

to achieve your desired result:

enter image description here

\documentclass{article}
\let\hide\iffalse
\let\unhide\fi
\begin{document}
111111 \par
\hide
222222 \par
\unhide
333333 \par
\hide
444444 \par
\unhide
555555
\end{document}

However, the same result is possible using a more controlled approach provided by the comment package:

\documentclass{article}
\usepackage{comment}% http://ctan.org/pkg/comment
\begin{document}
111111 \par
\begin{comment}
222222 \par
\end{comment}
333333 \par
\begin{comment}
444444 \par
\end{comment}
555555
\end{document}

comment allows version control of comment environments.

Werner
  • 603,163