[texhax] tex goes into infinite loop

tomfool at as220.org tomfool at as220.org
Sun Oct 10 15:19:27 CEST 2004


Can anyone help me understand why the following doesn't work?

  \documentclass[twocolumn]{article}
  
  \makeatletter
  \newbox\IN at topfig
  \newbox\IN at topfiga
  \newtoks\IN at output
  \global\IN at output\expandafter{\the\output}
  \global\output{%
    \expandafter\the\IN at output%
    \ifvoid\IN at topfig \else\unvbox\IN at topfig\fi%
    \global\setbox\IN at topfig \vbox{\hbox{Hola!}}
  }
  \makeatother
  
  ...

When I try to compile, TeX goes into an infinite loop.  Not that I've
waited long enough to confirm it's infinite, but it's long, and more
to the point, silent:

  [toms-box:tex/latex/insert] tomfool% latex test.tex
  This is TeX, Version 3.14159 (Web2C 7.4.5)
  (./test.tex
  LaTeX2e <2001/06/01>
  Babel <v3.7h> and hyphenation patterns for american, french, german,
  ngerman, n
  ohyphenation, loaded.
  (/sw/share/texmf/tex/latex/base/article.cls
  Document Class: article 2001/04/21 v1.4e Standard LaTeX document class
  (/sw/share/texmf/tex/latex/base/size10.clo)) (./test.aux) [1]
  Underfull \hbox (badness 1852) in paragraph at lines 138--140
  []\OT1/cmr/m/n/10 `Mortimer, James, M.R.C.S., 1882, Grimpen,
  [2] [3]
  Overfull \vbox (10.0pt too high) has occurred while \output is active
  [4]
  Overfull \vbox (10.0pt too high) has occurred while \output is active
  (./test.aux)

And that's as far as it goes.  We never get past this.  If I hit ^C, I
get this:

  ^C
  ! Interruption.
  <output> ...\fi \global \setbox \IN at topfig \vbox {
                                                    \hbox {Hola!}} }
  l.211 \end{document}
                      
  ? X
  Output written on test.dvi (4 pages, 18672 bytes).
  Transcript written on test.log.


The log is not more informative.  Is there something about re-using a
box that I'm not understanding?  This works fine if I \unvbox a
different box than the one I \setbox, so it isn't the commands
themselves that aren't working, but somehow \setboxing a box right
after I've \unvboxed it in an \output routine is a problem.  Can
anyone tell me what I've done wrong here?

Many thanks,

-tom

 ------------------------
 tomfool at as220 dot org
 http://sgouros.com  
 http://whatcheer.net



More information about the texhax mailing list