# Can I use“ \iffalse … \fi” to solve this problem? [duplicate]

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}

-

## marked as duplicate by Joseph Wright♦Apr 20 '12 at 16:34

Can you please explicitly state the problem? –  Gonzalo Medina Apr 19 '12 at 3:02
Welcome to TeX.SE. If you replace the \show with \fi I think you will get the desired results. While you are at it, you might as well replace the \show with \iffalse. –  Peter Grill Apr 19 '12 at 3:03
Great.Thank You! –  wu guiping Apr 19 '12 at 4:31
Note that \show is already defined by (La)TeX and you have a typo in your code: \hi instead of \fi. Your code doesn't work, because the \fi is hidden inside the \show. When text is ignored after a \iffalse, macros are not expanded, so the \fi is never found. See also What is an \if? for more info about it. Also How to write hidden notes in a LaTeX file? should be interesting for you. –  Martin Scharrer Apr 19 '12 at 6:46

You can use

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


\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.

-