\documentstyle[12pt,lingmacros,tree-dvips,lsabib]{article} \newcommand{\es}{\enumsentence} \newcommand{\ees}{\eenumsentence} \title{\LaTeX\ tutorial} \author{Emily Bender} \date{January 20, 1997} \begin{document} \maketitle \section{Some basic stuff} \LaTeX\ doesn't pay very much attention to the way you line things up on the screen. One space between words is the same as many. Two carriage returns will tell \LaTeX\ to start a new paragraph. The \% sign comments things out. %Like this. %and this. \subsection{Special characters} The following are special characters in \LaTeX, so you have to do something special to get them to actually appear: \begin{quote} \$ \& \% \# \_ \{ \} \end{quote} \begin{quote} \begin{verbatim} \ ~ ^ \end{verbatim} \end{quote} The characters $|$, $<$, and $>$ only come out in math mode. \subsection{Quotes} `single quotes' ``double quote'' ''backwards quotes`` Notice that the normal quote character (shift-') doesn't get used. \subsection{Type styles} {\sc Small caps} {\bf bold face} {\em italics} \subsection{Accents and subscripts} \={a} \'{a} \v{a} \`{a} \^{a} \~{n} \c{c} \u{o} \i\ \'{\i} \noindent themselves$_{i}$ \section{Some sort of fancy stuff} \subsection{Numbering things and referring to them} The sentence in (\ref{ex1}) is a numbered sentence. \es{ \label{ex1} This is a numbered sentence. } I can also refer to other sections, such as \S\ref{othersection}. It is also possible to have examples formatted like: \ees{\label{ees} \item[a.] First sentence fragment. \item[b.] Another sentence fragment. } In this case, you have to do some of the reference by hand, as in (\ref{ees}a). \subsection{Quotation and description} The quotation and description environments may also be useful. \begin{quotation} A little acolyte on Mount Hiei, fresh from the country, arrived when the cherry trees were in full bloom. When a cruel wind sent the petals flying, the boy burst into tears. ``What makes you cry so, my dear?'' a monk gently comforted him. ``Are you sorry to see the flowers fall? But flowers never last, you know. They always fall. You shouldn't cry!'' ``Who cares whether they fall or not!'' the boy sobbed. ``Not me! But if the barley flowers in Daddy's fields blow away there'll be no crop and that'd be {\em awful}!'' He bawled all the harder. So much for {\em that} sweet child's sensitive feelings. [Royall Tyler, {\em Japanese Tales}, p.224] \end{quotation} \begin{description} \item[$\bullet$] Point one. \item[(2)] Point two. \item[\textnormal{(2)}] Point two again. \end{description} \subsection{Footnotes} \label{othersection} \LaTeX\ does footnotes.\footnote{Like this one.} Sometimes the regular \verb+ \footnote + command won't work inside of other commands. In those cases, use \verb+ \footnotemark + and \verb+ \footnotetext+: \es{An example with a footnote\footnotemark} \footnotetext{This is another footnote.} \section{Fancy things that are useful to linguists} \subsection{Your basic table} \es{ \begin{tabular}[t]{|l||l|c|c|} \hline &\multicolumn{1}{c|}{Numeral} & Number of $\sigma$ & Alphabetical?\\ \hline \hline French & deux & 1 & Yes\\ \hline English & two & 1 & No\\ \hline Japanese & hutatu & 3 & No\\ \hline \end{tabular} } \subsection{Glossed examples} \verb+ \shortex + and related macros are defined in lingmacros.sty. \es{ \shortex{4} {Kore-wa & omosirokuna-i & reibun & desu.} {This-{\sc top} & interesting.{\sc neg}-{\sc nonpst} & example.sentence & cop} {`This is an uninteresting example sentence.'} } \subsection{Trees from first principles} The relevant macros for this are defined in tree-dvips.sty. \es{ \begin{tabular}[t]{cccccccc} & & & \node{s}{S} & & & & \\ [.5cm] & \node{np}{NP} & & & & \node{vp}{VP} & & \\ [.5cm] \node{detp}{DetP} & & \node{nbar}{N$'$} & & \node{v}{V} & & \node{ap1}{AP} & \\ [.5cm] \node{all}{All} & & \node{axioms}{axioms} & & \node{are}{are} & \node{adv}{Adv} & & \node{ap2}{AP} \\ [.5cm] & & & & & \node{very}{very} & & \node{dull}{dull} \\ \end{tabular} \nodeconnect{s}{np} \nodeconnect{s}{vp} \nodeconnect{np}{detp} \nodeconnect{np}{nbar} \nodeconnect{vp}{v} \nodeconnect{vp}{ap1} \nodeconnect{ap1}{adv} \nodeconnect{ap1}{ap2} \nodeconnect{detp}{all} \nodeconnect{nbar}{axioms} \nodeconnect{v}{are} \nodeconnect{adv}{very} \nodeconnect{ap2}{dull} } \es{ \begin{tabular}[t]{ccc} & \node{s}{S} & \\[.5cm] \node{np}{NP} & & \node{vp}{VP} \\[.5cm] \node{a}{All axioms} & & \node{b}{are very dull} \\[.5cm] \end{tabular} \nodeconnect{s}{np} \nodeconnect{s}{vp} \nodetriangle{np}{a} \nodetriangle{vp}{b} } There are also other macro packages which make trees more intuitive. NB: If you just print the .dvi file, your trees will not come out. In order to see the trees, you must convert the file to the ps format first. To do the conversion and print the file all in one step, use dvips, as in: \begin{quote} dvips -Pvalkyr tutorial.dvi \end{quote} \noindent If you want to make a .ps file without printing it, use the -o option: \begin{quote} dvips -o tutorial.ps tutorial.dvi \end{quote} \noindent You can also use dvips to print only some pages of a document, using the -p and -l options. The following command will print only pages 2 and 3 of this document. \begin{quote} dvips -Pvalkyr -p2 -l3 tutorial.dvi \end{quote} \section{Math mode} \LaTeX\ was originally developed for mathematicians who wanted to typeset their stuff. This means it has extensive support for formatting formulas and the like. To use this stuff, you need to put \LaTeX\ in math mode. There are at least two ways to do this. One is to open and close math mode with \$. The other (for when you have longer passages in math mode) is the pair of commands \verb+\begin{math}+ and \verb+\end{math}+. Another command that is useful when you have formulas in running text is \verb+\mbox+. \section{A note on style files} All of the macros packages mentioned so far are siting in an appropriate place on turing. To use them, all you need to do is declare them in the \verb+\documentstyle+ command. If you want to use your own style files or other ones that otherwise aren't in the right place on turing, you need to put them somewhere where \LaTeX\ can find them. The way to do this is to make a directory called TEX in your home directory. Then add the line: \begin{quote} setenv TEXINPUTS /user/$<$yourlogin$>$/TEX/: \end{quote} \noindent to your .login. \LaTeX\ will be able to access any .sty or .bst files you put there. \section{Bibliographies} Imagine never having to enter the bibliographical information for a particular work more than once, or having the computer make sure that every work you refer to in the text shows up in the bibliography, or not having to keep track of which of two things by the same author in the same year you called `a' and which `b'\ldots Such are the luxuries of bibtex. Bibtex comes with the standard commands \verb+\cite+ and \verb+\nocite+. There are several packages extending those commands, including lsabib.bst/lsabib.sty, which I recommend. In order to use these, you need to save a copy of each in your TEX directory. Here are some examples: \begin{quote} \citeboth{Lamport94} is a very approachable beginner's guide to \LaTeX. \citeboth{Goossens*94} is a companion text to \citeboth{Lamport94} that has more advanced stuff. It's a little harder to read because it leaves out everything that is in \citeboth{Lamport94}. Another text is \citeboth{Kopka*95}. This one has both beginning and advanced stuff in the same text. It is less approachable than \citeboth{Lamport94} but more approachable than \citeboth{Goossens*94}. Dai (\citeyear{Dai92b,Dai92a}) provides interesting insight into Chinese syntax. Also, there are some other interesting works that I'm not going to say anything explicit about in the text. \nocite{Choi96} \end{quote} \bibliography{/user/bender/latextutorial/examplebib} \bibliographystyle{lsabib} \end{document}