getting started editing...outline getting started editing la t e x introduction kyle rawlins...
TRANSCRIPT
OutlineGetting started
Editing
LATEX introduction
Kyle Rawlins
February 26, 2009
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Getting startedInstalling LATEXResources
EditingReally basicDocument structureFormatting
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
OS X
I I use MacTeX: http://tug.org/mactex/
I Comes with TeXShop, probably the easiest way to get startedediting LATEX �les on the mac:http://www.uoregon.edu/~koch/texshop/
I Also comes with BibDesk, a really great program:http://bibdesk.sourceforge.net/
I I uses aquamacs (an OS X version of GNU emacs), takes somemore work to customize: http://aquamacs.org/,http://www.gnu.org/software/auctex/
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
OS X
I I use MacTeX: http://tug.org/mactex/
I Comes with TeXShop, probably the easiest way to get startedediting LATEX �les on the mac:http://www.uoregon.edu/~koch/texshop/
I Also comes with BibDesk, a really great program:http://bibdesk.sourceforge.net/
I I uses aquamacs (an OS X version of GNU emacs), takes somemore work to customize: http://aquamacs.org/,http://www.gnu.org/software/auctex/
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
OS X
I I use MacTeX: http://tug.org/mactex/
I Comes with TeXShop, probably the easiest way to get startedediting LATEX �les on the mac:http://www.uoregon.edu/~koch/texshop/
I Also comes with BibDesk, a really great program:http://bibdesk.sourceforge.net/
I I uses aquamacs (an OS X version of GNU emacs), takes somemore work to customize: http://aquamacs.org/,http://www.gnu.org/software/auctex/
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
OS X
I I use MacTeX: http://tug.org/mactex/
I Comes with TeXShop, probably the easiest way to get startedediting LATEX �les on the mac:http://www.uoregon.edu/~koch/texshop/
I Also comes with BibDesk, a really great program:http://bibdesk.sourceforge.net/
I I uses aquamacs (an OS X version of GNU emacs), takes somemore work to customize: http://aquamacs.org/,http://www.gnu.org/software/auctex/
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
Windows
I I don't really know much, sorry.
I But I think MiKTeX is what people use:http://www.miktex.org/.
I I've also heard good things about WinEdt as an editor:http://www.winedt.com/ (not free). Also:http://www.texniccenter.org/.
I Emacs is also an option.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
Windows
I I don't really know much, sorry.
I But I think MiKTeX is what people use:http://www.miktex.org/.
I I've also heard good things about WinEdt as an editor:http://www.winedt.com/ (not free). Also:http://www.texniccenter.org/.
I Emacs is also an option.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
Windows
I I don't really know much, sorry.
I But I think MiKTeX is what people use:http://www.miktex.org/.
I I've also heard good things about WinEdt as an editor:http://www.winedt.com/ (not free). Also:http://www.texniccenter.org/.
I Emacs is also an option.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
Windows
I I don't really know much, sorry.
I But I think MiKTeX is what people use:http://www.miktex.org/.
I I've also heard good things about WinEdt as an editor:http://www.winedt.com/ (not free). Also:http://www.texniccenter.org/.
I Emacs is also an option.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
Linux
I If you're using linux, you probably don't need my help.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
Resources
I I put up some basic templates, plus the source to this �le, onthe web. The source to this �le in particular contains all sortsof little recipes you might �nd useful.
I Some resources for linguists:
I LATEX for linguistshttp://www.essex.ac.uk/linguistics/clmt/latex4ling/
I UCSC editionhttp://people.ucsc.edu/�kirchner/resources/latex/latex.html
I LingTeX mailing list http://heim.i�.uio.no/�dag/ling-tex.html
I A good general purpose reference (esp. for formulae):http://www.giss.nasa.gov/tools/latex/
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
Resources
I I put up some basic templates, plus the source to this �le, onthe web. The source to this �le in particular contains all sortsof little recipes you might �nd useful.
I Some resources for linguists:I LATEX for linguists
http://www.essex.ac.uk/linguistics/clmt/latex4ling/I UCSC edition
http://people.ucsc.edu/�kirchner/resources/latex/latex.htmlI LingTeX mailing list http://heim.i�.uio.no/�dag/ling-tex.html
I A good general purpose reference (esp. for formulae):http://www.giss.nasa.gov/tools/latex/
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Installing LATEXResources
Resources
I I put up some basic templates, plus the source to this �le, onthe web. The source to this �le in particular contains all sortsof little recipes you might �nd useful.
I Some resources for linguists:I LATEX for linguists
http://www.essex.ac.uk/linguistics/clmt/latex4ling/I UCSC edition
http://people.ucsc.edu/�kirchner/resources/latex/latex.htmlI LingTeX mailing list http://heim.i�.uio.no/�dag/ling-tex.html
I A good general purpose reference (esp. for formulae):http://www.giss.nasa.gov/tools/latex/
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Really basic
I TEX is a macro language; LATEX a comprehensive set of macrosand conventions built in TEX.
I Interface for formatting is distinct from the formatting itself.
I Generate formatted PDF/Postscript �le by compilingdocument.
I Most text is just text.
I Macros: nmacroname[options]{argument}
I e.g. �ntextbf{hi}� produces hi.
I Environments are bracketed with a begin and end command:
nbegin{itemize}nitem Most text is just text.nend{itemize}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Really basic
I TEX is a macro language; LATEX a comprehensive set of macrosand conventions built in TEX.
I Interface for formatting is distinct from the formatting itself.
I Generate formatted PDF/Postscript �le by compilingdocument.
I Most text is just text.
I Macros: nmacroname[options]{argument}
I e.g. �ntextbf{hi}� produces hi.
I Environments are bracketed with a begin and end command:
nbegin{itemize}nitem Most text is just text.nend{itemize}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Really basic
I TEX is a macro language; LATEX a comprehensive set of macrosand conventions built in TEX.
I Interface for formatting is distinct from the formatting itself.
I Generate formatted PDF/Postscript �le by compilingdocument.
I Most text is just text.
I Macros: nmacroname[options]{argument}
I e.g. �ntextbf{hi}� produces hi.
I Environments are bracketed with a begin and end command:
nbegin{itemize}nitem Most text is just text.nend{itemize}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Really basic
I TEX is a macro language; LATEX a comprehensive set of macrosand conventions built in TEX.
I Interface for formatting is distinct from the formatting itself.
I Generate formatted PDF/Postscript �le by compilingdocument.
I Most text is just text.
I Macros: nmacroname[options]{argument}
I e.g. �ntextbf{hi}� produces hi.
I Environments are bracketed with a begin and end command:
nbegin{itemize}nitem Most text is just text.nend{itemize}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Really basic
I TEX is a macro language; LATEX a comprehensive set of macrosand conventions built in TEX.
I Interface for formatting is distinct from the formatting itself.
I Generate formatted PDF/Postscript �le by compilingdocument.
I Most text is just text.
I Macros: nmacroname[options]{argument}I e.g. �ntextbf{hi}� produces hi.
I Environments are bracketed with a begin and end command:
nbegin{itemize}nitem Most text is just text.nend{itemize}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Really basic
I TEX is a macro language; LATEX a comprehensive set of macrosand conventions built in TEX.
I Interface for formatting is distinct from the formatting itself.
I Generate formatted PDF/Postscript �le by compilingdocument.
I Most text is just text.
I Macros: nmacroname[options]{argument}I e.g. �ntextbf{hi}� produces hi.
I Environments are bracketed with a begin and end command:
nbegin{itemize}nitem Most text is just text.nend{itemize}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Preamble
I Setup stu� goes here.
I Document class: basic document templateI Load support packages, e.g. mathptmx sets up Times New
Roman.I Other setup, document formatting etc. This one sets up some
citation styles.
ndocumentclass[article,11pt]{memoir}
nusepackage{mathptmx}
nusepackage{natbib}nbibpunct{(}{)}{;}{a}{}{,}
% etc.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Preamble
I Setup stu� goes here.I Document class: basic document template
I Load support packages, e.g. mathptmx sets up Times NewRoman.
I Other setup, document formatting etc. This one sets up somecitation styles.
ndocumentclass[article,11pt]{memoir}
nusepackage{mathptmx}
nusepackage{natbib}nbibpunct{(}{)}{;}{a}{}{,}
% etc.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Preamble
I Setup stu� goes here.I Document class: basic document templateI Load support packages, e.g. mathptmx sets up Times New
Roman.
I Other setup, document formatting etc. This one sets up somecitation styles.
ndocumentclass[article,11pt]{memoir}
nusepackage{mathptmx}
nusepackage{natbib}nbibpunct{(}{)}{;}{a}{}{,}
% etc.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Preamble
I Setup stu� goes here.I Document class: basic document templateI Load support packages, e.g. mathptmx sets up Times New
Roman.I Other setup, document formatting etc. This one sets up some
citation styles.
ndocumentclass[article,11pt]{memoir}
nusepackage{mathptmx}
nusepackage{natbib}nbibpunct{(}{)}{;}{a}{}{,}
% etc.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Body
I Content of document goes here.
I One big environment.
nbegin{document}Hello worldnend{document}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Body
I Content of document goes here.
I One big environment.
nbegin{document}Hello worldnend{document}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Paragraphs
Regular paragraphs are just blocks of text with blank linesbefore andafter them.It doesn't matterwhereyou put the line breaks.
Regular paragraphs are just blocks of text with blank lines beforeand after them. It doesn't matter where you put the line breaks.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Paragraphs
Regular paragraphs are just blocks of text with blank linesbefore andafter them.It doesn't matterwhereyou put the line breaks.
Regular paragraphs are just blocks of text with blank lines beforeand after them. It doesn't matter where you put the line breaks.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Text styles
I These are LaTeX2e font selection commands; don't use e.g.nit any more.
I italic : ntextit{italic}
I bold: ntextit{bold}
I small caps: ntextsc{small caps}
I With ulem.sty:
I underlined: nuline{underlined}I struck out: nsout{struck out}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Text styles
I These are LaTeX2e font selection commands; don't use e.g.nit any more.
I italic : ntextit{italic}
I bold: ntextit{bold}
I small caps: ntextsc{small caps}
I With ulem.sty:
I underlined: nuline{underlined}I struck out: nsout{struck out}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Text styles
I These are LaTeX2e font selection commands; don't use e.g.nit any more.
I italic : ntextit{italic}
I bold: ntextit{bold}
I small caps: ntextsc{small caps}
I With ulem.sty:
I underlined: nuline{underlined}I struck out: nsout{struck out}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Text styles
I These are LaTeX2e font selection commands; don't use e.g.nit any more.
I italic : ntextit{italic}
I bold: ntextit{bold}
I small caps: ntextsc{small caps}
I With ulem.sty:
I underlined: nuline{underlined}I struck out: nsout{struck out}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Text styles
I These are LaTeX2e font selection commands; don't use e.g.nit any more.
I italic : ntextit{italic}
I bold: ntextit{bold}
I small caps: ntextsc{small caps}
I With ulem.sty:I underlined: nuline{underlined}I struck out: nsout{struck out}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Bulleted text
I Bullets are done with the itemize environment.
I Each item is prefaced with an nitem command.
nbegin{itemize}nitem Bullets are done with the itemize environment.nitem Each item is prefaced with an $nbackslash$itemcommand.nend{itemize}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Bulleted text
I Bullets are done with the itemize environment.
I Each item is prefaced with an nitem command.
nbegin{itemize}nitem Bullets are done with the itemize environment.nitem Each item is prefaced with an $nbackslash$itemcommand.nend{itemize}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Document divisions
I Automatic section numbering and cross-referencing.I Commands: nchapter (memoir), nsection, nsubsection, etc.I Labeling command: nlabel{name}I Reference with nref{name}, or npageref{name} for the page
number.
nchapter{My �rst chapter}nsection{The .1 section of this chapter}nsubsection{The .1.1 section}nlabel{mylabel}
...nS nref{mylabel} is on p. npageref{mylabel}
I This last line will produce something like ��1.1.1 is on p. 1�.(except, automatically determined.)
I Need to run LATEX multiple times to get right cross-references.(First pass generates label information, second pass inserts itfor ref commands.)
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
BibTeX
I Makes it very easy to manage bibliography entries.
I Three parts:
I A .bib �le � stores reference information.
@article{Chomsky59,Author = {Noam Chomsky},Journal = {Information and Control},Pages = {137�167},Title = {On certain formal properties of grammars},Volume = {2},Year = {1959}}
I Cite commands and bibliography commands in your .tex �le.
ncitep{Chomsky59}
I BibTeX � a program called after LATEX that �gures out citationsfrom an .aux �le (produced as a side-e�ect of compilation).
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
BibTeX
I Makes it very easy to manage bibliography entries.
I Three parts:I A .bib �le � stores reference information.
@article{Chomsky59,Author = {Noam Chomsky},Journal = {Information and Control},Pages = {137�167},Title = {On certain formal properties of grammars},Volume = {2},Year = {1959}}
I Cite commands and bibliography commands in your .tex �le.
ncitep{Chomsky59}
I BibTeX � a program called after LATEX that �gures out citationsfrom an .aux �le (produced as a side-e�ect of compilation).
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
BibTeX
I Makes it very easy to manage bibliography entries.
I Three parts:I A .bib �le � stores reference information.
@article{Chomsky59,Author = {Noam Chomsky},Journal = {Information and Control},Pages = {137�167},Title = {On certain formal properties of grammars},Volume = {2},Year = {1959}}
I Cite commands and bibliography commands in your .tex �le.
ncitep{Chomsky59}
I BibTeX � a program called after LATEX that �gures out citationsfrom an .aux �le (produced as a side-e�ect of compilation).
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
BibTeX
I Makes it very easy to manage bibliography entries.
I Three parts:I A .bib �le � stores reference information.
@article{Chomsky59,Author = {Noam Chomsky},Journal = {Information and Control},Pages = {137�167},Title = {On certain formal properties of grammars},Volume = {2},Year = {1959}}
I Cite commands and bibliography commands in your .tex �le.
ncitep{Chomsky59}
I BibTeX � a program called after LATEX that �gures out citationsfrom an .aux �le (produced as a side-e�ect of compilation).
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Formulas
I Formulas are entered in math mode. The main way to switchto math mode is using $ symbols.
JmustK = �phsti : �ws : 8w0 : wRw 0 ! p(w 0)
$nleftnllbracket ntext{ntextbf{must}} nrightnrrbracket =nlambda p_{nleftnlangle st nrightnrangle} n: .n: nlambdaw_s n: .n: nforall w' : wRw' nrightarrow p(w')$
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
More complicated formulas
(Chosen at random from The Harmonic Mind)
[I�M](d0)(d) =
( �1�k �M
�(d0)
(d)if 9k s.t. m + k = d and m0 + k = d 0
0 otherwise
$nleft[nmathbb{I} nvarotimes nmathbb{M}nright]^{(d')}_{(d)}=
nleftn{nbegin{array}{ll}nleft[nmathbf{1}^{nvarotimes k} nvarotimes
nmathbb{M}nright]^{(d')}_{(d)} &ntext{if }nexists kntext{ s.t. }m+k=d
ntext{ and }m'+k=d'nnnmathbf{0} & ntext{otherwise}
nend{array}nright.$
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Example numbering
I Various packages � I use gb4e.I Copy on website adapted to not con�ict with memoir.
I Another popular one is linguex.
I Easy to do automatic cross-references: (2)
(1) Alfonso is a lawyer.
(2) * Alfonso seems a lawyer.
(3) a. Who is Alfonso talking to?
b. Who on earth is Alfonso talking to?
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Including �gures
I I usually use the graphicx package.
nincludegraphics[scale=0.3]{cat_proximity}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Including �gures
I I usually use the graphicx package.
nincludegraphics[scale=0.3]{cat_proximity}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Including �gures
I I usually use the graphicx package.
nincludegraphics[scale=0.3]{cat_proximity}
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Tree diagrams
I Many popular packages:I pst-jtree. reportedly the best modern one, but requires
pstricks, and consequently, does not work with pd�atex.I qtree. Pretty easy to use, no dependencies.I parsetree. Actually designed for programming language theory,
but works well for linguistics.I TikZ. General purpose drawing package, really really nice. But
does less tree formatting automatically.
I Examples: (download source to see details)
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
qtree
I Note: I pulled this out of a homework from about 7 years ago, so I haveno idea why you'd use this constituent structure.
(4) DP
D
a
NP
N0
AP
A
formerhhshetiihetii
?
�temporal
hhetihshetiiiN
teacherheti
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
parsetree
(5) DP
D
a
NP
N0
AP
A
formerhhshetiihetii
?
�temporal
hhetihshetiiiN
teacherheti
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Trees in TikZ
(6) DP
D
a
NP
N0
AP
A
formerhhshetiihetii
?
?
�temporal
hhetihshetiii
N
teacherheti
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
More trees in TikZ
(7) Negative question, negative answer
Is Alfonso not coming to the party?
�P
AdvP
Adv
no[uNeg]
�P
�
[uNeg,e]
TP
DP
he
NegP
Neg
[iNeg]
VP
is coming to the party
concord
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Tableaux
I Can do many tableaux with simple tabular environments.
I This example is also using the tipa package for IPA fonts, andthe arydshln package for the dashed line.
I Actually, this uses my own custom tableau environment basedon tabular, there is probably something better around. (Colin?)
I Major drawback: it is a pain to add columns, especially inlarge tableau. It is a huge pain to re-order columns.
/k-haratat-s/ FtBin FtHdR Dep�
� a. [kha.(ra:).tats] *b. [kha.(ra).tats] *!c. [(kha.ra).tats] *!
Tableau 1: Lengthening of stressed vowels
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Presentations
I This presentation is made with the beamer package. Seemslike the best option by far.
I Pretty easy to use, well-documented. (Same author asPGF/TikZ.)
I Source for this �le available.
I I've also put up a beamer �template� (which is really just theexample from the beamer site).
I To see what can be done, I will now switch to a di�erent �le.
Kyle Rawlins LATEX introduction
OutlineGetting started
Editing
Really basicDocument structureFormatting
Posters
I I use the a0poster class along with textpos.
I Produces A0-sized PDF �les. (European size.)
I Pretty easy to get to work with the poster printer upstairs.
Kyle Rawlins LATEX introduction