0% found this document useful (0 votes)
96 views19 pages

Latex Class: Basics of Latex How To Prepare Articles and Books

The document discusses the basics of LaTeX including: - Common document classes like article, report, book and their uses. - Options that can be passed to document classes like paper size, font size, etc. - Common packages that add functionality to LaTeX like amsmath for math. - How to structure documents with sections, references, bibliography and more. - Formatting text with emphasis, fonts, line breaks, boxes, and footnotes.

Uploaded by

swapan sarkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views19 pages

Latex Class: Basics of Latex How To Prepare Articles and Books

The document discusses the basics of LaTeX including: - Common document classes like article, report, book and their uses. - Options that can be passed to document classes like paper size, font size, etc. - Common packages that add functionality to LaTeX like amsmath for math. - How to structure documents with sections, references, bibliography and more. - Formatting text with emphasis, fonts, line breaks, boxes, and footnotes.

Uploaded by

swapan sarkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Latex Class

Basics of Latex
How to prepare articles and books
Prelimnaries
\documentclass[options]{class}

..
.

\usepackage[options]{class}

..
.

\pagestyle{style|}

..
.
\begin{document}
. . . \end{document}
Class
[article] for articles in scientific journals, presentations, short
reports, program documentation, invitations, . . .
[proc] a class for proceedings based on the article class.
[minimal] is as small as it can get. It only sets a page size and a
base font. It is mainly used for debugging purposes.
[report] for longer reports containing several chapters, small
books, PhD theses, . . .
[book] for real books
[slides] for slides. The class uses big sans serif letters.
[publisher provided] Publishers themselves provide files for
you.
Options
[10pt, 11pt, 12pt] Sets the size of the main font in the
document. If no option is specified, 10pt is assumed.
[a4paper, letterpaper, . . . ] Defines the paper size. The
default size is letterpaper. Besides that, a5paper, b5paper,
executivepaper, and legalpaper can be specified.
[fleqn] Typesets displayed formulae left-aligned instead of
centred.
[leqno] Places the numbering of formulae on the left hand side
instead of the right.
[titlepage, notitlepage] Specifies whether a new page
should be started after the document title or not.
Options
[onecolumn, twocolumn] Instructs LATEX to typeset the
document in one column or two columns.
[twoside, oneside] Specifies whether double or single sided
output should be generated. The classes article and report
are single sided and the book class is double sided by default.
Note that this option concerns the style of the document only.
The option twoside does not tell the printer you use that it
should actually make a two-sided printout.
[landscape] Changes the layout of the document to print in
landscape mode.
[openright, openany] Makes chapters begin either only on
right hand pages or on the next page available.
Packages
[exscale] Provides scaled versions of the math extension font.

[fontenc] Specifies which font encoding LATEX should use.

[ifthen] Provides commands of the form


if. . . then do. . . otherwise do. . . .

[latexsym] To access the LATEX symbol font, you should use the
latexsym package.
[makeidx] Provides commands for producing indexes.
[syntonly] Processes a document without typesetting it.
[amsmath, amssymb, amsfont] AMS Math society packages
Packages
[plain] prints the page numbers on the bottom of the page, in
the middle of the footer. This is the default page style.
[headings] prints the current chapter heading and the page
number in the header on each page, while the footer remains
empty. (This is the style used in this document)
[empty] sets both the header and the footer to be empty.

\thispagestyle{style}
Typesetting text
The most important text unit in LATEX (and in typography) is
the paragraph.
You can force line breaks with e.g. \\, and paragraph breaks
with e.g. leaving an empty line in the source code. Many
people, especially in LATEX, introduce paragraph breaks
without knowing it.
Paragraph- unintended
Example 1
\ldots when Einstein introduced his formula
\begin{equation}
e = m \cdot c^2 \; ,
\end{equation}
which is at the same time the most widely known
and the least well understood physical formula.
--------------------------------------------------
Example 2
\ldots from which follows Kirchhoffs current law:
\begin{equation}
\sum_{k=1}^{n} I_k = 0 \; .
\end{equation}

Kirchhoffs voltage law can be derived \ldots


Example 1 . . . when Einstein introduced his formula

e = m c2 , (1)

which is at the same time the most widely known and the least well
understood physical formula.
Example 2 . . . from which follows Kirchhoffs current law:
X
n
Ik = 0 . (2)
k=1

Kirchhoffs voltage law can be derived . . .


Line Breaks
\\ or \newline

starts a new line without starting a new paragraph.

\\*

additionally prohibits a page break after the forced line break.

\newpage

starts a new page.

\linebreak[n], \nolinebreak[n], \pagebreak[n] and \nopagebreak[n]


Words Together
Several words can be kept together on one line with the
command

\mbox{text}

It causes its argument to be kept together under all


circumstances.
\fbox is similar to \mbox, but in addition there will be a visible
box drawn around the content.
Sections
The following sectioning commands are available for the article
class:

\section{...}
\subsection{...}
\subsubsection{...}
\paragraph{...}
\subparagraph{...}

Two of the sectioning commands are a bit special:


The \part command does not influence the numbering
sequence of chapters.
The \appendix command does not take an argument. It
just changes the chapter numbering to letters.
When you work with the report or book class, an additional
top-level sectioning command becomes available

\chapter{...}

As the article class does not know about chapters, it is quite


easy to add articles as chapters to a book. The spacing between
sections, the numbering and the font size of the titles will be
set automatically by LATEX.
LATEX creates a table of contents by taking the section headings
and page numbers from the last compile cycle of the document.
The command

\tableofcontents

expands to a table of contents at the place it is issued.


The title of the whole document is generated by issuing a

\maketitle

command. The contents of the title have to be defined by the


commands

\title{...}, \author{...} and optionally \date{...}

before calling \maketitle.


LATEX provides the following commands for cross referencing

\label{marker }, \ref{marker } and \pageref{marker }

where marker is an identifier chosen by the user. LATEX


replaces \ref by the number of the section, subsection, figure,
table, or theorem after which the corresponding \label
command was issued. \pageref prints the page number of the
page where the \label command occurred.

A reference to this page


A reference to this page looks like:
\label{page:this} looks like:
see page 15
see page ~\pageref{page:this}
With the command

\footnote{footnote text}

a footnote is printed at the foot of the current page.

Footnotes\footnote{This is Footnotesa are often used by people


a footnote.} are often used using LATEX.
by people using \LaTeX. a This is a footnote.
Emphasizing and Underlining.

\underline{text}

\emph{text}

\emph{If you use


emphasizing inside a piece
If you use emphasizing inside a piece
of emphasized text, then
of emphasized text, then LATEX uses
\LaTeX{} uses the
the normal font for emphasizing.
\emph{normal} font for
emphasizing.}

Please note the difference between telling LATEX to emphasize


something and telling it to use a different font:
\textit{You can also
\emph{emphasize} text if
it is set in italics,} You can also emphasize text if it is
\textsf{in a set in italics, in a sans-serif font, or
\emph{sans-serif} font,} in typewriter style.
\texttt{or in
\emph{typewriter} style.}

You might also like