[OS X TeX] Unwanted blank page

Ross Moore ross at ics.mq.edu.au
Fri Jan 6 00:23:38 CET 2006


Hi Maarten, and others.

On 06/01/2006, at 8:48 AM, Maarten Sneep wrote:

> You may want to add some code to set a default inside the tex file,  
> and you'll need to remove the \typein.
> I tried some code to test whether the \if was defined, but that is  
> hard. Perhaps try a different approach (note this is untested, and  
> unsupported by me):
>
> with exercises:
> pdflatex \\def\\IncludeExercisesThisRun{} \\input yourfile.tex

Along these lines, and with slightly less typing, is to use
one of TeX's existing count registers; e.g.,

  pdflatex \\count0=1 \\input yourfile.tex

>
> without exercises:
> pdflatex yourfile.tex
>
> with the following in the file:
>
> \newif\ifexercises
> \ifx\IncludeExercisesThisRun\undefined
> \exercisesfalse
> \else
> \exercisestrue
> \fi
>
> and the rest as before. This basically turns the existence of a  
> macro into a boolean flag, which you then use to define the flag  
> you're really interested in.

Test the value of the counter early in the preamble of your document,
to allow you to choose from a number of different possibilities:


\ifcase\count0
  ... what to do when it is 0 ...
\or
  ... what to do when it is 1 ...
\or
  ... what to do when it is 2 ...
\or
        ... more cases ...
\else
   ... what to do otherwise ...
\fi
\count0 = 1


Since \count0 is the usual page-counter, then you'd better set it
back to its normal starting value of 1.

If you use a different count-register, then you'd better check
what is it's normal starting value.
e.g.
  \count255  has value  255 *before* the \documentclass command,
but 92 afterwards --- indeed, doubtless this depends upon which
class and options have been used.

>
> HTMH,
>
> Maarten


This kind of technique is most convenient for command-line users
of (La)TeX. It can also be used with TeXShop by editing the commands
in the "Engine" panel of TeXShop's "Preferences..." screen.


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114
------------------------------------------------------------------------


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