Newsgroups: comp.text.tex
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!sun1.ruf.uni-freiburg.de!rusmv1!texinfo1
From: texinfo1@rusmv1.rus.uni-stuttgart.de (Rainer Schoepf)
Subject: Re: SliTeX bug?
Message-ID: <1991May29.185137.8016@rusmv1.rus.uni-stuttgart.de>
Summary: You may call it a bug, you may call it a feature!
Organization: Comp.Center (RUS), U of Stuttgart, FRG
References: <1991May20.204251.16804@ariel.unm.edu>
Date: Wed, 29 May 1991 18:51:37 GMT
Lines: 60

In article <1991May20.204251.16804@ariel.unm.edu> ingham@triton.unm.edu (Kenneth Ingham) writes:
>Important data:
>Ultrix 4.0 on a Decstation 5000/200
>TeX C Version 2.95
>SliTeX Version 2.09 - Release 10 November 86

  current release is June 88   ^^^^^^^^^^^^^^ 

>
>It seems that it is possible to have the contents of a verbatim
>environment make a difference.
>
>The file runoff.tex:
>
>\documentstyle{slides}
>\onlyslides{2}
>\begin{document}
>\blackandwhite{slides}
>\end{document}
>
>The file slides.tex:
>
>\begin{slide}{}
>\begin{verbatim}
>{ % }
>\end{verbatim}
>\end{slide}
>
>If the onlyslides line above is commented out, everything runs fine.
>However, with it there, the following error is produced:

What happens is this: when you use \onlyslides{something} SliTeX will
skip over the slides that are excluded. But then the \begin{verbatim}
command is not executed, so the percent character is treated as start
of comment. There is no way around this, since you don't want to execute
\begin{verbatim} when you don want that specific slide.

Now wait a minute, you say, can't you treat verbatim environments in a 
special way so that it works. Well, you can, but this needs a very 
complicated look-ahead mechanism that will probably not catch all the
cases. This is one of the places where you hit TeX's limitations.

>
>Is there an easy work-around for this problem?  A hard one?
>

It depends on what you want to do. For example, there is the alltt
style option defining the alltt environment. This is like verbatim,
except that backslash and braces retian their usual meaning. Since you
want to display C code, this doesn't help very much. There is another,
more complicated solution: instead of putting your code between 
\begin{verbatim} ... \end{verbatim} put it into an extra file. There
are several style options that define some sort of \verbatiminput
command that processes the file contents as if they appeared between
\begin{verbatim} ... \end{verbatim}. 

One example of this is the verbatim style option I wrote a while ago.


Rainer Sch"opf
