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

Possible Duplicate:
How to write hidden notes in a LaTeX file?
Conditional typesetting / build

Is it possible to add a flag (variable) in my .tex file, so that I can switch among two modes: a light version and a full version?

The text which is supposed to be displayed in full mode could be wrapped in an environment:

... flag ...

So when flag is 0, the text wrapped in fullmode is hidden in the pdf file generated; while flag is 1, the text wrapped in fullmode is displayed ...

Does anyone know how to realize that?

share|improve this question

marked as duplicate by egreg, Harish Kumar, Marco Daniel, diabonas, Claudio Fiandrino Sep 30 '12 at 14:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 3 down vote accepted

You can use the versions package and use the commands \includeversion{fullmode} or \excludeversions{fullmode} in the preamble as your flag.

share|improve this answer

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