Sie sind auf Seite 1von 79

Text and Paragraph formatting

February 18, 2017

Text and Paragraph formatting


Text Fonts

I The following commands change size of a text.

Text and Paragraph formatting


Text Fonts

I The following commands change size of a text.

\Huge{Latex} Latex

Text and Paragraph formatting


Text Fonts

I The following commands change size of a text.

\Huge{Latex} Latex
\huge{Latex}
Latex

Text and Paragraph formatting


Text Fonts

I The following commands change size of a text.

\Huge{Latex} Latex
\huge{Latex}
Latex
Latex
\Large{Latex}

Text and Paragraph formatting


Text Fonts

I The following commands change size of a text.

\Huge{Latex} Latex
\huge{Latex}
Latex
Latex
\Large{Latex}
Latex
\large{Latex}

Text and Paragraph formatting


Text Fonts

I The following commands change size of a text.

\Huge{Latex} Latex
\huge{Latex}
Latex
Latex
\Large{Latex}
Latex
\large{Latex}
Latex
\small{Latex}

Text and Paragraph formatting


Text Fonts

I The following commands change size of a text.

\Huge{Latex} Latex
\huge{Latex}
Latex
Latex
\Large{Latex}
Latex
\large{Latex}
Latex
\small{Latex}
Latex
\tiny{Latex}

Text and Paragraph formatting


Bold, italic, underlined and emphasised text

To make a text bold use \textbf command.

Text and Paragraph formatting


Bold, italic, underlined and emphasised text

To make a text bold use \textbf command.


\textbf{latex workshop} latex workshop

Text and Paragraph formatting


Bold, italic, underlined and emphasised text

To make a text bold use \textbf command.


\textbf{latex workshop} latex workshop
To make a text italic use \textit command.

Text and Paragraph formatting


Bold, italic, underlined and emphasised text

To make a text bold use \textbf command.


\textbf{latex workshop} latex workshop
To make a text italic use \textit command.
\textit{latex workshop} latex workshop

Text and Paragraph formatting


Bold, italic, underlined and emphasised text

To make a text bold use \textbf command.


\textbf{latex workshop} latex workshop
To make a text italic use \textit command.
\textit{latex workshop} latex workshop
To make a underlined text use \underline command.

Text and Paragraph formatting


Bold, italic, underlined and emphasised text

To make a text bold use \textbf command.


\textbf{latex workshop} latex workshop
To make a text italic use \textit command.
\textit{latex workshop} latex workshop
To make a underlined text use \underline command.
\underline{latex workshop} latex workshop

Text and Paragraph formatting


Bold, italic, underlined and emphasised text

To make a text bold use \textbf command.


\textbf{latex workshop} latex workshop
To make a text italic use \textit command.
\textit{latex workshop} latex workshop
To make a underlined text use \underline command.
\underline{latex workshop} latex workshop
To emphasising a text use \emph command.

Text and Paragraph formatting


Bold, italic, underlined and emphasised text

To make a text bold use \textbf command.


\textbf{latex workshop} latex workshop
To make a text italic use \textit command.
\textit{latex workshop} latex workshop
To make a underlined text use \underline command.
\underline{latex workshop} latex workshop
To emphasising a text use \emph command.
\emph{latex workshop} latex workshop

Text and Paragraph formatting


Bold, italic, underlined and emphasised text

To make a text bold use \textbf command.


\textbf{latex workshop} latex workshop
To make a text italic use \textit command.
\textit{latex workshop} latex workshop
To make a underlined text use \underline command.
\underline{latex workshop} latex workshop
To emphasising a text use \emph command.
\emph{latex workshop} latex workshop
Emphasised and italic texts are not same.

Text and Paragraph formatting


Bold, italic, underlined and emphasised text

To make a text bold use \textbf command.


\textbf{latex workshop} latex workshop
To make a text italic use \textit command.
\textit{latex workshop} latex workshop
To make a underlined text use \underline command.
\underline{latex workshop} latex workshop
To emphasising a text use \emph command.
\emph{latex workshop} latex workshop
Emphasised and italic texts are not same.
\textit{latex \emph{workshop}} latex workshop

