我想知道如何在不缩进的情况下对齐文本\justifying
。我正在使用
\usepackage[parfill]{parskip}
次要问题:
顺便问一下,有什么方法可以增加 parskip 距离吗?
谢谢!
答案1
最好使用帕斯基普包(如问题中所示)而不是仅仅调整parskip
和parindent
自己,除非您还准备进行必要的调整以避免这些变化的副作用。
除了调整这些长度之外,parskip
还进行了一些基本工作以避免列表环境中的间距过大。即使您认为自己不使用列表,但您可能确实使用了列表,因为许多 LaTeX 环境都是基于列表的。例如,quotation
是一个普通的列表环境,还有许多其他列表环境。
这是一份仅根据以下情况手动调整长度的文档Fran 的回答:
\documentclass{article}
\usepackage{lipsum} % for example dummy text
\setlength\parskip{.5\baselineskip plus .1\baselineskip minus .1\baselineskip}
\setlength\parindent{0pt}
\begin{document}
\lipsum[1]
\begin{quotation}
\lipsum[2]
\end{quotation}
\lipsum[3]
\begin{itemize}
\item This is the first item in a list of several items, which is preceded by none but followed by some.
\item This is the second item in a list of several items, which is preceded by some and followed by some.
\item This is the third item in a list of several items, which is preceded by some and followed by some.
\item This is the fourth item in a list of several items, which is preceded by some but followed by none.
\end{itemize}
\lipsum[4]
\end{document}
可以看出,与常规段落之间的间距相比,引文和列表周围的间距过多。
parskip
以下是使用默认调整的同一文档:
\documentclass{article}
\usepackage{lipsum} % for example dummy text
\usepackage[parfill]{parskip}
\begin{document}
\lipsum[1]
\begin{quotation}
\lipsum[2]
\end{quotation}
\lipsum[3]
\begin{itemize}
\item This is the first item in a list of several items, which is preceded by none but followed by some.
\item This is the second item in a list of several items, which is preceded by some and followed by some.
\item This is the third item in a list of several items, which is preceded by some and followed by some.
\item This is the fourth item in a list of several items, which is preceded by some but followed by none.
\end{itemize}
\lipsum[4]
\end{document}
仍然很有可能调整,parskip
同时受益于包改进的列表环境布局。此示例使用parskip
与第一个文档中相同的内容,并按照 Fran 的“合理”设置指定:
\documentclass{article}
\usepackage{lipsum} % for example dummy text
\usepackage[parfill]{parskip}
\setlength\parskip{.5\baselineskip plus .1\baselineskip minus .1\baselineskip}
\begin{document}
\lipsum[1]
\begin{quotation}
\lipsum[2]
\end{quotation}
\lipsum[3]
\begin{itemize}
\item This is the first item in a list of several items, which is preceded by none but followed by some.
\item This is the second item in a list of several items, which is preceded by some and followed by some.
\item This is the third item in a list of several items, which is preceded by some and followed by some.
\item This is the fourth item in a list of several items, which is preceded by some but followed by none.
\end{itemize}
\lipsum[4]
\end{document}
可以看出,手动调整长度parskip
不会破坏通过加载包实现的布局增强parskip
。因此,此选项可为标准类提供最佳效果。
也就是说,有些类在设计时就考虑到了非零parskip
和零parindent
,因此这些类可能会有更细粒度的调整。但对于没有这样设计的类,加载包parskip
而不是明确设置长度或除了parskip
明确设置长度之外,将获得最佳结果。
为了避免引用中缩进段落的奇怪现象,请使用而quote
不是,quotation
或者让后一个环境等于前一个环境:
\documentclass{article}
\usepackage{lipsum} % for example dummy text
\usepackage[parfill]{parskip}
\setlength\parskip{.5\baselineskip plus .1\baselineskip minus .1\baselineskip}
\let\quotation\quote
\begin{document}
\lipsum[1]
\begin{quotation}
\lipsum[2]
\end{quotation}
\lipsum[3]
\begin{itemize}
\item This is the first item in a list of several items, which is preceded by none but followed by some.
\item This is the second item in a list of several items, which is preceded by some and followed by some.
\item This is the third item in a list of several items, which is preceded by some and followed by some.
\item This is the fourth item in a list of several items, which is preceded by some but followed by none.
\end{itemize}
\lipsum[4]
\end{document}
答案2
默认情况下,文本与两边边距对齐。要控制首行缩进和段落间空格,只需分别设置\parindent
和\parskip
长度,无需任何包。
为了清楚地看到结果,下面是一个带有一些夸张值的示例:
\documentclass{article}
\usepackage{lipsum} % for example dummy text
\setlength{\parskip}{2cm}
\setlength{\parindent}{5em}
\begin{document}
\lipsum[1-3]
\end{document}
请注意,在 LaTex 中,您经常可以使用可扩展和/或可收缩的长度(请参阅什么是胶水拉伸?),因此可以使用如下方法:
\setlength{\parskip}{2cm plus 1.9cm minus 1.9cm}
或者
\setlength{\parskip}{2cm plus 1 fill minus 0 cm}
尝试在 MWE 中添加一个段落(例如更改\lipsum[1-3]
为\lipsum[1-4]
)并查看此设置或其他设置的效果。
更合理的设置可能是:
\setlength\parskip{.5\baselineskip plus .1\baselineskip minus .1\baselineskip}
\setlength\parindent{0pt}
(这些正是文档类的设置artikel3
,在文档中引用parskip
)