![段落缩进不起作用](https://linux22.com/image/244881/%E6%AE%B5%E8%90%BD%E7%BC%A9%E8%BF%9B%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
由于某种原因,我的代码中的段落缩进不起作用。
我在 Windows 7 上使用 MikTeX 2.9 编译 XeLaTeX。我使用的multicols
是 2 列布局,但我不确定这是否是问题所在。
使用文章类并且我指定:
\setlength\parindent{20pt}
编辑:\indent
在每个段落的开头手动插入是可行的,但这很烦人。
这是 M(非)WE,它使用了维基百科虾文章中的随机文本,但是,如果我用替换文本,\lipsum[1]
缩进就可以完美地工作。这里出了什么问题?
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
% DOCUMENT LAYOUT
\documentclass[10pt, letterpaper]{article}
\usepackage{geometry}
\geometry{letterpaper, textwidth=5.5in, textheight=8.5in, marginparsep=7pt, marginparwidth=.6in}
\setlength\parindent{20pt}
\usepackage{multicol}
% LOREM IPSUM FILLER
\usepackage{lipsum}
% FONTS
\usepackage{fontspec}
\usepackage[usenames,dvipsnames]{xcolor}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont [Ligatures={Common}, Numbers={OldStyle}, Variant=01]{Linux Libertine O}
% HEADINGS
\usepackage{sectsty}
\usepackage[normalem]{ulem}
\sectionfont{\mdseries\upshape\Large}
\subsectionfont{\mdseries\scshape\normalsize}
\subsubsectionfont{\mdseries\upshape\large}
% DOCUMENT
\begin{document}
\begin{multicols}{2}[\section*{Shrimp}]
The class Malacostraca contains about half of the crustaceans. The members of this class have a primitive body plan that can be described as shrimp-like, consisting of a 5-8-7 body plan. They have a small carapace that encloses the head and the thorax, and have a muscular abdomen for swimming. They also have a thin exoskeleton to maintain a light weight. These general characteristics are common in all members of the class.\\
The class can be further divided into the decapods, which are even still divided into the dendrobranchiates (prawns) and the carideans (shrimp and snapping shrimp).\\
The prawns have sequentially overlapping body segments (segment one covers the segment two, segment two covers segment three, etc.), chelate (claw like) first three leg pairs, and have a very basic larval body type.\\
The shrimps also have overlapping segments, however, in a different pattern (segment two overlaps segments one and three), only the first two leg pairs are chelate, and they have a more complex larval form.\\
Biologists distinguish the true shrimp from the true prawn because of the differences in their gill structures. The gill structure is lamellar in shrimp but branching in prawns. The easiest practical way to separate true shrimps from true prawns is to examine the second abdominal segment. The second segment of a shrimp overlaps both the first and the third segment, while the second segment of a prawn overlaps only the third segment.
\end{multicols}
\end{document}
MWE!:
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
% DOCUMENT LAYOUT
\documentclass[10pt, letterpaper]{article}
\usepackage{geometry}
\geometry{letterpaper, textwidth=5.5in, textheight=8.5in, marginparsep=7pt, marginparwidth=.6in}
\setlength\parindent{20pt}
\usepackage{multicol}
% LOREM IPSUM FILLER
\usepackage{lipsum}
% FONTS
\usepackage{fontspec}
\usepackage[usenames,dvipsnames]{xcolor}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont [Ligatures={Common}, Numbers={OldStyle}, Variant=01]{Linux Libertine O}
% HEADINGS
\usepackage{sectsty}
\usepackage[normalem]{ulem}
\sectionfont{\mdseries\upshape\Large}
\subsectionfont{\mdseries\scshape\normalsize}
\subsubsectionfont{\mdseries\upshape\large}
% DOCUMENT
\begin{document}
\begin{multicols}{2}[\section*{Random}]
\lipsum
\end{multicols}
\end{document}
答案1
要开始新的段落,您必须在代码中添加两个换行符 (IE,一个空行)。\\
不会开始新的段落,只开始新的一行,因此下一行将没有段落缩进。
\documentclass{article}
\begin{document}
The first line. \\
Second line, still the same paragraph, no indentation.
New paragraph, line indented.
\end{document}