Text and Paragraph formatting


Geometry

I Geometry can be defined by importing the package


\usepackage{geometry}

Text and Paragraph formatting


Geometry

I Geometry can be defined by importing the package


\usepackage{geometry}
I Use the following command before starting of the document.
\geometry{left=20 mm, right=21 mm, top=22 mm, bottom=25 mm}

Text and Paragraph formatting


Geometry

I Geometry can be defined by importing the package


\usepackage{geometry}
I Use the following command before starting of the document.
\geometry{left=20 mm, right=21 mm, top=22 mm, bottom=25 mm}
I It creates margins of length 20 mm, 21 mm, 22 mm, 25 mm
at left, right, top and bottom side of the page respectively.

Text and Paragraph formatting


Page Numbering

This command \pagenumbering{roman} sets the page


numbers to lowercase Roman numerals.

Text and Paragraph formatting


Page Numbering

This command \pagenumbering{roman} sets the page


numbers to lowercase Roman numerals.
The command \setcounter{page}{3} manually set the
page counter to 3 in this page, subsequent pages are
numbered starting the count from this one.

Text and Paragraph formatting


Page Numbering

This command \pagenumbering{roman} sets the page


numbers to lowercase Roman numerals.
The command \setcounter{page}{3} manually set the
page counter to 3 in this page, subsequent pages are
numbered starting the count from this one.
The command \pagenumbering{arabic} switches page
numbering to Arabic and it will also restart the page
counter.

Text and Paragraph formatting


Header and Footer

The command \pagestyle{empty} clears both header and


footer.

Text and Paragraph formatting


Header and Footer

The command \pagestyle{empty} clears both header and


footer.
The command \pagestyle{plain} keeps the default style.
Header is empty and footer contains page number at the
center.

Text and Paragraph formatting


Header and Footer

The command \pagestyle{empty} clears both header and


footer.
The command \pagestyle{plain} keeps the default style.
Header is empty and footer contains page number at the
center.
For the command \pagestyle{myheadings} the footer is
empty and the header contains the page number on right
side (on even pages) or on left side (on odd pages) along
with other user-supplied information; there is an exception
for the first page of each chapter, where the footer contains
centred page number while the header is blank.

Text and Paragraph formatting


Header and Footer

The command \pagestyle{empty} clears both header and


footer.
The command \pagestyle{plain} keeps the default style.
Header is empty and footer contains page number at the
center.
For the command \pagestyle{myheadings} the footer is
empty and the header contains the page number on right
side (on even pages) or on left side (on odd pages) along
with other user-supplied information; there is an exception
for the first page of each chapter, where the footer contains
centred page number while the header is blank.
To leave a intentionally blank page or to remove the header
and footer from the current chapter page use the command
\thispagestyle{empty}.

Text and Paragraph formatting


Header and Footer

I To customize the footer and header in your document first


import the package fancyhdr with \usepackage{fancyhdr}

Text and Paragraph formatting


Header and Footer

I To customize the footer and header in your document first


import the package fancyhdr with \usepackage{fancyhdr}
I Then following commands can be applied before starting of
the document.

Text and Paragraph formatting


Header and Footer

I To customize the footer and header in your document first


import the package fancyhdr with \usepackage{fancyhdr}
I Then following commands can be applied before starting of
the document.
\pagestyle{fancy}

Text and Paragraph formatting


Header and Footer

I To customize the footer and header in your document first


import the package fancyhdr with \usepackage{fancyhdr}
I Then following commands can be applied before starting of
the document.
\pagestyle{fancy}
\rhead{text 1} prints text 1 on the right side of header.

Text and Paragraph formatting


Header and Footer

I To customize the footer and header in your document first


import the package fancyhdr with \usepackage{fancyhdr}
I Then following commands can be applied before starting of
the document.
\pagestyle{fancy}
\rhead{text 1} prints text 1 on the right side of header.
\lhead{text 2} prints text 2 on the left side of header.

