如何停止包 \usepackage{parskip} 禁用段落缩进?

如何停止包 \usepackage{parskip} 禁用段落缩进?

我想自动在段落之间插入垂直空间。目前我\medskip在所有段落前都使用它。示例:

% proposal.tex
% Based on http://www.latextemplates.com/template/simple-sectioned-essay
\documentclass[12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage[brazil]{babel}

\usepackage[utf8]{inputenc}
\usepackage{mathptmx}

\usepackage{indentfirst}

\begin{document}

\section{Introdução}

    In typesetting advertisement copy, a way of justifying paragraphs has
    become popular in recent years that is somewhere between flushright
    and raggedrightdddd setting. Lines that would stretch beyond certain limits
    are set with their glue at natural width. This single paragraph is but an
    example of this procedure; the macros are given next.

    \medskip
    Second paragraph.

\end{document}

生成:

在此处输入图片描述

经过搜索我找到了有关包括包的信息\usepackage{parskip}。但是,这样做之后,我的所有段落缩进都被禁用了。

在此处输入图片描述

所以再次搜寻我发现我可以用它\setlength{\parindent}{30pt}来重置段落缩进,但我不确定这是否是一件好事。

% proposal.tex
% Based on http://www.latextemplates.com/template/simple-sectioned-essay
\documentclass[12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage[brazil]{babel}

\usepackage[utf8]{inputenc}
\usepackage{mathptmx}

\usepackage{indentfirst}

\usepackage{parskip}
\setlength{\parindent}{30pt}

\begin{document}

\section{Introdução}

    In typesetting advertisement copy, a way of justifying paragraphs has
    become popular in recent years that is somewhere between flushright
    and raggedrightdddd setting. Lines that would stretch beyond certain limits
    are set with their glue at natural width. This single paragraph is but an
    example of this procedure; the macros are given next.

    Second paragraph.

\end{document}

生成:

在此处输入图片描述

我想知道是否有最好的方法,可以包含包\usepackage{parskip}并保留默认的 LaTeX 段落缩进,而不是用覆盖覆盖的值\setlength{\parindent}{30pt}

答案1

parskip包包含一行\parindent=\z@将 清零的行\parindent。因此,可以\parindent在加载parskip包之前保存当前值,然后恢复 的值\parindent

\parindent顺便说一句,用您的设置覆盖是一种完全有效的编码形式,尽管有些人从风格的角度争辩说,和30pt中至少有一个应该正好是 0pt,但您不会从我这里得到任何争论。\parskip\parindent

\documentclass{article}
\usepackage{lipsum}
\edef\svtheparindent{\the\parindent}
\usepackage{parskip}
\parindent=\svtheparindent\relax
\begin{document}
\lipsum[1-6]
\end{document}

在此处输入图片描述

相关内容