Using Latex On Windows: What Is The Intention of This Document?

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

LaTeX on Windows

http://www.pinteric.com/miktex.html

Using LaTeX on Windows


What is the intention of this document?
The intention of this document is to present step-by-step installation of full inexpensive LaTeX system on Windows in a short, but direct and clear way. For those who do it for the rst time it is a must read. The rest might nd it as a useful reminder. Please note, some basic knowledge of computer is necessary. I also suppose that you know basics of LaTeX. If not see The (Not So) Short Introduction to LaTeX2e. I also recommend two great books: Leslie Lamport: LaTeX Michel Goossens, Frank Mittelbach and Alexander Samarin: The LaTeX companion

Why would someone use LaTeX instead of Word in the rst place?

Although Word is a useful and practical tool for writing short and (very) simple documents, it becomes too complex or even unusable when one wants the word processor to do more complicated tasks. Moreover, many rather commonly needed features, like user-customised automated numbering or various automated indexes,
1 of 4 11/07/2012 05:43 PM

LaTeX on Windows

http://www.pinteric.com/miktex.html

cannot be created using Word at all. LaTeX does require more eort and time to learn to use even for simpler tasks, but once learned, dicult tasks can be accomplished rather easily and straightforwardly. Therefore, LaTeX is simpler, faster and better way to produce large or complex documents and the additional eort eventually pays o. Additionally, LaTeX is especially well suited for scientic and technical reports, even shorter ones. Writing only one diploma or master or doctor dissertation will pay o all your additional eort. And not to be forgotten - LaTeX is completely free of charge! If you want to learn more about (dis)advantages of LaTeX, read about Word Processors: Stupid and Inecient by Allin Cottrell.

OK. I want to use LaTeX on Windows. What do I need?


Unfortunately, this is not a trivial question. The whole process will take some time, but much less time than learning LaTeX anyway (if you have clear and simple instructions like below). Namely there are several programs from several places you need to make things working.

1. Text editor
... to create LaTeX documents. You can use any text editor you like! Some text editors are, however, preferred, because they have syntax highlighting, that is program show LaTeX commands dierently than the rest of the text (e.g. dierent colour). See the comparison of TeX editors.

2. PostScript output
... to create EPS graphics for use with LaTeX. (EPS graphics are natural but not exclusive for use with LaTeX.) Your favourite program(s) do not have EPS output? Simply install dummy PostScript printer to your system. You can actually use any PostScript printer you wish, however I recommend free Generic PostScript Printer from Adobe. Now you can simply print from your favourite program(s) to dummy PostScript printer you just have installed, any you will get genuine EPS les. But please beware next three things: During the installation do not forget to choose FILE: as a port to print to (to make it dummy printer). After the installation go open properties of the printer and in Printing preferences/Advanced/Document Options/PostScript Options choose Encapsulated PostScript (EPS) for PostScript Output Option. Every time you create EPS le you have to change .prn extension to .eps extension.

3. LaTeX compiler
... to make real documents out of your LaTeX source le. MiKTeX is a free LaTeX compiler for Windows and its installation is extremely simple. LaTeX compiler produces so called DVI le, which can be then inspected and printed by YAP DVI viewer, which is included in the package.
2 of 4 11/07/2012 05:43 PM

LaTeX on Windows

http://www.pinteric.com/miktex.html

4. PostScript viewer
... to view/print your documents. Of course in general you can inspect and print LaTeX documents using YAP DVI viewer. However, if your document includes EPS graphics, then you need PostScript Viewer. There is a freeware GSView for Windows available! Remember, you have to install both GhostScript and GSView to make latter working! I specify, for the sake of order, the same installation folder (e.g. c:\tex) for all installations and packages!

Great! I have them all installed! Is that all I need to do?


In principle yes. But there are several tricks and settings you will nd useful or inevitable in future use of LaTeX.

1. EPS BoundingBox adjusting.


All EPS les include bounding box data, which dene the frame in which the graphics is located. EPS les created by the procedure explained in the previous section have a bounding box, which usually corresponds to the margins of the paper size. However, usually you want EPS graphics bounding box to be adjusted to real borders of the drawing to get rid of the white margins which choke space in your LaTeX document. You can adjust bounding box by using epstool utility that can be downloaded from the GSView web site. (GSView option File/EPS to PS will do this too, but it is not very reliable.) Create the batch le epscrop.bat:
@echo off c:\tex\epstool-3.08\bin\epstool --copy -b %1.eps %1.tmp.eps move /y %1.tmp.eps %1.eps

Please replace above c:\tex\epstool-3.08\ folder with your own Epstool installation folder. Writing epscrop myfile will adjust very reliably bounding box in myfile.eps.

2. New packages folder.


Sometimes you need to put dierent additional non-standard packages and bibliographic styles to your computer. It is usual that you put packages in \tex\latex \packagename and bibliographic styles in \bibtex\stylename folders relative to your local TeX folder. In older versions of MikTeX local TeX folder was selectable during installation. In newer versions there are two default local TeX folders: C:\Documents and Settings\All Users\Application Data\MiKTeX\X.Y for all users, C:\Documents and Settings\USER_NAME\Application Data\MiKTeX\X.Y for user USER_NAME. X.Y stands for MikTeX version. After adding packages and styles run MikTeX Settings (Options) and refresh FNDB for local TeX folders in the General tab. New packages and styles will be afterward found and used automatically!

3. Inverse search.
While viewing the LaTeXed document with YAP DVI viewer, you might want to edit the specic part of the source document. Inverse search enables you that by double-

3 of 4

11/07/2012 05:43 PM

LaTeX on Windows

http://www.pinteric.com/miktex.html

clicking this particular part in the DVI viewer, you jump directly to the editor in the specic source line! To achieve it you have to do two following things: Tell MiKTeX to put source specials into the DVI le. You do that by specifying the option --src. Tell YAP in Use/Option/Inverse search how to run your LaTeX editor to specic document and line in it. For example, that line for UltraEdit is "c:\path
\uedit32.exe" %f/%l

YAP puts le name instead of %f and line number instead of %l. You should check your favourite editor manual to nd out the right content of the line for you. In case you know the specic lines for other text editors, please send them to me and they will be added to this document. Important! Inverse search does not function well in two-column environment.

4. Compile jump.
While compiling your le with LaTeX, you might want to edit the specic part of the source document, where an reported error has occurred. You can invoke the editor by pressing e in the error menu, provided that you have specied to MikTeX how to run your LaTeX editor to specic document and line in it. You can do that by putting Editor= line in [TeX] section in the miktex.ini. For example the line(s) for UltraEdit are:
[TeX] ... Editor="c:\path\uedit32.exe %f/%l"

MikTeX puts le name instead of %f and line number instead of %l. You should check your favourite editor manual to nd out the right content of line for you. In case you know the specic lines for other text editors, please send them to me and they will be added to this document.

We are done! Happy LaTeXing!


Please report what else would you like to see here, suggestions, new tricks etc. to the author using feedback form. Prevare po povzetju (Slovenian). Created by Marko Pinteric: feedback form. Updated September 18, 2012. Web page has been read by 268718 visitors since September 2004.

4 of 4

11/07/2012 05:43 PM

You might also like