ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: ecashin@coe.uga.edu (Ed L. Cashin)
Subject: use supp-fil in plain tex
Date: 10 Mar 2000 11:51:39 -0500	[thread overview]
Message-ID: <m37lfahip0.fsf@coe.uga.edu> (raw)

Hello.  I have a situation where I'd like to process an undetermined
number of figures in a TeX document.  The way I'm currently handling
it is by generating the TeX code with perl, with TeX code to include
each figure.

However, a much simpler and more general strategy, that might not be
much slower, would be to use a loop in the TeX code that included the
files if they were there.  

The task is made easier by the fact that the included files are
MetaPost figures with consecutive suffixes.  The loop, then has to do
this: 

      counter variable i = 1
      while exists file myfile.i
            include figure from myfile.i
            increment i
      done

I know that loops can be done in plain TeX with the \loop macro, and I
saw the "\doiffileelse" macro in supp-fil.tex.  I'm trying to use it
like this:

    \input supp-mis
    \input supp-fil

    \newcount\iterator\iterator=1
    \newif\ifNotDone\NotDonetrue

    \loop\ifNotDone
      \doiffileelse{sumvouch\iterator}
    	    {\placeFgBg{sumvouch.\iterator}\advance\iterator by 1}
    	    {\NotDonefalse}
    \fi\repeat

... which may or may not be the right way to write the loop, but I get
errors like this while supp-fil is loading:

   This is pdfTeX, Version 3.14159-13d (Web2C 7.3.1)
   (sumvouch.tex[/usr/local/teTeX/share/texmf/pdftex/config/pdftex.cfg]
   Babel <v3.6x> and hyphenation patterns for american, french, german, ngerman, n
   ohyphenation, loaded.
   (/usr/local/teTeX/share/texmf/tex/context/base/supp-mis.tex
   loading : Context Support Macros / Missing
   ) (/usr/local/teTeX/share/texmf/tex/context/base/supp-fil.tex
   loading : Context Support Macros / Files
   ! Incomplete \ifx; all text was ignored after line 77.
   <inserted text> 
   		   \fi 
   <to be read again> 
   		      \newread 
   l.77 \ifx\undefined\scratchread  \newread
   					     \scratchread  \fi

Is it possible to use supp-fil this way in order to make use of the
\doiffileelse macro in a plain tex source?

-- 
--Ed Cashin                     PGP public key:
  ecashin@coe.uga.edu           http://www.coe.uga.edu/~ecashin/pgp/


             reply	other threads:[~2000-03-10 16:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-10 16:51 Ed L. Cashin [this message]
2000-03-12 10:43 ` Hans Hagen
2000-03-13 20:49   ` Ed L. Cashin
2000-03-13 21:54     ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m37lfahip0.fsf@coe.uga.edu \
    --to=ecashin@coe.uga.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).