Jump to content

User:AndrewKepert/TeX sample

From Wikipedia, the free encyclopedia
The rendered output.

A sample TeX document, under development. See talk:TeX. Edit the page to grab the .tex file in a coherent format. Feel free to adjust it - it will eventually be an one-page sample document for the TeX article. A plain TeX version will follow.

\documentclass[letterpaper,11pt]{article}
% The preamble section.
\usepackage{fullpage}
\title{A Sample Document}
\author{Wikipedians}
\newcommand{\WP}{\textsf{Wikipedia}}
\newcommand{\implies}{\;\Longrightarrow\;}

\begin{document}

\maketitle % spit out title, author, date

This tiny sample showcases \TeX\ and \LaTeX\ for  \WP. 
More comprehensive examples, such as Lamport's \texttt{sample.tex} 
(see \cite{Lamport94})
are available with any standard \TeX\ distribution, or via
\texttt{www.tug.org}.
Only  \TeX nicians need \cite{Mittelbach04}.
%  The source file is read by the \TeX\ program to produce an
%  output document which is formatted according to the commands in the
%  source file.

\section{Documents, Sections and Paragraphs}
A \LaTeX\ source file begins with a class declaration,
followed by a preamble section, and the body of the document.  
The preamble contains settings and definitions.
The body can contain sections, subsections, paragraphs, lists, equations,
footnotes\footnote{This is a footnote.}, figures and tables,
and also commands for automatically-generated structures
such as a table of contents, bibliography, index and glossary.

Commands such as ``\verb|\section|'' introduce
a new section, whilst an empty line delimits paragraphs.
Other surplus white                 space 
           is
usually         ignored.

\section{Features}
Both \TeX\ and \LaTeX\ allow for \`a\c c\v c\'e\~nts, and
excel at typesetting mathematical equations,
both in-line or displayed on a line by itself.
For instance, an article on quadratics may need
\[ax^2+bx+c=0 \implies x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\;,\]
or an article on complex analysis may include
\(e^{i\theta} = \cos\theta + i\sin\theta\).

\begin{thebibliography}{8}
\bibitem{Lamport94}
Leslie Lamport, \textsl{\LaTeX\ User's Guide and Reference Manual},
second edition, Addison-Wesley, 1994.
\bibitem{Mittelbach04}
Frank Mittelbach, and Michel Goosens,
\textsl{The \LaTeX\ Companion}, second edition, Addison-Wesley, 2004.
\end{thebibliography}

\end{document}