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...
- How do I display images in LaTeX ?
- Where can I find answers to my LaTeX questions ?
- How do I use LaTeX in a Windows environment ?
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}
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
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:
- Download and install MiKTeX (level 1-4 + update)
- Unzip the files to a Temp directory
- Run setupwiz.exe and follow on-screen instructions
- Install the update MT20UP1.EXE
- Set the path:
- In win9x: Add the line set PATH=c:\program files\miktex\bin;%PATH% to your
autoexec.bat file.
- In win2000:
- Open System in Control Panel
- On the Advanced tab, click Environment Variables
- Add c:\program files\miktex\bin to the PATH variable if it is not there already.
- Restart the computer!
- Download and install WinEdt
- Run WINEDT5.EXE
- Configure WinEdt to your preferences (dictionary, layout, project)
- Download and install Adobe Acrobat Reader if you need it.
- Download and install GhostScript and GSView if you need it.
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"');
This is the answer to the question.
Author: Terje Kvambe.
Copyright © 2001 www.Kvambe.com.
Revised: February 21, 2001
.