×
Pro použití ShareLaTeXu v Angličtina klikněte zde

[edit] ShareLaTeX guides

[edit] LaTeX Basics

[edit] Mathematics

[edit] Figures and tables

[edit] References and Citations

[edit] Languages

[edit] Document structure

[edit] Formatting

[edit] Fonts

[edit] Presentations

[edit] Commands

[edit] Field specific

[edit] Class files

Simple text formatting helps to highlight important concepts within a document and make it more readable. Using italics, bold or underlined words can change the perception of the reader.

Contents

[edit] Introduction

In this article three basic text formatting tools will be explained: italics, bold and underline. Let's begin with an example:

Some of the \textbf{greatest} 
discoveries in \underline{science} 
were made by \textbf{\textit{accident}}.

Biu1.png

As you can see, there are three basic commands and they can be nested to get combined effects.

Note: The commands \it and \bf also work to italicize and boldface text, but it's not recommended to use them since they don't preserve previous styles. With these you can't, for instance, italicize and make a text bold at the same time.


  Open an example in ShareLaTeX


[edit] Italicized text

To make a text italic is straightforward, use the \textit command:

Some of the greatest 
discoveries in science 
were made by \textit{accident}.

Biu2.png

  Open an example in ShareLaTeX

[edit] Bold text

To make a text bold use \textbf command:

Some of the \textbf{greatest} 
discoveries in science 
were made by accident.

Biu3.png

  Open an example in ShareLaTeX

[edit] Underlined text

Underlining text is very simple too, use the \underline command:

Some of the greatest 
discoveries in \underline{science} 
were made by accident.

Biu4.png

  Open an example in ShareLaTeX

[edit] Emphasising text

Text can be emphasized by using \emph command. Sometimes the \emph command behaves just as \textit, but is not exactly the same:

Some of the greatest \emph{discoveries} 
in science 
were made by accident.
 
\textit{Some of the greatest \emph{discoveries} 
in science 
were made by accident.}
 
\textbf{Some of the greatest \emph{discoveries} 
in science 
were made by accident.}

Biu5.png

What the \emph command actually does with its argument depends on the context - inside normal text the emphasized text is italicized, but this behaviour is reversed if used inside an italicized text- see example above:

Moreover, some packages, e.g. Beamer, change the behaviour of \emph command.

  Open an example in ShareLaTeX

[edit] Further reading

For more information see