The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Monday, February 04, 2002

Playing with TeX

To keep myself preoccupied, I spent way too many hours trying to get TeX to output a document in a very particular format.

My current ongoing project now involves generating a vast number of pages (around 1,400 or so) of summary information (one of the reports being summaried itself was nearly 400 pages in length). The amount of summary data per report is small enough that with a small enough font (around 7pt it seems like) we can fit four summaries per page, thus keeping the page count down to around 1,400 pages (there are a lot of reports). Each summary has a particular layout so I thought it should be relatively easy to get TeX to generate the output.

Eight hours later I realize that I don't know enough TeX to even begin to start this project. For instance, one example of getting two column output is:


\let\lr=L \newbox\leftcolumn
\output={\if L\lr
    \global\setbox\leftcolumn=\columnbox \global\let\lr=R
  \else \doubleformat \global\let\lr=L\fi
  \ifnum\outputpentalty>-20000 \else\dosupereject\fi}
\def\doubleformat{\shipout\vbox\{\makeheadline
    \fullline{\box\leftcolumn\hfil\columnbox}
    \makefootline}
  \advancepageno}
\def\columnbox{\leftline{\pagebody}}

Provided you set \hsize to the width you want a column (\hsize being the horizontal width you are pumping text into). Oh, and don't forget to change \makeheadline and \makefootline to expand across the entire page instead of using the current setting of \hsize.

I shouldn't really fault for TeX for this. It really is quite powerful, but the learning curve is somewhat (okay, overwhelmingly) steep. For basic jobs it's not that hard, and there are even preprogrammed macros to do academic papers (like LaTeX). But the example TeX code is very dense reading.

I'll have to play around with this more later.

Obligatory Picture

[It's the most wonderful time of the year!]

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site: http://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

http://boston.conman.org/2000/08/01

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2019 by Sean Conner. All Rights Reserved.