[OS X TeX] Unwanted blank page

Josep M. Font jmfont at inicia.es
Thu Jan 5 00:26:22 CET 2006


El 04/01/2006, a las 23:51, Alain Schremmer escribió:

> Here it is and it works:
>
>    \newboolean{FinalVersionWithExercises} % defaults to false
>    % \setboolean{FinalVersionWithExercises}{true} %% uncomment this    
> line to actually include the exercises
>
>    \newcommand{\includeExercises}[1]{%
>    \ifthenelse{\boolean{FinalVersionWithExercises}}% if true, do the   
>  first thing, otherwise the second.
>    {%
>        \input{#1}% true part
>    }{%
>        {\url{#1}}% else part
>    }%
>    }

Some years ago I used a different trick which does not force one to 
modify the source file  every time one wants to include or exclude the 
exercises. It uses some TeX mechanisms (which of course work with 
LaTeX), which ask interactively what option you want. Adapting my own 
code to your situation, I think the following should work:

\typein[\withexercises]{Enter 1 to INCLUDE the Exercises, enter 0 to 
EXCLUDE them, and press INTRO}  % This asks interactively through the 
console; do what it says.

\newif\ifexercises     % similar to boolean of ifthen package, defaults 
to false
\if\withexercises1\exercisestrue\fi   % if you entered 1, then make it 
true

\newcommand{\includeExercises}[1]{%
    \ifexercises%     if true, do the first thing, otherwise the second
    \input{#1}%       true part
    \else%
    \url{#1}%         else part
    \fi%
    }

This code should replace the one you quote above. Moreover you do not 
need the ifthen package (I presume it is actually a more user-friendly 
interface to what I am using). When you typeset the source file, TeX 
will stop, show the message ("Enter 1 ...") in the console, and a line 
saying "\withexercies=?". Then you type 1 or 0 in the writing space and 
hit Intro (i.e., carriage return). Then the file will be typeset 
according to your wishes.

One thing to remember with these and similar tricks is that each 
successive TeX run destroys the previous one, so if one wants to keep 
both versions, one has to rename the PDF file resulting from the first 
run...

Hope it helps...

JMaF

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list