TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am in the process of CV writing and some pieces of information are necessary to include in some applications, whilst in others they are unnecessary. For example, when applying for scientifically-oriented jobs the modules taken during my degree might be of importance and so should be included, but for other sectors they are irrelevant.

Is there a way of setting a flag at the top of a LaTeX document and using this make text wrapped in a block hide/unhide on document creation?

share|improve this question

migrated from stackoverflow.com Jul 14 '13 at 22:23

This question came from our site for professional and enthusiast programmers.

Look into CurVe – Sean Allred Jul 15 '13 at 4:07
up vote 7 down vote accepted

You can define your own switch with the \newif command like this:



\importanttrue % or \importantfalse

 some stuff which will always be shown

 % only shown if \importanttrue is set
 this is some important text

With this setting, the important stuff will be displayed. When you want to hide this part, you set \importantfalse instead of \importanttrue

share|improve this answer

You could also use the comment package which is designed exactly for this purpose.

something I might want to include, or maybe not

Then, you use one of these switches in your preamble:

\includecomment{comment} %show comments
\excludecomment{comment} %do not show comments
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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