Sunteți pe pagina 1din 7

A A Simple Introduction to L TEX Yau Ching Koon Second edn.

, March 13, 2013

Introduction

AT X (read as latech) is documentation markup language and also a document preparation system. L E AT X is an evolution from T X, which was originally created by Donald E. Knuth (1938) and written L E E into a more useful form by Leslie Lamport (1941) in the 1980s. Mathematical typesetting for pub-

lication standards are known to be painstaking for centuries. Unlike ordinary texts, mathematical typesetting often involves one to place characters in rather unusual position, viz. x2 , x i , uncommon characters not readily available in ordinary keyboard, viz. A B, a R,
x y

and using

x d x. For those rea-

sons and more, the labour involved in the preparation of mathematical texts had been very expensive especially before personal computers becomes more readily available. Today, the preparation is almost free! With the advent of computers in the 1960s, one naturally would like to make use the computer to prepare mathematical texts. Unfortunately, the earliest computers were operated in command-line environment and only a limited amount of characters available on the keyboard that can be used, i.e., alphabets, Arabic numerals, some common punctuation and parenthesis only. It was a difcult task but Donald E. Knuth gave a brilliant solution. First, he created a mathematical environment in which
AT X, we all text that lies within the environment is interpreted as a mathematical input. In modern L E

use the dollar sign ($) to dene the opening as well as closing of the environment. For example, the fraction
x y

is obtained as

$\frac{x}{y}$
Note that back-slashes are used to call various commands. String of characters that follows the backAT X. More examples are shown below (Please dont slash are interpreted as a form of command in L E

try to memorize everything at the moment, I am interested only to show some extremes of the possibilities available.). As a joke, the dollar sign is used to dene a mathematical environment because mathematical typesetting are expensive! 1

$x^2$ $\displaystyle\sum_i\frac{\partial y}{\partial x_i}$

x2
y
i

xi
0

$\displaystyle\int^0_{-\infty}\frac{x}{e^x+1}\;\text{d}x$

x ex + 1

dx

As one may observe, regardless of the complexity in nal mathematical output, the input can be surprisingly reduced to texts utilizing the characters available on the keyboard only!

A The Unique L TEX

AT X is substantiated by being the most preferred format of submission for publiThe attractiveness of L E

cation in leading journals on mathematics. Most journals in physics and some in chemistry (especially
AT X as a format for submission. In fact, one of the leading mathphysical chemistry) also accepts L E AT X. Also, most ematical society, the American Mathematical Society (AMS) holds the copyright to L E AT X mathematical equations displayed in Wikipedia, the world largest encyclopaedia, are input using L E AT X over Microsoft format though with little modications. These are several other reasons to choose L E

Word (as a comparison):

A A L TEX has the better output. L TEX is not WYSIWYG (What You See Is What You Get). All inputs will be compiled before the output (usually in the form of portable document format, pdf) is produced.

This allows the entire text to be consider and proper formatting and spacing are given to the entire text
AT X. For example the use of to produce the best visual output. There are many other visual details in L E

ligature to produce and from fl and fi respectively (inspect carefully and you will discovered that the characters are combined). Others include hyphenation, paragraph spacing, line spacing and kernel are perhaps less obvious.

AT X are typed and saved in the format .tex. Then, the .tex A L TEX is fast. The main documents in L E le will be compiled into the output .pdf le. In this process one just need to deal with a small simple

plain text le. This off course would be faster in terms of loading, amending, saving, transferring, and sharing the le compared to other bulky documents.

A L TEX is stable.

AT X was set by Leslie Lamport perhaps in the 1980s. As The core programming of L E

a rule, no one can alter the core programming except Lamport himself. So, if no one else is allowed to
AT X, L change the core programming of L E ATEX will unlikely to change at least in essence. Furthermore,

even if the core programming were to be changed, your original .tex le are still interpretable uniquely. To exemplify this point, we may perform a simple test. Try to open a non-empty (i.e., save some text in it) Microsoft Word document with Notepad! Youll discover that your original text is totally lost. 2

Your simple .docx le is lled with characters that you yourself could not interpret. Try again on a .tex le and you will nd that the you are reading the le you have saved as .tex! (You may lost some spacings and formatting that ease your own reading but those spaces are not recognised in the compilation.) Furthermore, another persistent problem with Word would be the different version and hence the extension, viz. .doc for Word 2003 and before while .docx for Word 2007. So, if one is operating only with Word 2003, he or she would not be able to read a document prepared with Word 2007.

