Chase’s Tips for LaTeX

 

Here is a collection of guerilla tactics I have employed to get LaTeX to do what I want.     

 

1. Inserting Graphics

2. Commutative diagrams
3. LaTeX into HTML

 

 

How to Insert Graphics into a LaTeX Document: 

Step 1: In the preamble of your LaTeX file, include the graphicx package by typing \usepackage{graphicx}

 

Step 2: Create your graphic and save as a postscript file.

 

Here is a simple example using Maple to create a plot and save the image as a postscript:

 

1. First, create your plot and view it to make sure it’s what you want to include.

 

 

                   (I choose the plot color = black to make printing easier, Maple displays the plot as red by default.)

 

                   2. Then create the postscript by typing in the same worksheet:

 

plotsetup(postscript, plotoutput=’filename.ps’, plotoptions = noborder, height = 300, width = 300);

 

…execute, then reissue the plot command. Instead of a plot showing, Maple saves the plot image as a postscript filename.ps somewhere (usually the same directory Maple is working out of).  I have set the plotoptions = noborder to get rid of the border that is sometimes included in the image. The other options height = 300, width = 300 set the size of the image in postscript points (1 in. = 72 postscript pts).

 

Step 3: Save filename.ps in the same directory the LaTeX document is working out of (wherever the .tex, .dvi, .bak files are saved).

 

Step 4: Include the graphic at the appropriate place in your document by typing:

 

\includegraphics{filename.ps}

 

Note: There are many options for the \includegraphics command in LaTeX, you can rotate the picture through an arbitrary angle, scale by a factor, and adjust the bounding box. Here is a guide to some of these options: How to use graphicx.

 

_top

 

Commutative Diagrams

 

A commutative diagram is a pictorial way of representing a finite collection of sets (usually with some structure, i.e. topological spaces, groups, etc) and some mappings between them (continuous maps, homomorphisms, etc.)

 

 

LaTeX into HTML

 

 The only way I have found to convert LaTeX into HTML is to use the latex2html converter available on our unix system.  I really don’t understand how any of it works, but I managed to produce some examples by rubbing two sticks together. Running the command is easy. This is what I did.

 

1. Place your file.tex in the current working directory.  It is a good idea to compile it first to make sure it looks like what you want display.

 

2. At the prompt, type latex2html file.tex

 

3. When you hit enter, it generates a file (under the same name as your tex document) with the html structure inside of it.  This is a black box to me.

 

4.  Because I don’t know the correct thing to do with the produced file, I managed to get the math into my html document by finding the graphic img1.png which contains a picture of the compiled document. Then I just inserted the picture directly into this document. For example

 

    

 

You can see here that the diagonal lines did not show up very well (and sometimes don’t show up on the dvi using \xypic either), and there is some loss of resolution.

 

Here is some calculus and an example with straight vertical lines. 

 

 

_top