Vous êtes sur la page 1sur 8

Shorthand guide in L

A
T
E
X
Anonymous
Abstract
The evolution of this language starts from T
E
X, followed by L
A
T
E
X, and
evolved into all kind of dierent libraries afterwards. T
E
Xand L
A
T
E
Xare
languages that are used to write equations in an epic and pleasant format.
The best way to understand this is this the following analogy:
C T
E
X
C++ L
A
T
E
X
MatLab, Octave, ProT
E
X, T
E
Xworks,
Mathematica... T
E
Xlive, MacT
E
X...
1
Where to begin?
First things rst, to create a simple LaTeX document you will be using a few
simple codes, which are best illustrated in the subsequent example:
documentclass report/article/book/letter/slides/proc
This stands for type and style of document you want to create.
usepackage many of those
This is optional in case you will want to use some code that is not included in
default L
A
T
E
Xlibrary.
begin document
This is what you will start with every single time when you are going to work
here. This code indicated the inception of what will be on your document.
begin titlepage
Titlepage enviroment
titleTitle
Title itself
author Name 1 and Name 2 and Name 3
If there is only one author, dont use and command.
date Text
If you will not enter any text then program will use todays date by default. Dont
forget the curly brackets after the date, otherwise compiler will not recognize it
as part of a titlepage, hence will not compile.
end titlepage
This command tells L
A
T
E
Xthat the title is complete and it can typeset the title
according to the information you have provided and the class (style) you are
using
end document
And the nal touch that indicates the end of your document
And the title page has been created just like the one in this le (only without
an abstract)!
2
How can I have my abstract at the titlepage in LaTex?
An example of a code:
begintitlepage
Titles, dates, authors...
maketitle
beginabstract
An example of some abstract.
endabstract
endtitlepage
The abstract appears on its own page because youve specied the titlepage
option to the article document class:
documentclass[12pt,a4paper, titlepage]article
If you remove this option (or specify notitlepage), then the abstract will appear
on the rst page, together with the article title, author, and date:
documentclass[12pt,a4paper,notitlepage]article
Then, if you want the rst section of the article to start on a new page, you
should add a clearpage command.
clearpage
sectionFirst Section
An example of a working code:
titleThe Title
authorName of author
dateDate
maketitle
beginabstract
abstract content
endabstract
clearpage
An example of a NOT working code:
begintitlepage
titleThe Title
authorName of author
dateDate
maketitle
endtitlepage
beginabstract
abstract content
endabstract
clearpage
To ush the abstract name to the left side of the page you should use a
hack, since the code is embedded into the L
A
T
E
X, hence, there is no way around
it (maybe). Use the following code before beginning an abstract:
renewcommand*abstractnameAbstracthll
3
Example of creating a table
Code:
begin table [!h]
Conditions in square brackets: exclamation sign ignores oating setup chosen by
L
A
T
E
Xand letter h allows table to be placed exactly where you have put it. i.e.
without them if you will decide to put table in the end of the text, L
A
T
E
Xmight
decide that it looks better in the beginning despite the fact that you have put it
in the end of the page
begin centre
To put it in the middle
begin tabular[[[r[l[[
l stands for left, r for right, c for centre, t for top, b for bottom
hline
Horizontal line
Type & Number hline
Even & 2
Even & 4 hline
Odd & 3
Odd & 5 hline
Double-dash line stands for starting a new line
end tabular
caption Text for caption labeltab:name
Labelling see later.
end centre
end table
clinei-j horizontal line across columns respectively.
Outcome:
Type Number
Even 2
Even 4
Odd 3
Odd 5
Table 1: Text for caption
4
Figures
begin gure
begin centre
includegraphics [width= cm] lename .pdf, .jpg . . .
caption [A simple L
A
T
E
Xgure] Long and complicated name of the le
Text from squared brackets will be in the list of gures
endcentre
endgure
You will need usepackagegraphicx to be able to use this code.
References
Lets use example with gures:
begin gure
begin centre
includegraphics [width= cm] name.jpg
caption [Text for the list of gures], Caption text
label gure:name
end gure
Then, after you want to refer to your labelled object:
***
subsection Something important
See gure refgure:name on page pagerefgure:name. . .
In other words, the commands to be used do not depend on what you are ref-
erencing, and they are:
labelmarker
You give the object you want to reference a marker, you can see it like a name.
refmarker
You can reference the object you have marked before. This prints the number
that was assigned to the object.
pagerefmarker
It will print the number of the page where the object is.
Types of labels::: chap: chapter, sec: section, g: gure, tab: table, eq: equation
5
Few codes to create lists of things you have where
you want them
listoftables
List of tables you have in the document
clearpage
tableofcontents
List of contents you have: sections, subsections, chapters...
clearpage
listogures
List of gures you have in the document
clearpage
Clearpage just to make it separate
6
Math and other symbols
prime /
propto
parallel |
perp
owns
ll
gg
leq
le
geq
ge
pm
approx
ell
div
copyright c _
angle

emptyset
epsilon
in
hbar h
delta
Delta
infty
int

oint

partial
sum

theta to
to
ne ,=
sim
simeq
setminus
fracnumerdenom
numer
denom
circ
overlinetext text
overbracetext

text
fboxtext text
frametext text
underlinetext text
sqrt[3] arg
3

arg
stockrelabove below
above
below
stockrelf longrightarrow
f

dots . . .
dotll . . . . . . . . . . . . . . . . . . . . . . . . . . .
shortstack [r] xyyzzz
x
yy
zzz
P.S. l - ush left, r - ush right, c - centre
Tips for using Math
The double dollar symbol ($$...$$) is the same as the backslash/bracket
pair, [...], which creates a centred equation in on a new line making it to
stand out from the text. ($...$) puts an equation on the same line without any
emphasiss.
begin{equation} label{...} ... end{equation}. Use this if you want the
equation to be automatically numbered. You can later reference the equation
with eqref..., where the text inside the braces is the equation label. (Note
that no parentheses are required with eqref.)
begin{equation*} ... tag{...}end{equation*}. Same as the equation
environment, except that automatic numbering is disabled, and the tag...
command generates an explicit equation number. For example, to get equation
number (4.1a), use tag4.1a. (Again no parentheses are needed.)
7
General code
- start from a new line after a double-backslash
not= - puts a slash through an operator ,=
stop - type this if TeX stops with an asterisk * and no error message
today, date, year - generates todays date, date, year
twocolumn[Heading] - declares a two-column page with optional full-page width
heading
emphtext - empasize the text in italic
marginpartext - text on the margin
clearpage - ends current and starts from a new page newpage - the same
footnotetext - species the text for a footnote
footnotemark - puts a footnote number into the text, i.e. refers to the footnote
signature text - declares a signature for a letter document style
Begin and usepackage environments
begindocument - standard compulsory beginning for all documents
beginsloppypar - use this for long words that doesnt break with hypen to
next row
begincenter - centers everything that is within this environment
beginequation - begin with this environment for math
begingure - for the pictures
beginushleft - or ushright align everything to one or another side
beginmath - selfevident
beginquote - for quotations
beginverse - for poetry
beginnoindent - put this in the beginning of the paragraph if you dont want
an indent in the beginning
beginindent - of put an indent wherever you want
begintable - for tables
begintabular - put this after table environment
begin*anything - asterisk will create an environment without a number
documentclass[twocolumnt]article - twocolumn will create an environment
for a whole document to be in 2 columns. Standard for articles.
usepackageasmath - necessary for using math codes
To eliminate the page number on the rst page put thispagestyleempty be-
fore maketitle
Look for detailed help, bibliographies, formatting and everything else
http://en.wikibooks.org/wiki/LaTeX/Introduction here or google.
8

Vous aimerez peut-être aussi