A L TEX is not rigid.

One can load many packages (developed by anyone) into your document. For

AT X comes with its own bibliographic system but if required, one may use another biblioexample, L E graphic system developed by another author (usually by the journals) by just calling the package into

the document. This will render the bibliographic output correctly.

A L TEX is developed for mathematics in mind! This is just like having a tailor-made coat, tuxedo,

evening gown, etc. and not something already available in sizes S, M, L, etc. Certainly, most of common documentation preparation software is not written for that purpose in mind!

A L TEX is free.

A Getting L TEX

A If youre convinced with L TEX, you need to download two software from (This is my preferred choice. You can nd more in the Internet and use them if your are comfortable with them.):

Package Manager MikTEX http://www.miktex.org/2.9/setup Download Basic MikTEX 2.9 Installer (see Figure 1) and then install. Keep the default settings. A package manager manages all the packages described earlier. The documentation and description on all of the packages is available at http://www.ctan.org. The packages are downloaded into your computer using the package manager. Each package can supply features such as language support (e.g. Chinese), fonts, symbols, formatting, etc.

A L TEX editor TEXmaker http://www.xm1math.net/texmaker/download.html

Download the executable le .exe for Windows (see Figure 2) and then install. Keep the default settings.

Figure 1: To download MikTEX 2.9 Installer, click on the Download button. You may choose any mirrors as you wish.

Figure 2: To download TEXmaker, click on the link.

AT X editor is just like another Notepad but the software contains several other important and AL E

fancy stuffs (often useful) like the compiling command, colour support (to differentiate command from texts), dictionary, etc.

AT X nowadays. Youll just need to create an On-line options There are several sites that support L E account without the haste of installing anything. All your documents can be prepared on-site though

I wouldnt recommend it for very large documents (say something more than 50 pages) because the loading time (which depends on your internet speed) will be very long. The on-line option is certainly
AT X. good for those who intend to try L E

AT X. https://www.sharelatex.com/ 1. ShareL E

2. ScribTEX. http://www.scribtex.com/ 3. MonkeyTEX. http://monkeytex.bradcater.webfactional.com/ 4. VerbTEX, available in Android.

A Starting with L TEX

To begin with, run your TEXmaker. Then, create a new le (see Figure 3).

Figure 3: To create a new le. 5

AT X is not a WYSIWYG word processor. The characters that you key into the text editor is not L E AT X has commands and environments that must be declared in order to the nal form of the output. L E function. So next, key in the most basic commands:

\documentclass{article} \begin{document} Hello World! \end{document}


and save your le (see Figure 4). Make sure the name of your le does not contain any spaces (e.g., onetwo.tex is allowed but not one two.tex).

Figure 4: To save a new le. Click on the arrow next to Quick Build (see Figure 5) and observe the result! The rst line denes the type of document (available as article, report, or book). Then, an environment called the document is dened with

\begin{document}
Anything written in between the commands will appear in the document. Nothing will appear if the text is written outside the environment. Since this article is meant to be just a simple communication, Ill keep this article short and the reader is recommended to read other texts listed below for further
A insights regarding L TEX.

AT X. Figure 5: To run L E

Recommended references and links


1. TEX User Group (TUG). Ask anything in the group, someone might just answer to your problems. http://www.tug.org
A 2. Online L TEX tutorial.

http://www.tug.org/tutorials/tugindia/
A 3. Online L TEX tutorial with an interesting online TEXeR.

http://www.artofproblemsolving.com/Wiki/index.php/LaTeX:About 4. Michel Goossens, Frank Mittlebach, Sebastian Rahtz, Denis Roegel and Herbert Vo (2008). The
AT X Graphics Companion, second ed. Addison-Wesley: Upper Saddle River, NJ. L E AT X Web Companion. Addison-Wesley: 5. Michel Goossens and Sebastian Rahtz (1999). The L E

Boston, MA.
A 6. Helmut Kopka and Patrick W. Daly (2004). Guide To L TEX, fourth ed. Addison-Wesley: Boston,

MA.
AT X: A Document Preparation System, second ed. Addison-Wesley: 7. Leslie Lamport (1994). L E Boston, MA. AT X Companion, second ed. Addison Wesley: 8. Frank Mittelbach and Michel Goossens (2004). The L E

Boston, MA.

S-ar putea să vă placă și