Text and Paragraph formatting


Header and Footer

I To customize the footer and header in your document first


import the package fancyhdr with \usepackage{fancyhdr}
I Then following commands can be applied before starting of
the document.
\pagestyle{fancy}
\rhead{text 1} prints text 1 on the right side of header.
\lhead{text 2} prints text 2 on the left side of header.
\chead{text 3} prints text 3 on the center of header.

Text and Paragraph formatting


Header and Footer

I To customize the footer and header in your document first


import the package fancyhdr with \usepackage{fancyhdr}
I Then following commands can be applied before starting of
the document.
\pagestyle{fancy}
\rhead{text 1} prints text 1 on the right side of header.
\lhead{text 2} prints text 2 on the left side of header.
\chead{text 3} prints text 3 on the center of header.
\rfoot{text 4} prints text 4 on the right side of footer.

Text and Paragraph formatting


Header and Footer

I To customize the footer and header in your document first


import the package fancyhdr with \usepackage{fancyhdr}
I Then following commands can be applied before starting of
the document.
\pagestyle{fancy}
\rhead{text 1} prints text 1 on the right side of header.
\lhead{text 2} prints text 2 on the left side of header.
\chead{text 3} prints text 3 on the center of header.
\rfoot{text 4} prints text 4 on the right side of footer.
\lfoot{text 5} prints text 5 on the right side of footer.

Text and Paragraph formatting


Header and Footer

I To customize the footer and header in your document first


import the package fancyhdr with \usepackage{fancyhdr}
I Then following commands can be applied before starting of
the document.
\pagestyle{fancy}
\rhead{text 1} prints text 1 on the right side of header.
\lhead{text 2} prints text 2 on the left side of header.
\chead{text 3} prints text 3 on the center of header.
\rfoot{text 4} prints text 4 on the right side of footer.
\lfoot{text 5} prints text 5 on the right side of footer.
\cfoot{text 6} prints text 6 on the center of footer.

Text and Paragraph formatting


Header and Footer

I If your document is double-sided, you can customize the


header and the footer with the commands \fancyhead and
\fancyfoot with several selectors passed as parameters.

Text and Paragraph formatting


Header and Footer

I If your document is double-sided, you can customize the


header and the footer with the commands \fancyhead and
\fancyfoot with several selectors passed as parameters.
These selectors are
E for even page
O for odd page
L for left side
R for right side
C for centred

Text and Paragraph formatting


Header and Footer

I Write the following commands before starting of the docu-


ment.

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE,RO]{Text 1}
\fancyhead[RE,LO]{Text 2}
\fancyfoot[CE,CO]{Text 3}
\fancyfoot[LE,RO]{Text 4}

Text and Paragraph formatting


Header and Footer

I Write the following commands before starting of the docu-


ment.

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE,RO]{Text 1}
\fancyhead[RE,LO]{Text 2}
\fancyfoot[CE,CO]{Text 3}
\fancyfoot[LE,RO]{Text 4}

I For instance, \fancyhead[LE,RO]{Text 1} will print the


text Text 1 on the left side of the header for even pages,
and the right side for odd pages.

Text and Paragraph formatting


Section and Subsection

The command \section{Section Name} creates a section


named Section name with number.

Text and Paragraph formatting


Section and Subsection

The command \section{Section Name} creates a section


named Section name with number.
The command \section*{Section Name} creates a
section named Section name with no number.

Text and Paragraph formatting


Section and Subsection

The command \section{Section Name} creates a section


named Section name with number.
The command \section*{Section Name} creates a
section named Section name with no number.
The command \subsection{Subsection Name} creates a
subsection named Subsection Name and numbered as 2.3
if it is third subsection of second section.

Text and Paragraph formatting


Section and Subsection

The command \section{Section Name} creates a section


named Section name with number.
The command \section*{Section Name} creates a
section named Section name with no number.
The command \subsection{Subsection Name} creates a
subsection named Subsection Name and numbered as 2.3
if it is third subsection of second section.
The command \subsection*{Subsection Name} creates a
subsection named Subsection Name with no number.

