Example 1. Barebone Latex file
\documentclass[11pt]{article} % Preamble \begin{document} %body \end{document}
*References*: [ASI] $2.1, p10.
In printed books, words are emphasized by typesetting them in an italic font,
around the edges by using \fbox instead. (More on framing in $6, p. 81.) The
This is \textbf{boldface}. This is \textit{italic}. This is \textrm{roman}. This is \textsc{small caps}. This is \textsf{sans serif}. This is \textsl{slanted}. This is \texttt{typewriter}.
Some combinations of font styles can be produced. For example,
\textbf{\textit{bolditalic}}
> All the books I read (quite limited though :->) use \textbf for > bolding, but I also see people use \bf.
\bf was borrowed from plain TeX and is now obsolete in LaTeX2e and should not be used.
> The recommended syntax is \textbf{stuff} unless the stuff > is very long, in which case {\bfseries stuff} is better > because TeX won't fill up your memory looking for the } > of the argument.
More or less. {bfseries …} also works a bit more quickly and therefore has two reasons to be preferred by class and package writers
\tiny, \scriptsize, \footnotesize, or \small. \normalsize, \large, \Large, \LARGE, \huge or \Huge.
Molly Alene Edmonds
The use of braces to enclose a font size specification is like an environment. Optionally, we can explicitly use the environment syntax: environment syntax is useful when you want to keep the size for a large block of text, and the braces format is useful for short phrases.
There is no intrinsic environment for font styles.
The flushleft environment allows you to create a paragraph consisting of lines that are flushed left to the left-hand margin. Each line must be terminated with a \\.
\begin{flushleft} Text on line 1 \\ Text on line 2 \\ .... .... \end{flushleft}
Same for flushright.
This declaration corresponds to the flushleft environment. This declaration can be used inside an environment such as quote or in a parbox.
Unlike the flushleft environment, the \raggedright command does not start a new paragraph; it simply changes how LaTeX formats paragraph units. To affect a paragraph unit's format, the scope of the declaration must contain the blank line or \end command (of an environment like quote) that ends the paragraph unit.
Same for \raggedleft.
To center the text/graphics, put them inside a center environment
\begin{center} text \includegraphics[width=2in]{graphic.eps} \end{center}
If the \includegraphics command is inside an environment (such as minipage or figure), the \centering declaration centers the remaining output of the environment. For example
\begin{figure} \centering \includegraphics[width=2in]{graphic.eps} \end{figure}
is similar to
\begin{figure} \begin{center} \includegraphics[width=2in]{graphic.eps} \end{center} \end{figure}
double vertical space above and below the figure due to the space produced by the figure environment and by the center environment. If extra vertical space is desired, the commands in Section 18.1 should be used.
\hspace[*]{len}
The \hspace command adds horizontal space. The length of the space len can be expressed in any terms that LaTeX understands, i.e., points, inches, etc. You can add negative as well as positive space with an \hspace command. Adding negative space is like backspacing.
LaTeX removes horizontal space that comes at the end of a line. If you don't want LaTeX to remove this space, include the optional * argument. Then the space is never removed.
\usepackage{setspace}
\singlespacing \onehalfspacing \doublespacing
You can cause a new line by entering \linebreak. When text is justified (the default), this could result in an undesirable appearance, like the following:
\textsf{This example is \linebreak extreme.}
The \newline command forces a new line without justifying it.
\textsf{Here is the extreme \newline example.}
The \nolinebreak command works analogously, preventing a line break, even if it means extending into the right margin.
There are two commands to force a page break: \pagebreak and \newpage. The \newpage command follows the analogy with \newline in forcing a page break precisely at the point it is specified, rather than completing the line as \pagebreak does. The \nopagebreak command disallows a page break immediately following the next blank line. The \samepage command prevents a page break within its scope. Here is an example that keeps line 1 on the same page as line 2.
There are three intrinsic list environments, distinguished by what appears at the beginning of each item: number, bullet, or your description (perhaps nothing).
\begin{itemize}
\item This is item 1 and our task has just begun. Blank lines before an item have no effect.
\item This is item 2 and we shall limit to just this few.
A blank line within an item does create a new paragraph, using the indentation of the itemize environment.
\begin{itemize}
\item A second (nested) itemized list changes the bullet and indents another level. \end{itemize}
\end{itemize}
\begin{enumerate}
\item This is item 1, and we are having fun. \item This is item 2, and it's time to number anew. \begin{enumerate} \item Back to item 1, but we are not yet done. \item Two is new. \begin{enumerate} \item One again! \item Two (b) or knot 2b? \end{enumerate} \end{enumerate} \end{enumerate}
\begin{description} \item [Basic Document Preparation.] Knowing how to setup ... \item [Making Tables.] \LaTeX~ provides a means ... \item [Bibliography.] Knowing how to create a bibliography ... \item [Mathematics.] This is the power of \LaTeX~ and one ... \item [Graphics.] This has progressed a great deal in the ... \item [Other.] There are a great many things to learn ... \end{description}
\newcommand{\lib}{\begin{itemize}} % item list begin \newcommand{\lie}{\end{itemize}} % item list end \newcommand{\leb}{\begin{enumerate}} % enumerate list begin \newcommand{\lee}{\end{enumerate}} % enumerate list end \newcommand{\ldb}{\begin{description}} % description list begin \newcommand{\lde}{\end{description}} % description list end
\begin{quote} short quotes, generally one short paragraph (as above), or a sequence of one line quotes, separated by blank lines \end{quote}
\begin{quotation} ``The indentation is the same as the quote, except the first line of each new paragraph is indented. \bigskip ``Next paragraph.'' \hfill --- Author \end{quotation}
Now consider ways to indent a block of text. Here is an example using the
The quote environment is intended for short quotes, generally one short paragraph (as above), or a sequence of one line quotes, separated by blank lines. The quotation environment is used for long quotations, having more than one paragraph (separated by blank lines). The indentation is the same as the quote, except the first line of each new paragraph is indented. (Just as in the regular text, this can be overridden by the \noindent command.) Here is an
The quotes are by two pioneers of algorithms, Alan M. Turing and Donald E. Knuth. Their names appear on the right, after their quote, by skipping a line and entering \hfill (which means horizontal fill), to make the line flush right. Here are some other things to notice about this example:
*Tags*: expressions
\[ ... \]
NO empty line between \[ and \] allowed! |
\[ (L_i < R_j < R_i) \iif \mbox{$i$ is the ancestor of $j$} \]
One can write mathematical expressions by entering math mode, signified by delimiters $ … $ or \[ … \]. The $ delimiter keeps the mathematical expression in the text, like this:
A consequence of Einstein's postulates is that $E = mc^2$.
The other form is math display mode, like this:
A consequence of Einstein's postulates is that \[E = mc^2.\])
*References*: [ASI] s4, p43.
A counter is a numerical value that refers to something that is being numbered, such as pages, sections, figures, and equations. A label is the identification of a particular value, and a reference is a citation to a the counter's value is set, where label is unique in the document. The LATEX defined:
\section{Bibliography with \Bibtex} \label{sec:Bibliography}
arbitrary, except do not use LATEX special characters or blanks, just as the labels in the bib file entries.
There are times when you just want to produce the counter value, without a label. This is done by \thecounter. For example, \thepage produces the page number. On the other hand, if you want to use the counter's numerical value as
\thepage, \thesubsection \thesection
\subsection{The bib File} \label{subsec:bibfile} \subsubsection{Web citations} \label{subsubsec:webcite}
To illustrate how I can reference other parts of this document, the above labels were defined (when the subsection and subsubsection were first written):
Then, I can refer to these as follows:
\S\ref{subsec:bibfile} => $3.2 \S\ref{subsubsec:webcite} => $3.2.2
I can also refer to their page numbers:
p.~\pageref{subsubsec:webcite} => p. 36 p.~\pageref{subsec:bibfile} => p. 31
You can also suppress indentation of the first line of a paragraph with the \noindent command. Here is an example:
\noindent This paragraph is not indented.