[lug] looking for TeX viewer/print

J. Wayde Allen wallen at lug.boulder.co.us
Tue Aug 28 09:26:05 MDT 2001


On Mon, 27 Aug 2001, D. Stimits wrote:

> Ok, this seems to be some sort of autodetect now. The sample resume I'm
> using contains this:
> \documentstyle[line,margin,fancyheadings]{res}
> 
> If I change it to:
> \documentclass[line,margin,fancyheadings]{res}

I believe the problem has to do with the difference in options between the
\documentstyle and \documentclass commands.  I don't believe that you can
use these options [line, margin, fancyheadings] with the \documentclass
command.  I just checked the \documentclass options in my Lamport book,
and none of these are listed.

> So I tried going back to documentstyle instead of documentclass. But
> then if I try "\usepackage{color}", it dies instead with:
> ! LaTeX Error: LaTeX2e command \usepackage in LaTeX 2.09 document.

Yes, because you start with a \documentstyle command the system enters
compatibility mode and tries to interpret the document as if it were a
LaTeX 2.09 document.  \usepackage{color} is not a valid LaTeX 2.09
command, and so it dies.  The following except is pretty descriptive.

> This is a LaTeX 2.09 document, but it contains \usepackage.
> If you want to use the new features of LaTeX2e, your document
> should begin with \documentclass rather than \documentstyle

> So it seems that I'm damned if I do, and damned if I don't (should I
> want to use color). It seems that I'll have to figure out changes to
> syntax that have come into being since the creation of the original
> template I'm trying to use. Else give up on color (and I'm not tempted
> to live with broken functionality, I use linux when I expect things to
> eventually work right, and win when I give up on any hope).

It isn't a damned if you do and damned if you don't problem.  It is simply
a cross version compatibility issue.  As I see it you have four options:

   1.  Use the template you found, but remain consistent with LaTeX 2.09
       commands.

   2.  Tweak the template for the newer LaTeX2e system

   3.  Find a newer template.

   4.  Develop your own form that doesn't rely on an older format

My personal preference, and what I've already suggested is to use a
standard document class and tweak the formating to your needs.  An example
of me doing this for a NIST calibration report is as follows.  (This also
shows the LaTeX2e use of the fancyheadings command.)

-----------------------------------------------------------------------------
\documentclass[notitlepage]{report}


\usepackage{supertabular}        % Allow for multiple page tables of data
\usepackage{fancyheadings}       % Allow for header and footer
modification

\setlength{\parindent}{0pt}      % Block Paragraphs
\setlength{\parskip}{1ex}

\pagestyle{fancyplain}                % Setup page layout

\lhead{\fancyplain{}{RF Power Sensor\\
                     Bird Electronic Corporation\\
                     Model xxxx, Serial No. xxxx}}

\cfoot{\fancyplain{}{}}

\lfoot{\fancyplain{
                     \begin{tabbing}
                        012345678901234\=   \kill %set tab
                        Test No. \>813xxx\\
                        Date of Test: \>August 25, 1999\\
                        Reference: \>CCG Project \`Rev. 001\\
                        Page {\thepage} of 21
                     \end{tabbing}
                  }
                  {
                     \begin{tabbing}
                        012345678901234\=   \kill %set tab 
                        Test No. \>813xxx\\
                        Date of Test: \>August 25, 1999\\
                        Reference: \>CCG Project \`Rev. 001\\
                        Page {\thepage} of 21
                     \end{tabbing}
                  }}


\begin{document}

\title{\small{U.S. DEPARTMENT OF COMMERCE\\
       NATIONAL INSTITUTE OF STANDARDS AND TECHNOLOGY\\
       ELECTRONICS AND ELECTRICAL ENGINEERING LABORATORY}\\
       Boulder, Colorado\\[2 ex]
       \huge{\bfseries{REPORT OF SPECIAL TEST}}}

\date{}                      % No Date
\author{}                    % No Author
\maketitle

\setlength{\headsep}{0.5in}
\setlength{\headheight}{0.5in}   
\setlength{\footskip}{0.5in}

\begin{center}
   \textbf{RF POWER SENSOR}\\
   Bird Electronic Corporation\\
   Model xxxx, Serial No. xxxx
\end{center}

<snip> ...

------------------------------------------------------------------------

I put this together to copy the layout of the calibration reports that had
been originally created using WordPerfect.  As such it is pretty free
form, and there are as you can see, a lot of special formating commands
needed to tweak the default report documentclass to match what was
originally created using a word processor.  What is really cool about this
little file is that it only took maybe half a day to create, and once I
had it working I could then setup my data analysis code so that it would
simply write this file out.  This allowed me to almost completely automate
the report generation for the RF 1kW calibration system.  I say almost
since I had to run the report once to figure out how many pages it
created, and then edit the file by hand to make it read page x of y.  
Always, figured I could write a script to automate that too.

Anyway, I pretty much always just use the standard article or report
document classes, and adjust the formatting as needed.

- Wayde
  (wallen at lug.boulder.co.us)




More information about the LUG mailing list