Docsity

LaTeX 2, Apuntes de Matemáticas

Toggle sidebar
bg1
L
A
T
E
X 2
"
The maro pakage for T
E
X
by
Leslie Lamport et al.
Edition 1.6
Deember 1994
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48

Vista previa parcial del texto

¡Descarga LaTeX 2 y más Apuntes en PDF de Matemáticas solo en Docsity!

LATEX 2 "

The ma ro pa kage for TEX

by Leslie Lamp ort et al.

Edition 1.

De emb er 1994

This is edition 1.6 of the LaTeX2e do umentation, and is for the Texinfo that is distributed as part of Version 19 of GNU Ema s. It uses version 2.134 or later of the `texinfo.tex' input le.

This is translated from LATEX.HLP v1.0a in the VMS Help Library. This pre-translation version was written by George D. Greenwade of Sam Houston State University. It has b een edited to this form by Paul Nothard of Edinburgh University.

The original (latex.texi and latex2.texi) was distributed by Stephen Gilmore <stgd s.ed.a .uk>, August 26th 1993.

Version 1.1 was made by Piet van Oostrum <piet s.ruu.nl> on De 14, 1993 by merging and leaning up latex.texi and latex2.texi.

Versions 1.2 trough 1.6 by Torsten Martinsen <bullesto kdk-online.dk>.

This Texinfo le may b e opied and distributed in a ordan e with the usual opying p er- missions of the Free Software Foundation. These p ermissions are given in the General Publi Li ense se tion of the \GNU Ema s Manual". This software omes with NO WARRANTY.

Permission is granted to make and distribute verbatim opies of this manual provided the opyright noti e and this p ermission noti e are preserved on all opies.

Permission is granted to opy and distribute mo di ed versions of this manual under the on- ditions for verbatim opying, provided that the entire resulting derived work is distributed under the terms of a p ermission noti e identi al to this one.

Chapter 1: Overview of LaTeX and Lo al Guide 3

1 Overview of LaTeX and Lo al Guide

The LaTeX ommand typ esets a le of text using the TeX program and the LaTeX Ma ro pa kage for TeX. To b e more sp e i , it pro esses an input le ontaining the text of a do ument with intersp ersed ommands that des rib e how the text should b e formatted. It pro du es at least three les as output:

  1. A \Devi e Indep endent", or .dvi' le. This ontains ommands that an b e translated into ommands for a variety of output devi es. You an view the output of LaTeX by using a program su h as xdvi, whi h a tually uses the.dvi' le.
  2. A \trans ript" or `.log' le that ontains summary information and diagnosti mes- sages for any errors dis overed in the input le.
  3. An \auxiliary" or `.aux' le. This is used by LaTeX itself, for things su h as se tioning. For a des ription of what go es on inside TeX, you should onsult The TeXb o ok by Donald E. Knuth, ISBN 0-201-13448-9, published jointly by the Ameri an Mathemati al So iety and Addison-Wesley Publishing Company.

For a des ription of LaTeX, you should onsult: LaTeX: A Do ument Preparation System, by Leslie Lamp ort, Addison-Wesley Publish- ing Company, 2nd edition, 1994.

The LaTeX Companion, by Mi hel Go ossens, Frank Mittelba h, and Alexander Samarin, Addison-Wesley, 1994.

Chapter 2: Commands 5

2 Commands

