CoCalc Public Filestmp / latexexample.tex
Authors: Harald Schilly, ℏal Snyder, William A. Stein
1% Example LaTeX document for GP111 - note % sign indicates a comment
2\documentstyle[11pt]{article}
3% Default margins are too wide all the way around.  I reset them here
4\setlength{\topmargin}{-.5in}
5\setlength{\textheight}{9in}
6\setlength{\oddsidemargin}{.125in}
7\setlength{\textwidth}{6.25in}
8\begin{document}
9\title{LaTeX Typesetting By Example}
10\author{Phil Farrell\\
11Stanford University School of Earth Sciences}
12\renewcommand{\today}{November 2, 1994}
13\maketitle
14This article demonstrates a basic set of LaTeX formatting commands.
15Compare the typeset output side-by-side with the input document.
16\sectiox{lksdjf}
17\section {Plain Text}
18Type your text in free-format; lines can be as long
19or as short
20as you wish.
21        You can indent         or space out
23            text in
24                any way you like to highlight the structure
25        of your manuscript and make it easier to edit.
26LaTeX fills lines and adjusts spacing between words to produce an
27aesthetically pleasing result.
28
29Completely blank lines in the input file break your text into
30paragraphs.
31To change the font for a single character, word, or set of words,
32enclose the word and the font changing command within braces,
33{\em like this}.
34A font changing command not enclosed in braces, like the change to \bf
35bold here, keeps that change in effect until the end of the document or
36until countermanded by another font switch, like this change back to
37\rm roman.
38
39\section {Displayed Text}
40Use the quote'' and  quotation'' environments for typesetting quoted
41material or any other text that should be slightly indented and set off
42from the normal text.
43\begin{quotation}
44The quote and quotation environments are similar, but use different
45settings for paragraph indentation and spacing.
46
47\em When in doubt, consult the manual.
48\end{quotation}
49
50So far, I have demonstrated titles, paragraphs, font changes, and
52Now, I am going to show lists and tables.
53\begin{enumerate}
54\item
55The enumerate'' environment numbers the list elements, like this.
56
57Items in a list can contain multiple paragraphs.
58These paragraphs are appropriately spaced and indented according to their
59position in the list.
60   \begin{itemize}
61   \item The itemize'' environment sets off list items with bullets'',
62like this.  Finally, the description'' environment lets you put your own
63      \begin{description}
64      \item[A] label on each item, like this A''.
65      \item[If the label is long,] the first line of the item text will
66be spaced over to the right as needed.
67      \end{description}
68   \item Of course, lists can be nested, each type up to at least four levels.
69One type of list can be nested within another type.
70      \begin{itemize}
71      \item Nested lists of the same type will change style of numbering
72or bullets'' as needed.
73      \end{itemize}
74   \end{itemize}
75\item Don't forget to close off all list environments with the
76appropriate \verb+\end{...}+ command.
77Indenting \verb+\begin{...}+, \verb+\item+, and \verb+\end{...}+
78commands in the input document according to their nesting level can help
79clarify the structure.
80\end{enumerate}
81
82Here is a very simple table showing data lined up in columns.
83Notice that I include the table in a center'' environment to display
84it properly.
85The title is created simply as another paragraph in the center environment,
86rather than as part of the table itself.
87\begin{center}
88Numbers of Computers on Earth Sciences Network, By Type.
89
90\begin{tabular}{lr}
91Macintosh&175\\
92DOS/Windows PC&60\\
93UNIX Workstation or server&110\\
94\end{tabular}
95\end{center}
96
97Here is a more complicated table that has been boxed up, with a multi-column
98header and paragraph entries set in one of the columns.
99\begin{center}
100\begin{tabular}{|l|c|p{3.5in}|}
101\hline
102\multicolumn{3}{|c|}{Places to Go Backpacking}\\ \hline
103Name&Driving Time&Notes\\
104&(hours)&\\ \hline
105Big Basin&1.5&Very nice overnight to Berry Creek Falls from
106either Headquarters or ocean side.\\ \hline
107Sunol&1&Technicolor green in the spring.  Watch out for the cows.\\ \hline
108Henry Coe&1.5&Large wilderness nearby suitable for multi-day treks.\\ \hline
109\end{tabular}
110\end{center}
111
112\section {Mathematical Equations}
113Simple equations, like $x^y$ or $x_n = \sqrt{a + b}$ can be typeset right
114in the text line by enclosing them in a pair of single dollar sign symbols.
115Don't forget that if you want a real dollar sign in your text, like \$2000, 116you have to use the \verb+\$+ command.
117
118A more complicated equation should be typeset in {\em displayed math\/} mode,
119like this:
120$121z \left( 1 \ +\ \sqrt{\omega_{i+1} + \zeta -\frac{x+1}{\Theta +1} y + 1} 122\ \right) 123\ \ \ =\ \ \ 1 124$
125The equation'' environment displays your equations, and automatically
126numbers them consecutively within your document, like this:
127\begin{equation}
128\left[
129{\bf X} + {\rm a} \ \geq\
130\underline{\hat a} \sum_i^N \lim_{x \rightarrow k} \delta C
131\right]
132\end{equation}
134
135\pagebreak
136\noindent{\Large\bf Here is the input file that produced this document:}
137\begin{verbatim}
138% Example LaTeX document for GP111 - note % sign indicates a comment
139\documentstyle[11pt]{article}
140% Default margins are too wide all the way around.  I reset them here
141\setlength{\topmargin}{-.5in}
142\setlength{\textheight}{9in}
143\setlength{\oddsidemargin}{.125in}
144\setlength{\textwidth}{6.25in}
145\begin{document}
146\title{LaTeX Typesetting By Example}
147\author{Phil Farrell\\
148Stanford University School of Earth Sciences}
149\renewcommand{\today}{November 2, 1994}
150\maketitle
151This article demonstrates a basic set of LaTeX formatting commands.
152Compare the typeset output side-by-side with the input document.
153
154\section {Plain Text}
155Type your text in free-format; lines can be as long
156or as short
157as you wish.
158        You can indent         or space out
160            text in
161                any way you like to highlight the structure
162        of your manuscript and make it easier to edit.
163LaTeX fills lines and adjusts spacing between words to produce an
164aesthetically pleasing result.
165
166Completely blank lines in the input file break your text into
167paragraphs.
168To change the font for a single character, word, or set of words,
169enclose the word and the font changing command within braces,
170{\em like this}.
171A font changing command not enclosed in braces, like the change to \bf
172bold here, keeps that change in effect until the end of the document or
173until countermanded by another font switch, like this change back to
174\rm roman.
175
176\section {Displayed Text}
177Use the quote'' and  quotation'' environments for typesetting quoted
178material or any other text that should be slightly indented and set off
179from the normal text.
180\begin{quotation}
181The quote and quotation environments are similar, but use different
182settings for paragraph indentation and spacing.
183
184\em When in doubt, consult the manual.
185\end{quotation}
186
187So far, I have demonstrated titles, paragraphs, font changes, and
189Now, I am going to show lists and tables.
190\begin{enumerate}
191\item
192The enumerate'' environment numbers the list elements, like this.
193
194Items in a list can contain multiple paragraphs.
195These paragraphs are appropriately spaced and indented according to their
196position in the list.
197   \begin{itemize}
198   \item The itemize'' environment sets off list items with bullets'',
199like this.  Finally, the description'' environment lets you put your own
200      \begin{description}
201      \item[A] label on each item, like this A''.
202      \item[If the label is long,] the first line of the item text will
203be spaced over to the right as needed.
204      \end{description}
205   \item Of course, lists can be nested, each type up to at least four levels.
206One type of list can be nested within another type.
207      \begin{itemize}
208      \item Nested lists of the same type will change style of numbering
209or bullets'' as needed.
210      \end{itemize}
211   \end{itemize}
212\item Don't forget to close off all list environments with the
213appropriate \verb+\end{...}+ command.
214Indenting \verb+\begin{...}+, \verb+\item+, and \verb+\end{...}+
215commands in the input document according to their nesting level can help
216clarify the structure.
217\end{enumerate}
218
219Here is a very simple table showing data lined up in columns.
220Notice that I include the table in a center'' environment to display
221it properly.
222The title is created simply as another paragraph in the center environment,
223rather than as part of the table itself.
224\begin{center}
225Numbers of Computers on Earth Sciences Network, By Type.
226
227\begin{tabular}{lr}
228Macintosh&175\\
229DOS/Windows PC&60\\
230UNIX Workstation or server&110\\
231\end{tabular}
232\end{center}
233
234Here is a more complicated table that has been boxed up, with a multi-column
235header and paragraph entries set in one of the columns.
236\begin{center}
237\begin{tabular}{|l|c|p{3.5in}|}
238\hline
239\multicolumn{3}{|c|}{Places to Go Backpacking}\\ \hline
240Name&Driving Time&Notes\\
241&(hours)&\\ \hline
242Big Basin&1.5&Very nice overnight to Berry Creek Falls from
243either Headquarters or ocean side.\\ \hline
244Sunol&1&Technicolor green in the spring.  Watch out for the cows.\\ \hline
245Henry Coe&1.5&Large wilderness nearby suitable for multi-day treks.\\ \hline
246\end{tabular}
247
248\section {Mathematical Equations}
249Simple equations, like $x^y$ or $x_n = \sqrt{a + b}$ can be typeset right
250in the text line by enclosing them in a pair of single dollar sign symbols.
251Don't forget that if you want a real dollar sign in your text, like \$2000, 252you have to use the \verb+\$+ command.
253
254
255A more complicated equation should be typeset in {\em displayed math\/} mode,
256like this:
257$258z \left( 1 \ +\ \sqrt{\omega_{i+1} + \zeta -\frac{x+1}{\Theta +1} y + 1} 259\ \right) 260\ \ \ =\ \ \ 1 261$
262The equation'' environment displays your equations, and automatically
263numbers them consecutively within your document, like this:
264\begin{equation}
265\left[
266{\bf X} + {\rm a} \ \geq\
267\underline{\hat a} \sum_i^N \lim_{x \rightarrow k} \delta C
268\right]
269\end{equation}
270
271\end{document}
272\end{verbatim}
273\end{document}
274