Text and Paragraph formatting


Section and Subsection

The command \section{Section Name} creates a section


named Section name with number.
The command \section*{Section Name} creates a
section named Section name with no number.
The command \subsection{Subsection Name} creates a
subsection named Subsection Name and numbered as 2.3
if it is third subsection of second section.
The command \subsection*{Subsection Name} creates a
subsection named Subsection Name with no number.
Part and Chapter can be created by the commands
\part{Part Name} and \chapter{Chapter Name}
respectively. But these are applicable only for report and
book.

Text and Paragraph formatting


Paragraph formatting

Use \par or leave one blank line to make a new paragraph.

Text and Paragraph formatting


Paragraph formatting

Use \par or leave one blank line to make a new paragraph.


I In general at the start of a new paragraph indentation is
defined and there is no blank line between two successive
paragraphs. But we can always handle these things manu-
ally.

Text and Paragraph formatting


Paragraph formatting

Use \par or leave one blank line to make a new paragraph.


I In general at the start of a new paragraph indentation is
defined and there is no blank line between two successive
paragraphs. But we can always handle these things manu-
ally.
\setlength{\parindent}{4 cm} produce 4 cm
indentation for each paragraph appearing after that
command.

Text and Paragraph formatting


Paragraph formatting

Use \par or leave one blank line to make a new paragraph.


I In general at the start of a new paragraph indentation is
defined and there is no blank line between two successive
paragraphs. But we can always handle these things manu-
ally.
\setlength{\parindent}{4 cm} produce 4 cm
indentation for each paragraph appearing after that
command.
To write a particular paragraph with no indent use
\noindent command at the start of the paragraph.

Text and Paragraph formatting


Paragraph formatting

Use \par or leave one blank line to make a new paragraph.


I In general at the start of a new paragraph indentation is
defined and there is no blank line between two successive
paragraphs. But we can always handle these things manu-
ally.
\setlength{\parindent}{4 cm} produce 4 cm
indentation for each paragraph appearing after that
command.
To write a particular paragraph with no indent use
\noindent command at the start of the paragraph.
\setlength{\parskip}{1 cm} produce 1 cm gap between
two successive paragraphs.

Text and Paragraph formatting


Text Alignment

All the text in between \begin{flushleft} and


\end{flushleft} is left-justified. The switch command
\raggedright will also produce left-aligned text, but the
behaviour is different; in this case the text will be
left-aligned from the point where the command is declared
till another switch command is used.

Text and Paragraph formatting


Text Alignment

All the text in between \begin{flushleft} and


\end{flushleft} is left-justified. The switch command
\raggedright will also produce left-aligned text, but the
behaviour is different; in this case the text will be
left-aligned from the point where the command is declared
till another switch command is used.
All the text in between \begin{flushright} and
\end{flushright} is right-justified. The switch command
\raggedleft will also produce right-aligned text, but the
behaviour is different; in this case the text will be
right-aligned from the point where the command is
declared till another switch command is used.

Text and Paragraph formatting


Text Alignment

All the text in between \begin{center} and


\end{center} is centred. The switch command
\centering will also produce centred text, but the
behaviour is different; in this case the text will be centred
from the point where the command is declared till another
switch command is used.

Text and Paragraph formatting


Text Alignment

All the text in between \begin{center} and


\end{center} is centred. The switch command
\centering will also produce centred text, but the
behaviour is different; in this case the text will be centred
from the point where the command is declared till another
switch command is used.
In LATEX text is fully-justified by default and if a switch
command such as \raggedright or \raggedleft is used,
the text alignment can not be switched back. For this case
scenario you can use the package ragged2e. Import it
adding \usepackage{ragged2e} and use the \justify
command.

Text and Paragraph formatting


Multiple columns
To create a document with multiple columns, the package
multicol provide a set of commands imported by
\usepackage{multicol}

Text and Paragraph formatting


