# Notes on LaTeX

I wanted to create notes on the LaTeX typesetting language for my own reference. It is not a language I use frequently, but it is something that I use when the need is appropriate.

For example, while I have been waiting for a permanent teaching job, I had decided to typeset material for a proposed Organic Chemistry unit in LaTeX. It is intended for the Grade 11 and 12 University stream, and can be used for advanced courses. The inclusion of over 300 graphics in 64 pages with an auto-generated table of contents, table of illustrations, and so on indicates the incredible power of this typesetting markup language. A document with this many bells and whistles would bring any mortal word processor to its knees.

There is now a shorter companion document of supplementary Organic Chem material that may or may not be used in the course, pending student interest.

This Organic Chemistry "book" is an on-going effort, with its own challenges. As I had been writing this unit, Grade 13 was eliminated from Ontario schools, and the entire system of evaluation was re-vamped. This now means that the publication must be rewritten once again, to account for the new raft of course expectations and marking schemes coming on-stream.

(Aug 6/2006)

For whatever reason, though I have two books on LaTeX, this one important detail is hard to find. Since 2004, I had been using the \RequirePackage tag to adjust the margins, when actually all I needed to do was to use the internal tags to LaTeX. Here is what I did:

% this ought to give 0.5" margins on all sides
\topmargin 0.3in % allows for header
\textwidth 7.5in
\textheight 10in
% default LHS margin is 1in, plus "oddsidemargin", which we'll make negative
\oddsidemargin -0.5in


I made sure that this adjustment was made after including \usepackage{graphicx} just in case there would be any interference.

PostScript in Landscape Mode

Today, I have been updating and correcting the supplementary document. A major problem that came up was in developing a lesson on artificial sweetners. I had already given this lesson to students at night school at Gonzaga, and many showed interest in this, and I had already edited a table summarising the many different sweetners and their relative sweetnesses using Word Perfect for the table and MDL ISIS Draw for drawing the molecular structures.

I couldn't be bothered to have to re-do this thing from scratch in a LaTeX table, so I saved the document in Adobe PDF, read it back into Acrobat, and saved it in PostScript. So far, no loss in resolution. Then it was read into my LaTeX document using the following command:

\begin{figure}[here]
\includegraphics[0.5in,0.5in][7.5in,9.5in]{Artificial_Sweeteners.ps}
\end{figure}


There ended up being a bit of a problem. The original document was in landscape mode, and this was now in portrait mode, so that the table ran off the page. I rotated the page in Acrobat and saved it in PostScript (almost all other ways of doing this resulted in degraded fonts and graphics, regardless of the format it was saved in -- even PostScript). I read it into LaTeX, and the PDF was produced without errors. Under xpdf, it appeared as though the table shrunk to the top of the page, and the page was rotated. But reading my new PDF under Acrobat showed the correct situation. The page is now in landscape, and the page is also rotated.

To get the measurements [0.5in, 0.5in] was a trial-and-error proposition. This coordinate pair sets the points for the top, left corner of the table. The second set was a setting used to set the table in a "bounding box", since LaTeX likes bounding boxes. So I gave LaTeX one that nearly covered the page. I wasn't too concerned about measuring. The docs say that if the box is too small, the graphic will be cropped, but it wasn't in my case.

since Nov 17 2007