[OS X TeX] Conditional Typesetting Inside Lists

Themis Matsoukas matsoukas at engr.psu.edu
Tue Feb 26 16:47:19 EST 2008

On Feb 26, 2008, at 10:41 AM, Maurino Bautista wrote:

>  I would like to define a variable whose values are either exam or  
> key.
> [...]

I use the \commentsoff{},  \commentson{} commands that are built-in in  
the memoir class (see p. 207 of the memoir manual, meman.pdf). I  
believe that these commands are also available through packages, if  
you don't want to use memoir. Here is a minimal example. Set the  
boolean ShowKey to true or false to show/hide the solution.




%-----setup boolean ShowKey----
\setboolean{ShowKey}{true}   %<-- true: shows key; false: hides key

%----E X A M P L E-----
% problem statement here
\textbf{Problem:} $1+1=?$

% solution here - printed only if ShowKey is true
\textbf{Solution:} $1+1=2$


More information about the MacOSX-TeX mailing list