Paragraphs

Paragraphs #

Author: Erhua

Keywords: paragraphs, columns

In this section, we will discuss paragraphs. Paragraphs are essential to almost all documents, so setting up paragraphs is very important.

Basic Properties of Paragraphs #

Paragraph format properties:

First line indentation Command Purpose
\parindent Fixed indentation controlled by \setlength
\noindent Temporarily disable indentation at the beginning of a paragraph
\indent Temporarily indent at the beginning of a paragraph
Paragraph property Command Note
Vertical spacing between paragraphs \parskip Set the size with \setlength
Alignment (justified) Default
Alignment (left) \raggedright A declarative command
Alignment (right) \raggedleft A declarative command, used for typesetting signatures and dates
Alignment (center) \centering A declarative command
Paragraph property Environment Note
Alignment (left) \begin{flushleft}\end{flushleft} Add vertical spacing before and after the paragraph
Alignment (right) \begin{flushright}\end{flushright} Add vertical spacing before and after the paragraph
Alignment (center) \begin{center}\end{center} Add vertical spacing before and after the paragraph

Two interesting packages related to paragraphs:

The lettrine package produces a capital letter at the beginning of a paragraph
---Usage
\usepackage{lettrine}
\lettrine{Capital letter}{The rest of the word(s)} + others
---
The shapepar package makes it easier to typeset paragraphs in specific shapes
---Usage
\usepackage{shapepar}
\heartpar{Paragraph to be typeset}
---
\documentclass{article}
\usepackage{ctex}
\usepackage{shapepar}
\usepackage{lettrine}
\begin{document}
\lettrine{W}{here} there is a will, there is a way. No Man Is An Island ——John Donn No man is an island, entire of itself; every man is a piece of the continent, a part of the main; 
\starpar{锦瑟无端五十弦,一弦一柱思华年,庄生晓梦迷蝴蝶,望帝春深托杜鹃,沧海月明珠有泪,蓝田日暖玉生烟,此情可待成追忆,只是当时已惘然。}
\end{document}

Columns #

Of course, columns are also essential parts of paragraphs. Columns can be defined using two methods:

  • Use the twocolumn option in the document class to define two columns
  • Use the multicol package to define multiple columns

Defined in the document class:

For twocolumn, there are several length variables to note
One is \columnsep, which is the column spacing
Another is \columnwidth, which is the column width
Another is the vertical line between columns (hidden by default) \columnseprule
All three can be set using \setlength
------
\documentclass[twocolumn]{article}
\usepackage{ctex}
\setCJKfamilyfont{qingsong}{FZQKBYSJW--GB1-0}
\usepackage[height = 2cm]{geometry}
\setlength{\columnsep}{15mm}
\setlength{\columnseprule}{0.4pt}
\begin{document}
\CJKfamily{qingsong}
锦瑟无端五十弦,一弦一柱思华年,
庄生晓梦迷蝴蝶,望帝春深托杜鹃,
沧海月明珠有泪,蓝田日暖玉生烟,
此情可待成追忆,只是当时已惘然。
锦瑟无端五十弦,一弦一柱思华年,
庄生晓梦迷蝴蝶,望帝春深托杜鹃,
沧海月明珠有泪,蓝田日暖玉生烟,
此情可待成追忆,只是当时已惘然。
\end{document}

Defined using the package:

\documentclass[]{article}
\usepackage{ctex}
\usepackage{multicol}
\setCJKfamilyfont{qingsong}{FZQKBYSJW--GB1-0}
\usepackage[height = 4cm]{geometry}
\setlength{\columnsep}{15mm}
\setlength{\columnseprule}{0.4pt}
\begin{document}
\CJKfamily{qingsong}
\begin{multicols}{3}
(Fill in text)
\end{multicols}
(Fill in text)
\end{document}