Using LaTeX on Windows

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 first time it is a must read. The rest might find 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 first place?

Lucija

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, cannot be created using Word at all. LaTeX does require more effort and time to learn to use even for simpler tasks, but once learned, difficult 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 effort eventually pays off. Additionally, LaTeX is especially well suited for scientific and technical reports, even shorter ones. Writing only one diploma or master or doctor dissertation will pay off all your additional effort. 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 Inefficient 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 differently than the rest of the text (e.g. different colour). See the list of freeware and shareware LaTeX shells for Windows.

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 files. But please beware next three things:

  • During the installation do not forget to force printer to Print to file (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 file you have to change .prn extension to .eps extension.

3. LaTeX compiler

... to make real documents out of your LaTeX source file. MiKTeX is a free LaTeX compiler for Windows and its installation is extremely simple. Remember what local TeXMF directory did you specified! LaTeX compiler produces so called DVI file, which can be then inspected and printed by YAP DVI viewer, which is included in the package.

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 recommend, for the sake of order, that you specify the same installation directory (e.g. c:/gs) for both 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 find useful or inevitable in future use of LaTeX.

1. EPS BoundingBox adjusting.

All EPS files include bounding box data, which define the frame in which the graphics is located. EPS files 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 is included in GSView package. (GSView option File/EPS to PS will do this too, but it is not very reliable.) Create the batch file epscrop.bat:


@echo off
c:/gs/gsview/epstool -b -c -o%1.tmp.eps %1.eps
move /y %1.tmp.eps %1.eps

Please replace above c:/gs directory with your own GSView installation directory. Writing epscrop myfile will adjust very reliably bounding box in myfile.eps.

2. New packages directory.

Sometimes you need to put different additional packages and bibliographic styles to your computer. It is usual that you put packages in /tex/latex/packagename and bibliographic styles in /bibtex/stylename directories relative to your local TeXMF directory. After that run MikTeX Options and refresh FNDB for local TEXMF directory in the Roots tab. After that added packages will be found and used automatically!

3. Inverse search.

While viewing the LaTeXed document with YAP DVI viewer, you might want to edit the specific part of the source document. Inverse search enables you that by double-clicking this particular part in the DVI viewer, you jump directly to the editor in the specific source line! To achieve it you have to do two following things:

  • Tell MiKTeX to put source specials into the DVI file. You do that by specifying the option --src.
  • Tell YAP in Use/Option/Inverse search how to run your LaTeX editor to specific document and line in it. For example, that line for UltraEdit is "c:/path/uedit32.exe" %f/%l

YAP puts file name instead of %f and line number instead of %l. You should check your favourite editor manual to find out the right content of the line for you. In case you know the specific 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 file with LaTeX, you might want to edit the specific 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 specified to MikTeX how to run your LaTeX editor to specific 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 file name instead of %f and line number instead of %l. You should check your favourite editor manual to find out the right content of line for you. In case you know the specific 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.

Created by Marko Pinteric.

<script type="text/javascript"> </script> Updated February 24, 2005. Number of visitors since September 2004: [counter].

Valid XHTML 1.0! Valid CSS!

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值