Multiple columns
To create a document with multiple columns, the package
multicol provide a set of commands imported by
\usepackage{multicol}
1 cm space between two columns can be created by the
command \setlength{\columnsep}{1 cm}

Text and Paragraph formatting


Multiple columns
To create a document with multiple columns, the package
multicol provide a set of commands imported by
\usepackage{multicol}
1 cm space between two columns can be created by the
command \setlength{\columnsep}{1 cm}
The following command separate BODY into 3 columns
each of equal height.

Text and Paragraph formatting


Multiple columns
To create a document with multiple columns, the package
multicol provide a set of commands imported by
\usepackage{multicol}
1 cm space between two columns can be created by the
command \setlength{\columnsep}{1 cm}
The following command separate BODY into 3 columns
each of equal height.
\begin{multicols}{3}
BODY
\end{multicols}

Text and Paragraph formatting


Multiple columns
To create a document with multiple columns, the package
multicol provide a set of commands imported by
\usepackage{multicol}
1 cm space between two columns can be created by the
command \setlength{\columnsep}{1 cm}
The following command separate BODY into 3 columns
each of equal height.
\begin{multicols}{3}
BODY
\end{multicols}
For the following command BODY is printed in a column
till the end of the page is reached, then it continues in the
next column and so on.

Text and Paragraph formatting


Multiple columns
To create a document with multiple columns, the package
multicol provide a set of commands imported by
\usepackage{multicol}
1 cm space between two columns can be created by the
command \setlength{\columnsep}{1 cm}
The following command separate BODY into 3 columns
each of equal height.
\begin{multicols}{3}
BODY
\end{multicols}
For the following command BODY is printed in a column
till the end of the page is reached, then it continues in the
next column and so on.
\begin{multicols*}{3}
BODY
\end{multicols*}
Text and Paragraph formatting
Line breaks and blank spaces

Each of the commands \\ or \newline or \hfill\break


used to start a new line with no indent.

Text and Paragraph formatting


Line breaks and blank spaces

Each of the commands \\ or \newline or \hfill\break


used to start a new line with no indent.
\vspace{5 mm} inserts a vertical space whose length is 5
mm and the skip is discarded at the start of next page.

Text and Paragraph formatting


Line breaks and blank spaces

Each of the commands \\ or \newline or \hfill\break


used to start a new line with no indent.
\vspace{5 mm} inserts a vertical space whose length is 5
mm and the skip is discarded at the start of next page.
\hspace{5 mm} inserts a horizontal space whose length is 5
mm and the skip is discarded at the start of next line.

Text and Paragraph formatting


Line breaks and blank spaces

Each of the commands \\ or \newline or \hfill\break


used to start a new line with no indent.
\vspace{5 mm} inserts a vertical space whose length is 5
mm and the skip is discarded at the start of next page.
\hspace{5 mm} inserts a horizontal space whose length is 5
mm and the skip is discarded at the start of next line.
\hfill inserts a blank space that will stretch accordingly
to fill the space available.

Text and Paragraph formatting


Line breaks and blank spaces

Each of the commands \\ or \newline or \hfill\break


used to start a new line with no indent.
\vspace{5 mm} inserts a vertical space whose length is 5
mm and the skip is discarded at the start of next page.
\hspace{5 mm} inserts a horizontal space whose length is 5
mm and the skip is discarded at the start of next line.
\hfill inserts a blank space that will stretch accordingly
to fill the space available.
\vfill inserts a blank vertical space that will stretch
accordingly to fill the space available.

Text and Paragraph formatting


Line breaks and blank spaces

Each of the commands \\ or \newline or \hfill\break


used to start a new line with no indent.
\vspace{5 mm} inserts a vertical space whose length is 5
mm and the skip is discarded at the start of next page.
\hspace{5 mm} inserts a horizontal space whose length is 5
mm and the skip is discarded at the start of next line.
\hfill inserts a blank space that will stretch accordingly
to fill the space available.
\vfill inserts a blank vertical space that will stretch
accordingly to fill the space available.
The commands \hrulefill and \dotfill do the same as
\hfill but instead of blank spaces they insert a horizontal
ruler and a string of dots, respectively.

