0% found this document useful (0 votes)
40 views

Introduction To L TEX: X Xy X X A A

This document provides an introduction to using LaTeX to write documents with mathematical equations, tables, lists, and figures. It demonstrates how to write equations and mathematical symbols, insert tables and lists, include figures and scale them, display program code, and add references. The document contains many examples of LaTeX commands for formatting different elements of a document.

Uploaded by

gerbatshov
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Introduction To L TEX: X Xy X X A A

This document provides an introduction to using LaTeX to write documents with mathematical equations, tables, lists, and figures. It demonstrates how to write equations and mathematical symbols, insert tables and lists, include figures and scale them, display program code, and add references. The document contains many examples of LaTeX commands for formatting different elements of a document.

Uploaded by

gerbatshov
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

A Introduction to L TEX

c 2006 by Harvey Gould December 5, 2006

Introduction

TEX looks more dicult than it is. It is almost as easy as . See how easy it is to make special symbols such as , , , , sin x, h , , . . . We also can make subscripts 2 b A Ax , Axy and superscripts, ex , ex , and ea . We will use L TEX, which is based on TEX and has many higher-level commands (macros) for formatting, making tables, etc. More information can be found in Ref. [?]. We just made a new paragraph. Extra lines and spaces make no dierence. Note that all formulas are enclosed by $ and occur in math mode. The default font is Computer Modern. It includes italics, boldface, slanted, and monospaced fonts.

Equations
N

Let us see how easy it is to write equations. =


i=1

w i ( xi x )2 .

(1)

It is a good idea to number equations, but we can have a equation without a number by writing xa , P (x) = ba and 1 g= 2. 2 We can give an equation a label so that we can refer to it later.
N

E = J
i=1

si si+1 ,

(2)

Equation (??) expresses the energy of a conguration of spins in the Ising model.1 We can dene our own macros to save typing. For example, suppose that we introduce the macros: \newcommand{\lb}{{\langle}} \newcommand{\rb}{{\rangle}} Then we can write the average value of x as \begin{equation} \lb x \rb = 3 \end{equation} The result is x = 3. Examples of more complicated equations:

(3)

I=

f (x) dx.

(4)

We can do some ne tuning by adding small amounts of horizontal spacing: \, small space \! negative space

as is done in Eq. (??). We also can align several equations: a=b c = d, or number them as subequations: a=b c = d. We can also have dierent cases: m(T ) =
1

(5) (6)

(7a) (7b)

0 1 [sinh 2J ]
4 1/8

T > Tc T < Tc

(8)

It is necessary to process (typeset) a le twice to get the counters correct.

write matrices T= = and A B = P


i

T++ T+ , T+ T e (J +B ) eJ . eJ e (J B ) (9)

dA = P rn

r dV.

(10)

Tables

Tables are a little more dicult. TeX automatically calculates the width of the columns. lattice square triangular diamond simple cubic bcc fcc d q 2 4 2 6 3 4 3 6 3 8 3 12 Tmf /Tc 1.763 1.648 1.479 1.330 1.260 1.225

Table 1: Comparison of the mean-eld predictions for the critical temperature of the Ising model with exact results and the best known estimates for dierent spatial dimensions d and lattice symmetries.

Lists

Some example of formatted lists include the following: 1. bread 2. cheese 3

Tom Dick

Figures

We can make gures bigger or smaller by scaling them. Figure ?? has been scaled by 60%. Figure 1: Show me a sine.

Figure 2: Plot of the Lennard-Jones potential u(r). The potential is characterized by a length and an energy .

Literal text

It is desirable to print program code exactly as it is typed in a monospaced font. Use \begin{verbatim}and \end{verbatim}as in the following example: double double double double double y0 = 10; // example of declaration and assignment statement v0 = 0; // initial velocity t = 0; // time dt = 0.01; // time step y = y0;

The command \verbatiminput{programs/Square.java}\allows you to list the le Square.java in the directory programs.

7
7.1

Special Symbols
Common Greek letters

These commands may be used only in math mode. Only the most common letters are included here. , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

7.2

Special symbols
dy y = lim dx x0 x f (x) y as x x0 f (x) y
xx0

The derivative is dened as

(11) (12) (13)

Order of magnitude: log10 f Approximate equality: f (x) g (x) (16)


A L TEX is simple if we keep everything in proportion:

(14) (15)

f (x) 10n

f (x) x3 . Finally we can skip some space by using commands such as \bigskip \medskip \smallskip \vspace{1pc}

(17)

The space can be negative.

Use of Color

We can change colors for emphasis, but who is going pay for the ink?

Subgures

A As soon as many students start becoming comfortable using L TEX, they want to use some of its advanced features. So we now show how to place two gures side by side.

(a) (b) Real Amand pliimagtude i- and nary. phase.

Figure 3: Two representations of complex wave functions.

We rst have to include the necessary package, \usepackage{subfigure}, which has to go in the preamble (before \begin{document}). It sometimes can be dicult to place a gure in the desired place. Your LaTeX document can be easily modied to make a poster or a screen presentation similar to (and better than) PowerPoint. Conversion to HTML is straightforward. Comments on this tutorial are appreciated.

References
A [1] Helmut Kopka and Patrick W. Daly, A Guide to L TEX: Document Preparation for Beginners and Advanced Users, fourth edition, Addison-Wesley (2004).

[2] Some useful links are given at .


Updated 5 December 2006.

You might also like