A LaTeX ommand b egins with the ommand name, whi h onsists of a \ followed by either (a) a string of letters or (b) a single non-letter. Arguments ontained in square bra kets, [℄, are optional while arguments ontained in bra es, {}, are required.

NOTE: LaTeX is ase sensitive. Enter all ommands in lower ase unless expli itly dire ted to do otherwise.

2.1 Counters

Everything LaTeX numb ers for you has a ounter asso iated with it. The name of the ounter is the same as the name of the environment or ommand that pro du es the numb er, ex ept with no . (enumi - enumiv are used for the nested enumerate environment.) Below is a list of the ounters used in LaTeX's standard do ument lasses to ontrol numb ering.

part paragraph figure enumi hapter subparagraph table enumii se tion page footnote enumiii subse tion equation mpfootnote enumiv subsubse tion

2.1.1 \addto ounter

\addto ounter{ ounter}{value} The \addto ounter ommand in rements the ounter by the amount sp e i ed by the value argument. The value argument an b e negative.

2.1.2 \alph

\alph{ ounter} This ommand auses the value of the ounter to b e printed in alphab eti hara ters. The \alph ommand uses lower ase alphab eti alphab eti hara ters, i.e., a, b, ... while the \Alph ommand uses upp er ase alphab eti hara ters, i.e., A, B, C....

2.1.3 \arabi

\arabi { ounter} The \arabi ommand auses the value of the ounter to b e printed in Arabi numb ers, i.e., 3.

2.1.4 \fnsymb ol

\fnsymbol{ ounter} The \fnsymbol ommand auses the value of the ounter to b e printed in a sp e i sequen e of nine symb ols that an b e used for numb ering fo otnotes.

eg. From 1-9:  y z x { k  yy zz NB. ounter must have a value b etween 1 and 9 in lusive.

6 LaTEX (^2) " help 1.

2.1.5 \new ounter

\new ounter{foo}[ ounter℄ The \new ounter ommand de nes a new ounter named foo. The ounter is initialized to zero.

The optional argument [ ounter℄ auses the ounter foo to b e reset whenever the ounter named in the optional argument is in remented.

2.1.6 \refstep ounter

\refstep ounter{ ounter} The \refstep ounter ommand works like \step ounter See Se tion 2.1.8 [\step- ounter℄, page 6, ex ept it also de nes the urrent \ref value to b e the result of \the ounter.

2.1.7 \roman

\roman{ ounter} This ommand auses the value of the ounter to b e printed in Roman numerals. The \roman ommand uses lower ase Roman numerals, i.e., i, ii, iii..., while the \Roman ommand uses upp er ase Roman numerals, i.e., I, II, III....

2.1.8 \step ounter

\step ounter{ ounter} The \step ounter ommand adds one to the ounter and resets all subsidiary ounters.

2.1.9 \set ounter

\set ounter{ ounter}{value} The \set ounter ommand sets the value of the ounter to that sp e i ed by the value argument.

2.1.10 \use ounter

\use ounter{ ounter} The \use ounter ommand is used in the se ond argument of the list environment to allow the ounter sp e i ed to b e used to numb er the list items.

2.1.11 \value

\value{ ounter} The \value ommand pro du es the value of the ounter named in the mandatory argument. It an b e used where LaTeX exp e ts an integer or numb er, su h as the se ond argument of a \set ounter or \addto ounter ommand, or in:

\hspa e{\value{foo}\parindent} It is useful for doing arithmeti with ounters.

8 LaTEX (^2) " help 1.

2.3 De nitions

2.3.1 \new ommand

\new ommand{ md}[args℄{definition} \new ommand{ md}[args℄[default℄{definition} \renew ommand{ md}[args℄{definition} \renew ommand{ md}[args℄[default℄{definition} These ommands de ne (or rede ne) a ommand.

md A ommand name b eginning with a . For \new ommand it must not b e already de ned and must not b egin with \end; for \renew ommand it must already b e de ned.

args An integer from 1 to 9 denoting the numb er of arguments of the ommand b eing de ned. The default is for the ommand to have no arguments.

def If this optional parameter is present, it means that the ommand's rst argu- ment is optional. The default value of the optional argument is def.

definition The text to b e substituted for every o urren e of md; a parameter of the form #n in md is repla ed by the text of the nth argument when this substitution takes pla e.

2.3.2 \newenvironment

\newenvironment{nam}[args℄{begdef}{enddef} \newenvironment{nam}[args℄[default℄{begdef}{enddef} \renewenvironment{nam}[args℄{begdef}{enddef} These ommands de ne or rede ne an environment.

nam The name of the environment. For \newenvironment there must b e no urrently de ned environment by that name, and the ommand \nam must b e unde ned. For \renewenvironment the environment must already b e de ned.

args An integer from 1 to 9 denoting the numb er of arguments of the newly-de ned environment. The default is no arguments.

default If this is sp e i ed, the rst argument is optional, and default gives the default value for that argument.

begdef The text substituted for every o urren e of \begin{nam}; a parameter of the form #n in md is repla ed by the text of the nth argument when this substitution takes pla e.

enddef The text substituted for every o urren e of \end{nam}. It may not ontain any argument parameters.

Chapter 2: Commands 9

2.3.3 \newtheorem

\newtheorem{env_name}{ aption}[within℄ \newtheorem{env_name}[numbered_like℄{ aption} This ommand de nes a theorem-like environment.

env_name The name of the environment to b e de ned. A string of letters. It must not b e the name of an existing environment or ounter. aption The text printed at the b eginning of the environment, right b efore the numb er. This may simply say \Theorem", for example.

within The name of an already de ned ounter, usually of a se tional unit. Provides a means of resetting the new theorem ounter within the se tional unit.

numbered_like The name of an already de ned theorem-like environment. The \newtheorem ommand may have at most one optional argument.

2.3.4 \newfont

\newfont{ md}{font_name} De nes the ommand name md, whi h must not b e urrently de ned, to b e a de laration that sele ts the font named font_name to b e the urrent font.

Chapter 2: Commands 11

2.5 Layout

Mis ellaneous ommands for ontrolling the general layout of the page.

2.5.1 \ ushb ottom

The \flushbottom de laration makes all text pages the same height, adding extra ver- ti al spa e when ne essary to ll out the page.

This is the standard if two olumn mo de is sele ted.

2.5.2 \one olumn

The \one olumn de laration starts a new page and pro du es single- olumn output.

2.5.3 \raggedb ottom

The \raggedbottom de laration makes all pages the height of the text on that page. No extra verti al spa e is added.

2.5.4 \two olumn

\two olumn[text℄ The \two olumn de laration starts a new page and pro du es two- olumn output. If the optional text argument is present, it is typ eset in one- olumn mo de.

12 LaTEX (^2) " help 1.

2.6 Environments

LaTeX provides a numb er of di erent paragraph-making environments. Ea h environ- ment b egins and ends in the same manner.

\begin{environment-name} . . . \end{environment-name}

2.6.1 array

\begin{array}{ ol1 ol2... oln} olumn 1 entry & olumn 2 entry ... & olumn n entry \ . . . \end{array} Math arrays are pro du ed with the array environment. It has a single mandatory ar- gument des ribing the numb er of olumns and the alignment within them. Ea h olumn, oln, is sp e i ed by a single letter that tells how items in that row should b e formatted.  | for entred  l | for ush left  r | for ush right Column entries must b e separated by an &. Column entries may in lude other LaTeX ommands. Ea h row of the array must b e terminated with the string \. Note that the array environment an only b e used in math mo de, so normally it is used inside an equation environment.

2.6.2 enter

\begin{ enter} Text on line 1 \ Text on line 2 \ . . . \end{ enter} The enter environment allows you to reate a paragraph onsisting of lines that are entred within the left and right margins on the urrent page. Ea h line must b e terminated with the string \.

2.6.2.1 \ entering

This de laration orresp onds to the enter environment. This de laration an b e used inside an environment su h as quote or in a parbox. The text of a gure or table an b e

14 LaTEX (^2) " help 1.

The eqnarray environment is used to display a sequen e of equations or inequalities. It is very mu h like a three- olumn array environment, with onse utive rows separated by \ and onse utive items within a row separated by an &.

An equation numb er is pla ed on every line unless that line has a \nonumber ommand. The ommand \lefteqn is used for splitting long formulas a ross lines. It typ esets its argument in display style ush left in a b ox of zero width.

2.6.6 equation

\begin{equation} math formula \end{equation} The equation environment entres your equation on the page and pla es the equation numb er in the right margin.

2.6.7 gure

\begin{figure}[pla ement℄

body of the figure

\ aption{figure title} \end{figure} Figures are ob je ts that are not part of the normal text, and are usually \ oated" to a onvenient pla e, like the top of a page. Figures will not b e split b etween two pages. The optional argument [pla ement℄ determines where LaTeX will try to pla e your gure. There are four pla es where LaTeX an p ossibly put a oat:

  1. h (Here) - at the p osition in the text where the gure environment app ears.
  2. t (Top) - at the top of a text page.
  3. b (Bottom) - at the b ottom of a text page.
  4. p (Page of oats) - on a separate oat page, whi h is a page ontaining no text, only oats. The standard rep ort and arti le lasses use the default pla ement tbp. The b o dy of the gure is made up of whatever text, LaTeX ommands, et. you wish. The \ aption ommand allows you to title your gure.

2.6.8 ushleft

\begin{flushleft} Text on line 1 \ Text on line 2 \ . . . \end{flushleft}

Chapter 2: Commands 15

The flushleft environment allows you to reate a paragraph onsisting of lines that are ushed left, to the left-hand margin. Ea h line must b e terminated with the string \.

2.6.8.1 \raggedright

This de laration orresp onds to the flushleft environment. This de laration an b e used inside an environment su h as quote or in a parbox.

Unlike the flushleft environment, the \raggedright ommand do es not start a new paragraph; it simply hanges how LaTeX formats paragraph units. To a e t a paragraph unit's format, the s op e of the de laration must ontain the blank line or \end ommand (of an environment like quote) that ends the paragraph unit.

2.6.9 ushright

\begin{flushright} Text on line 1 \ Text on line 2 \ . . . \end{flushright} The flushright environment allows you to reate a paragraph onsisting of lines that are ushed right, to the right-hand margin. Ea h line must b e terminated with the string \.

2.6.9.1 \raggedleft

This de laration orresp onds to the flushright environment. This de laration an b e used inside an environment su h as quote or in a parbox.

Unlike the flushright environment, the \raggedleft ommand do es not start a new paragraph; it simply hanges how LaTeX formats paragraph units. To a e t a paragraph unit's format, the s op e of the de laration must ontain the blank line or \end ommand (of an environment like quote) that ends the paragraph unit.

2.6.10 itemize

\begin{itemize} \item First item \item Se ond item . . . \end{itemize} The itemize environment pro du es a \bulleted" list. Itemizations an b e nested within one another, up to four levels deep. They an also b e nested within other paragraph-making environments.

Chapter 2: Commands 17

2.6.14 pi ture

\begin{pi ture}(width,height)(x offset,y offset) . . pi ture ommands . . \end{pi ture} The pi ture environment allows you to reate just ab out any kind of pi ture you want ontaining text, lines, arrows and ir les. You tell LaTeX where to put things in the pi ture by sp e ifying their o ordinates. A o ordinate is a numb er that may have a de imal p oint and a minus sign | a numb er like 5 , 2.3 or -3.1416. A o ordinate sp e i es a length in multiples of the unit length \unitlength, so if \unitlength has b een set to 1 m, then the o ordinate 2.54 sp e i es a length of 2.54 entimetres. You an hange the value of \unitlength anywhere you want, using the \setlength ommand, but strange things will happ en if you try hanging it inside the pi ture environment.

A p osition is a pair of o ordinates, su h as (2.4,-5), sp e ifying the p oint with x- o ordinate 2.4 and y- o ordinate -5. Co ordinates are sp e i ed in the usual way with resp e t to an origin, whi h is normally at the lower-left orner of the pi ture. Note that when a p osition app ears as an argument, it is not en losed in bra es; the parentheses serve to delimit the argument.

The pi ture environment has one mandatory argument, whi h is a position. It sp e - i es the size of the pi ture. The environment pro du es a re tangular b ox with width and height determined by this argument's x- and y- o ordinates.

The pi ture environment also has an optional position argument, following the size argument, that an hange the origin. (Unlike ordinary optional arguments, this argument is not ontained in square bra kets.) The optional argument gives the o ordinates of the p oint at the lower-left orner of the pi ture (thereby determining the origin). For example, if \unitlength has b een set to 1mm, the ommand

\begin{pi ture}(100,200)(10,20) pro du es a pi ture of width 100 millimetres and height 200 millimetres, whose lower-left orner is the p oint (10,20) and whose upp er-right orner is therefore the p oint (110,220). When you rst draw a pi ture, you will omit the optional argument, leaving the origin at the lower-left orner. If you then want to mo dify your pi ture by shifting everything, you just add the appropriate optional argument.

The environment's mandatory argument determines the nominal size of the pi ture. This need b ear no relation to how large the pi ture really is; LaTeX will happily allow you to put things outside the pi ture, or even o the page. The pi ture's nominal size is used by LaTeX in determining how mu h ro om to leave for it.

Everything that app ears in a pi ture is drawn by the \put ommand. The ommand \put (11.3,-.3){...} puts the ob je t sp e i ed by ... in the pi ture, with its referen e p oint at o ordinates (11.3,-.3). The referen e p oints for various ob je ts will b e des rib ed b elow.

18 LaTEX (^2) " help 1.

The \put ommand reates an LR b ox. You an put anything in the text argument of the \put ommand that you'd put into the argument of an \mbox and related ommands. When you do this, the referen e p oint will b e the lower left orner of the b ox.

Pi ture ommands:

2.6.14.1 \ ir le

\ ir le[*℄{diameter} The \ ir le ommand pro du es a ir le with a diameter as lose to the sp e i ed one as p ossible. If the *-form of the ommand is used, LaTeX draws a solid ir le.

Note that only ir les up to 40 pt an b e drawn.

2.6.14.2 \dashb ox

Draws a b ox with a dashed line. \dashbox{dash_length}(width,height){...} The \dashbox has an extra argument whi h sp e i es the width of ea h dash. A dashed b ox lo oks b est when the width and height are multiples of the dash_length.

2.6.14.3 \frame

\frame{...} The \frame ommand puts a re tangular frame around the ob je t sp e i ed in the ar- gument. The referen e p oint is the b ottom left orner of the frame. No extra spa e is put b etween the frame and the ob je t.

2.6.14.4 \frameb ox

\framebox(width,height)[position℄{...} The \framebox ommand is exa tly the same as the \makebox ommand, ex ept that it puts a frame around the outside of the b ox that it reates.

The framebox ommand pro du es a rule of thi kness \fboxrule, and leaves a spa e \fboxsep b etween the rule and the ontents of the b ox.

2.6.14.5 \line

\line(x slope,y slope){length} The \line ommand draws a line of the sp e i ed length and slope. Note that LaTeX an only draw lines with slop e = x/y, where x and y have integer values from -6 through 6.

2.6.14.6 \linethi kness

\linethi kness{dimension} De lares the thi kness of horizontal and verti al lines in a pi ture environment to b e dimension, whi h must b e a p ositive length. It do es not a e t the thi kness of slanted lines and ir les, or the quarter ir les drawn by \oval to form the orners of an oval.