Text and Paragraph formatting


New Page

The command \newpage ends the page. After that


anything will be printed in the next page.

Text and Paragraph formatting


New Page

The command \newpage ends the page. After that


anything will be printed in the next page.
The command \clearpage ends the current page and
causes all figures and tables that have so far appeared in
the input to be printed.

Text and Paragraph formatting


Footnotes

The command \footnote{text} adds a superscript to the


word right before the command and prints text as
footnote.

Text and Paragraph formatting


Footnotes

The command \footnote{text} adds a superscript to the


word right before the command and prints text as
footnote.
The command \footnote[10]{text} adds a footnote
using 10 as reference mark.

Text and Paragraph formatting


Footnotes

The command \footnote{text} adds a superscript to the


word right before the command and prints text as
footnote.
The command \footnote[10]{text} adds a footnote
using 10 as reference mark.
I To add same footnote in more than one places do the fol-
lowing.

Text and Paragraph formatting


Footnotes

The command \footnote{text} adds a superscript to the


word right before the command and prints text as
footnote.
The command \footnote[10]{text} adds a footnote
using 10 as reference mark.
I To add same footnote in more than one places do the fol-
lowing.

In the first place where we want to put the footmark write


\footnotemark

Text and Paragraph formatting


Footnotes

The command \footnote{text} adds a superscript to the


word right before the command and prints text as
footnote.
The command \footnote[10]{text} adds a footnote
using 10 as reference mark.
I To add same footnote in more than one places do the fol-
lowing.

In the first place where we want to put the footmark write


\footnotemark
In the subsequent places where we want to put the
footmarks write \footnotemark[\value{footnote}]

Text and Paragraph formatting


Footnotes

The command \footnote{text} adds a superscript to the


word right before the command and prints text as
footnote.
The command \footnote[10]{text} adds a footnote
using 10 as reference mark.
I To add same footnote in more than one places do the fol-
lowing.

In the first place where we want to put the footmark write


\footnotemark
In the subsequent places where we want to put the
footmarks write \footnotemark[\value{footnote}]
Write \footnotetext{text} anywhere in the document
before the next footnote.

Text and Paragraph formatting


Footnotes

The command \footnote{text} adds a superscript to the


word right before the command and prints text as
footnote.
The command \footnote[10]{text} adds a footnote
using 10 as reference mark.
I To add same footnote in more than one places do the fol-
lowing.

In the first place where we want to put the footmark write


\footnotemark
In the subsequent places where we want to put the
footmarks write \footnotemark[\value{footnote}]
Write \footnotetext{text} anywhere in the document
before the next footnote.
I \renewcommand{\thefootnote}{\roman{footnote}} sets
the number styles to lowercase roman.
Text and Paragraph formatting
Margin Note

Text 1 inside the braces of \marginpar{Text 1} is


printed in the right or outer margin of the page.

Text and Paragraph formatting


Margin Note

Text 1 inside the braces of \marginpar{Text 1} is


printed in the right or outer margin of the page.
After importing the geometry package by
\usepackage{geometry}, marginnote is imported by
\usepackage{marginnote}. Then the command
\marginnote{Text 2}[3 cm] prints Text 2 inside the
braces and the second parameter inside the square brackets
determines the vertical alignment relative to the line where
the command is used. Negative values are allowed.

Text and Paragraph formatting


Margin Note

Text 1 inside the braces of \marginpar{Text 1} is


printed in the right or outer margin of the page.
After importing the geometry package by
\usepackage{geometry}, marginnote is imported by
\usepackage{marginnote}. Then the command
\marginnote{Text 2}[3 cm] prints Text 2 inside the
braces and the second parameter inside the square brackets
determines the vertical alignment relative to the line where
the command is used. Negative values are allowed.
The command \reversemarginpar prints the margin note
in the opposite margin.

Text and Paragraph formatting

Das könnte Ihnen auch gefallen