LaTeX
  • How I learn LaTeX?
  • Installation and Customization
    • Online
    • Offline
  • LaTeX Basics
  • Text Manipulation
    • Fonts, Size and Styles
  • Math Manipulation
  • Advanced Math Manipulation
  • Lists
  • Tables
  • Pictures, Figures
  • Unit in LaTeX
  • Document Structure
  • Document Formatting
    • Headers and Footers, Page Numbering
    • Spacing in Paragraphs
    • Page size, Margins
    • Coloring
    • Footnotes
  • Multi-file LaTeX project
Powered by GitBook
On this page
  • Fonts, Size and Styles (this section is not so important so I put it to a seperate page)
  • Commonly-used text styles
  • Text Alignment
  • New paragraph
  • Creating new line
  • Indentation

Text Manipulation

At this point, you should know enough about creating a LaTeX document. It's time to polish it!

PreviousLaTeX BasicsNextFonts, Size and Styles

Last updated 1 year ago

(this section is not so important so I put it to a seperate page)

Commonly-used text styles

  • \textbf{} - make a text bold

  • \underline{} - To underline text

However, underline in a wrong way can cause some troubles:

Therefore, you can use the package ulem to solve this problem (this package also add some special underlining styles!)

  • \textit{} - To make a text italic

  • \emph{} - Emphasis the text. By default, this will make the text italic. However, if the text needing emphasizing contains too many italicized words, it will make the text normal.

\textit{Some of the greatest discoveries in science were made by \emph{accidents}}

Text Alignment

By default, paragraphs in LaTeX\LaTeXLATE​X are fully justified. As a result, we have 3 environments to break this: center, flushleft, flushright.

New paragraph

In order to force-create a new paragraph, you can use the \par command. Another way is to leave an empty line.

Let's start with an example which typesets two centred paragraphs by writing them inside a center environment. \par
Note how a new paragraph is started by inserting a blank line between them—although that's a commonly-used method, it's not the only way to start a new paragraph.

Creating new line

You can use 2 back-slashes \\ to quickly create a new line. However, the indentation will not be reserved. If you want indentation for a new paragraph, refer to New paragraph.

If you want spaces between 2 paragraphs, you can use this syntax: \\[length]

  • \\[\baselineskip]will create a new paragraph with the gap equal to the height of one line.

Indentation

By default new paragraphs are usually indented by an amount controlled by a parameter called \parindent (the default value is 15pt) whose value can be set using the command \setlength. For example:

\setlength{\parindent}{20pt}

You can avoid the indentation by setting that value to 0pt or use \noindent at the beginning of the paragraph.

By default LaTeX does not indent the first paragraph contained in a document section.

It's that ulem can messed up with the default emphasis command.

reported
Fonts, Size and Styles