LaTeX Tips

Because I often struggle with things in LaTeX that are not very easy to find out when you're new at it, I decided to publish some tips as a reference for myself and others... 


Table of Contents

  1. How do I display images in LaTeX ?
  2. Where can I find answers to my LaTeX questions ?
  3. How do I use LaTeX in a Windows environment ?

How do I display images in LaTeX ?

eps

There are many ways of displaying images in LaTeX, but the use of eps images (Encapsulated PostScript) seems to be the safest option. You need to convert your images to eps-format using a imaging program, e.g. Photoshop. It is a bad idea to save a thumbnail/preview with the image, because it will get you into trouble when you import the image in LaTeX, so select "Exclude Non-Image Data"/"No thumbnail" when you save the image as eps. 

The commands below has the options width, height, angle and scale, e.g. height=1cm, width=3in, angle=90 and scale=0.5.

epsfig

he \epsfig method in the epsfig package is good and easy. At least it works... 

The code for a sample document with an eps image:

\documentclass[12pt]{report}
\usepackage{epsfig}

\begin{document}

\begin{figure}[htb]
\centerline{\epsfig{figure=figure.eps,height=1cm,width=3cm}}
\caption{figure.eps}\label{fig:eps}
\end{figure}

\end{document}

graphicx

The \includegraphics command in the graphicx package also works and seems to be the recommended one:

\documentclass[12pt]{report}
\usepackage{graphicx}

\begin{document}

\begin{figure}[htb]
\centerline{\includegraphics[height=1cm]{figure.eps}}
\caption{graphicx.eps}\label{fig:gfx}
\end{figure}

\end{document}

Back to Top

Where can I find answers to my LaTeX questions ?

There's lots of info about LaTeX on the web, but not very structured or complete, and hard to find what you need without being given a very technical explanation. And once you understand it - it was not what you needed...

Here's some links to LaTeX info that I have found helpful...

LaTeX resources

Back to Top

How do I use LaTeX in a Windows environment ?

Programs for writing LaTeX in a windows environment:

PCTeX v4.0 - www.PCTeX.com 
Not free ($279/400). Self-contained, easy to install and use, but lacks functionality. It also has as strange way of displaying pictures that does not work in other programs like MiKTeX. Is does not generate PS or PDF. Not recommended.
MiKTeX v2.0 - www.MiKTeX.org 
LaTeX compiler, updated Jan 2001. Free. You will usually want an external editor, like WinEdt or Emacs, although you can also use it from the command prompt.
WinEdt - www.WinEdt.com 
Good functionality, well integrated with MiKTeX to use most functions. YAP dvi previewer. Good spellchecker. The project functionality is useful. Shareware $40. It also supports generating PS and PDF files and open them by pressing a button, provided that you install Ghostscript/GSview and/or Acrobat Reader (and tells it where you installed them). 
Acrobat Reader 4 - www.adobe.com 
If you have Acrobat reader installed you can view pdf versions of your documents by pressing a button in WinEdt after generating them with dvi2pdf.
GhostScript 6.50 / GSview 3.6 - www.cs.wisc.edu/~ghost/
With GSview you can view your PostScript documents by pressing a button in WinEdt after generating them with dvi2ps. GSview requires that you also install GhostScript.

Installation procedure:

Troubleshooting: 

If the ghost or acrobat buttons aren't working after you have used dvi2ps or dvi2pdf, make sure the paths to GSview and Acrobat is correct. If all else fails you can try adding these lines to the end of WinEdt's startup.edt file:
    Assign('GSView','C:\Ghostgum\gsview\gsview32.exe');
    Assign('AcroRead','"C:\Program Files\Adobe\Acrobat 4.0\Reader\AcroRd32.exe"');

Back to Top

What is the next question ?

This is the answer to the question.

Back to Top

Author: Terje Kvambe.
Copyright © 2001 www.Kvambe.com.
Revised: February 21, 2001 .