Date: Sat, 13 Jul 2002 10:00:37 -0400

Author: James Frysinger

Subject: Lab Manuals in LaTeX (long winded)

Post:

I was asked off-list about my setup and procedures for doing the lab manuals
in LaTeX, especially regarding the inclusion of artwork. Perhaps others might
be interested in my experiences so far, so I'll post a long synopsis here.
I'm doing this within a linux operating system but I believe that everything
I say here can also be done in Mac or Windows, with the appropriate software.
The main difference is that the software comes free with the linux
distribution, which one may freely obtain without violating license
restrictions. (In otherwords, you are free to use a friends installation
disks; explicit permission is given by the distributor.)

First of all, why did I decide to go with LaTeX? I got tired of crashes and
problems with equations, figures, and tables. After writing a 93 page thesis
in Word, I had had my fill. LaTeX's limits are seemingly beyond concern;
there are limits, but the authors of the books on LaTeX used it to write
their books and they didn't "hit the wall" even though they tried to show all
the fonts, formats, styles, and whatever that they could. My task is less
daunting so I figured I was safe.

I am using a GUI called LyX to write the LaTeX files on my linux operating
system. The class I chose is "book" and my procedure is to make each lab a
"chapter". That ensures that each lab procedure starts on a new, right-hand
page with a clean appearance to the title and a modestly generous bit of
white space to set it off. I set my options to do "odd-even" (or "two-page")
formatting so that a bit of extra space is added to the inside margin for
binding. Within each chapter I have four levels of headings available
(section, subsection, subsubsection, and subsubsubsection) with or without
heading numbers being provided automatically. (I chose not to have headings
numbered.) Page numbering is automatic and, by inserting commands into the
LaTeX preamble, I can control various things such as whether to use arabic or
roman numerals, use chapter+page numbering (but only if chapters get
numbered), and so forth. (My introductory, general material of 30+ pages is
one document of 60+ pages with arabic page numbers and the labs are in
another with roman page numbers, but I could combine these and do a numbering
restart and style shift on the fly.)

To enter the text, I did a cut and paste of the original texts from their
Word-formatted documents as pulled up into my StarOffice. Then I went through
and hit "Enter" as appropriate to get the paragraph starts correct and to put
headers on their own lines. Using the environment selection menu I then
formatted the headings as appropriate to one of the four previously mentioned
heading levels. At this stage and while doing the following, I am extensivel
rewriting much of the original so most of the hard work is in editing, not
document formatting.

I am building the equations by hand, using the math editor in LyX. Eqautions
may be in-line or "display" and if displayed may be numbered or not. Using a
table along with the equation editor allows me to build stacked equations and
also equations continued to the next line.

Likewise, I am building the tables by hand, using the tabular tool. In LyX, I
have the option of entering tables and figures firmly fixed where entered or
as "floats". Overall I have set float priorities as !htbp. For non-LaTeX
users, that means the location priorities are HERE, top, bottom, and separate
page---in that order.

For graphics, I went through the Word-formatted documents in Word on a
Windows machine and picked them off by a single left-click, which then let me
past them into Paint and save as TIFF files. Back in linux, I used the GIMP
to open these TIFF files, cropped them, and saved them as encapsulated
postscript files. Then, in my "book", I entered a figure float and inserted
the figure filename (*.ps) and caption. I can resize, rotate, and so forth
easily. I have not experienced any graphics problems as I used to see in
Word, with figures "blowing up", going off to parts unknown, slipping back
behind some invisible screen, or whatever. It takes me roughly 30 to 60
seconds to convert a TIFF file to eps in the GIMP and to insert it into my
document, along with my desired caption. Figure numbering is automatic. Dang,
it works!

For one lab procedure, which I wrote separately, I used xmgrace to draw the
graphs from data files in ascii format. This xmgrace is profoundly powerful
as a graphing tool, allowing TeX-style editing of legends, titles, and labels
as well as providing vast regression-fitting capabilities (one can write the
equation desired for the regression line to be fitted, for example). It, too,
will save graphs in a few dozen different formats, including eps.

To view my document on the screen as I work, I can select "view in DVI" from
LyX, which then ports it through dvips to xdvi (a dvi file displayer). Some
here may not know that "dvi" is a device-independent file format. I can also
export my LyX document to a LaTeX file format (*.tex) or to PDF (*.pdf), as
well as ascii, etc. LyX has its own document format and extension (*.lyx).

I'm self-taught on all this. LyX comes with well-organized tutorial and user
documents that are viewed right in the LyX window. These can be searched
using "Find" or by using the table of contents, which is hot-linked. I also
got some books after I had done this long enough to know that I have finally
found a word processing program and method that meets my wide-ranging needs.
(I also help to write and edit standards for IEEE.) Using LyX gave me the
ability to do the basics with about 30 minutes of study and to add skills and
techniques to my bag of tricks as I felt the need to read up on and try them
out. It has document classes that range from letters, to journal articles
(IEEE, AIP, AAS, AM[ath]S, etc.), to books with several others thrown in.

Hard-core, devout hand-coders seem to like emacs for writing LaTeX code, but
that requires more extensive pre-knowledge of LaTeX and emacs itself has a
longer and steeper learning curve. I recommend LyX (or similar program) for
the neophyte such as I. One can even use TeXCad to draw figures directly in
eps format, I'm told. Other graphics programs such as xfig and dia (for
circuit diagrams!) look good. But the GIMP is like Draw, Paint, Photoshop,
and Illustrator all in one---and it too is free, as are xmgrace, dia, and
xfig.

All of the above can be done on other operating systems, I am told. Of course
that may require expenditures for shareware fees or for the programs and
licenses themselves, whereas all this stuff comes on the SuSE linux
distribution disks. A couple of years ago, I converted my computer to
dual-boot and installed linux as a means to develop some unix skills. I
promised myself that I would boot up linux at least every other week to work
on it for an hour or so. After I did that the third time, I realized one day
that it had been two months since I had booted up the Windows side of my
machine. Sorry, Bill.

Now, I can sit at any of my machines (one at home, two on campus) and work
back and forth via secure shell (ssh). (Others prefer VCN.) I rarely carry
files around on floppy disks, zip disks, or CDs anymore. Also, I can now
leave my machines running (which is nice since I have some of them processing
meteorology data around the clock) without them crashing periodically and
with greatly reduced odds of being hacked. Caveat: only an off-line machine
with no keyboard and no way to insert disks is totally hackproof; it's even
safer if it's turned off.

\begin{rant}
One odd bit that doesn't fit into the above. Mac LaTeX on OS X seems to have
gone whole-hog to PDF-LaTeX instead of the more standard and universal
format. I suppose that's Mac's philosophy: decide what is best for the user
and don't let them do anything else. Sorry, Steve.
\end{rant}

Jim

--
James R. Frysinger
Lifetime Certified Advanced Metrication Specialist
Senior Member, IEEE

http://www.cofc.edu/~frysingj
frysingerj@cofc.edu
j.frysinger@ieee.org

Office:
Physics Lab Manager, Lecturer
Dept. of Physics and Astronomy
University/College of Charleston
66 George Street
Charleston, SC 29424
843.953.7644 (phone)
843.953.4824 (FAX)

Home:
10 Captiva Row
Charleston, SC 29407
843.225.0805

Back