Crash Course in LaTeX

Workin' It: Drawing Pictures

Why draw pictures? We can only type words and symbols for so long before we need a good diagram to explain things. This means one of two things:
  1. Insert a graphic (like jpg, png, gif) created using another program, like Diana.
  2. Draw within LaTeX using the "picture" environment, like graph

Inserting pictures can be useful, but graphics look bad when you change their size.  This doesn't matter much for photos but for graphs (like the one shown above) it makes them unreadable.

How can I draw pictures? You can create simple charts and graphs "by hand" using the picture environment, but it's not at all user friendly -- it's practically programming.  I've discovered an easier way to do it using a free Java program called jPicEdt. Download this small free safe (though I make no guarantee myself) program to your Desktop, then just double-click to install it.  After installation, you can delete the file you downloaded.


Overview of drawing pictures using jPicEdt:

  1. Use jPicEdt to draw a nice picture.
  2. Save it as a file in the same directory as your LaTeX source file.
  3. Add \usepackage{pst-all} to header and \input{picturefilename} where you want the picture in your source.
  4. Compile with latex, then dvips, then ps2pdf to generate a PDf file.
Check out my sample files: download this tex file and this jpc file, then compile to get this sample PDF

Details of drawing pictures using jPicEdt:

  1. Use jPicEdt to draw a nice picture.
    This is pretty easy.  You can't do everything you might want, but shading, shadows, dotted lines and curves are easy.
  2. Save it as a file in the same directory as your LaTeX source file.
    For example, if my source file is foo.tex, I'll call my pictures for that document foo-pic1.jpc, foo-pic2.jpc, etc.
  3. Add \usepackage{pct-all} to header and \input{picturefilename} where you want the picture in your source.
    For example, to add foo-pic1.jpc centered horizontally, add the header line and the line
    \begin{center}\input{foo-pic1.jpc}\end{center}
  4. Compile with latex, then dvips, then ps2pdf to generate a PDF file.
    It is essential that at some point the file be a .ps (postscript file) because the drawing commands use PostScript. Compiling this way will work. Other ways might work. Deviate at your own risk.

Drawing Game Trees

One very specialized thing I do as part of my writing is draw tree diagrams of formal models, or "games". Some folks like sgame and egameps offered by Martin Osborne. These tools are easy to use, but don't support all the features I need (like a "fan" for a continuous choice) and the results are not as pretty as it could be.

I use PSTricks to draw game trees. The main features I use are the "Trees" commands. The results are pretty and I can draw just about anything. It's more work than some other options, but it's worth it to me.

To make your life easier, you can start with some samples [tex, dvi, pdf] of trees I've drawn.