如何在段落之间添加双倍行距?

如何在段落之间添加双倍行距?

我正在准备我的论文,行距为单行,但段落之间需要双行间距。我使用\\段落末尾的行距来实现这一点。如何使用\parskip整个文档的包来实现这一点?

\begin{document}

\section{Introduction}
In a distributed database system, data is replicate of the most important advantages of replication is that it masks and tolerates failures in the network     gracefully and increases availability. \\

In case of multiple access a problem that must be solved while using replication is about maintaining the a generalization of the majority consensus method presented in\\

 This protocol can be viewed as specialized version of ring and tree    protocol.
 As compared to other protocols, wheel protocol can be used for arbitrary     number of nodes.

 \end{document}

答案1

\documentclass[12pt,a4paper]{article}
\setlength{\parskip}{2\baselineskip}
\begin{document}

\section{Introduction}
In a distributed database system, data is replicate of the most important advantages of replication is that it masks and tolerates failures in the network     gracefully and increases availability. 

In case of multiple access a problem that must be solved while using replication is about maintaining the a generalization of the majority consensus method presented in

 This protocol can be viewed as specialized version of ring and tree    protocol.
 As compared to other protocols, wheel protocol can be used for arbitrary     number of nodes.

\end{document}

在此处输入图片描述

答案2

您可以使用

\setlength{\parskip}{12pt}

实现\parskip整个文档的自定义。根据需要调整值并将命令放在您的document环境中。

答案3

切勿\\在段落末尾使用,也不要\parskip手动更改(请参阅https://tex.stackexchange.com/a/14565/43317)。

您可以加载包parskip

\documentclass{article}
\usepackage{parskip}
\begin{document}
\section{Introduction}
In a distributed database system, data is replicate of the most important advantages of replication is that it masks and tolerates failures in the network     gracefully and increases availability. 

In case of multiple access a problem that must be solved while using replication is about maintaining the a generalization of the majority consensus method presented in

This protocol can be viewed as specialized version of ring and tree    protocol.
As compared to other protocols, wheel protocol can be used for arbitrary     number of nodes.

 \end{document}

在此处输入图片描述


或者你可以使用KOMA-Script 类使用选项parskip=full-

\documentclass[parskip=full-]{scrartcl}
\begin{document}

\section{Introduction}
In a distributed database system, data is replicate of the most important advantages of replication is that it masks and tolerates failures in the network gracefully and increases availability. 

In case of multiple access a problem that must be solved while using replication is about maintaining the a generalization of the majority consensus method presented in

This protocol can be viewed as specialized version of ring and tree    protocol.
As compared to other protocols, wheel protocol can be used for arbitrary     number of nodes.

\end{document}

查看KOMA-Script 文档找到选项的更多可能值parskip

如果您想使用不同于half或的parskip,full您可以使用命令\setparsizes{<parindent>}{<parskip>}{<horizontal white space at the end of a paragraph>}

parskip带有的示例2\baselineskip

\documentclass{scrartcl}
\setparsizes{0pt}{2\baselineskip}{0pt plus 1fill}
\begin{document}

\section{Introduction}
In a distributed database system, data is replicate of the most important advantages of replication is that it masks and tolerates failures in the network     gracefully and increases availability. 

In case of multiple access a problem that must be solved while using replication is about maintaining the a generalization of the majority consensus method presented in

This protocol can be viewed as specialized version of ring and tree    protocol.
As compared to other protocols, wheel protocol can be used for arbitrary     number of nodes.

\end{document}

如果parskip应该取决于字体大小,您可以parskip=relative另外尝试选项:

\documentclass[parskip=full-,parskip=relative]{scrartcl}
\begin{document}

\section{Introduction}
In a distributed database system, data is replicate of the most important advantages of replication is that it masks and tolerates failures in the network     gracefully and increases availability. 

In case of multiple access a problem that must be solved while using replication is about maintaining the a generalization of the majority consensus method presented in

This protocol can be viewed as specialized version of ring and tree    protocol.
As compared to other protocols, wheel protocol can be used for arbitrary     number of nodes.

\rule{\linewidth}{.4pt}
\tiny
In a distributed database system, data is replicate of the most important advantages of replication is that it masks and tolerates failures in the network     gracefully and increases availability. 

In case of multiple access a problem that must be solved while using replication is about maintaining the a generalization of the majority consensus method presented in

This protocol can be viewed as specialized version of ring and tree    protocol.
As compared to other protocols, wheel protocol can be used for arbitrary     number of nodes.
\end{document}

在此处输入图片描述

答案4

您可以将以下内容添加到文件顶部:

\documentclass[parskip=full]{scrartcl}

这样,间距将根据您选择的字体大小自动更新。

以下是 MWE:

\setlength{\parskip}{12pt}

\begin{document}

\section{Introduction}

In a distributed database system, data is replicate of the most important advantages of replication is that it masks and tolerates failures in the network     gracefully and increases availability.

In case of multiple access a problem that must be solved while using replication is about maintaining the a generalization of the majority consensus method presented in

This protocol can be viewed as specialized version of ring and tree protocol.
As compared to other protocols, wheel protocol can be used for arbitrary number of nodes.

\end{document}

相关内容