将平行列的宽度设置为块引用的长度

将平行列的宽度设置为块引用的长度

我可以更改使用 reledpar 包创建的平行段落的宽度吗?

我希望等于块引用的宽度。

在此处输入图片描述

\documentclass{scrartcl}
\usepackage[english]{babel}
\usepackage[style=authoryear]{biblatex}
\usepackage{lmodern,csquotes,lipsum}


\addbibresource{biblatex-examples.bib}
\usepackage{reledmac,reledpar}



\begin{document}

\begin{pairs}
    \begin{Leftside}
        \beginnumbering
            \pstart
 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            \pend
         \endnumbering
    \end{Leftside}
    %
    \begin{Rightside}
        \beginnumbering
            \pstart
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful.
            \pend
         \endnumbering
    \end{Rightside}
\end{pairs}
\Columns

\blockquote{\lipsum*[1]...}

\lipsum*[1]
\end{document}

答案1

reledpar允许您定义列的宽度以及列之间的空间。

最复杂的操作是找到 的宽度\blockquote。在\blockquote调用quote环境中,我们可以确定 的宽度quote

该文件scrartcl.cls对其定义不明确:

\newenvironment{quote}{%
  \list{}{\rightmargin\leftmargin}%
  \item\relax
}{%
  \endlist
}

这告诉我们 a 的左边距和右边距quote设置为\rightmargin+\leftmargin

所以a的宽度quote等于\textwidth-2\leftmargin-2\rightmargin

我们可以定义一个新的长度来存储这个值:

\newlength{\widthofquote}
\setlength{\widthofquote}{\dimexpr\textwidth-2\leftmargin-2\rightmargin\relax}

现在,我们可以定义左列和右列的长度reledpar,为引文宽度的 0.45 倍。如手册中所述,通过设置\Lcolwidth\Rcolwidth值即可:

\setlength{\Lcolwidth}{0.45\widthofquote}
\setlength{\Rcolwidth}{0.45\widthofquote}

还有一个问题,默认情况下reledpar,列与右边距对齐。您可以使用 将其居中,如手册中所述。

\columnsposition{C}

但这是有问题的,因为列之间的空间不会自动设置为一个好的值。因此,您可以将其更改为将其设置为等于引文宽度的 0.1。

这样,左列的宽度 + 列间空间的宽度 + 右列空间的宽度将等于0.45 width of quote + 0.1 widht of quote + 0.45 width of quote = width of quote

因此,我们按照手册中的说明,定义列之间的空间

\setlength{\beforecolumnseparator}{0.05\widthofquote}
\setlength{\aftercolumnseparator}{0.05\widthofquote}

为了代码的可读性,最好在前言中设置所有这些设置。但是,\textwidth可以在环境开始时更改document。因此,最好在前言中设置它们,在\AtBeginDocument命令中:

\AtBeginDocument{
  % Determine the length of a quote environment
  \newlength{\widthofquote}
  \setlength{\widthofquote}{\dimexpr\textwidth-2\leftmargin-2\rightmargin\relax}

    % Fixe the length of columns
    \setlength{\Lcolwidth}{0.45\widthofquote}
    \setlength{\Rcolwidth}{0.45\widthofquote}

    % Centering correctly
    \columnsposition{C}
    \setlength{\beforecolumnseparator}{0.05\widthofquote}
    \setlength{\aftercolumnseparator}{0.05\widthofquote}
}

最后但同样重要的一点是,我们告诉LaTeX在列内的单词之间留出更多灵活的空间,因为列宽很小,并且我们想防止水平盒子过满:

\AtBeginPairs{\sloppy}

因此,最后一个例子(我删除了biblatex调用,因为这个例子不需要):

\documentclass{scrartcl}
\usepackage[english]{babel}
\usepackage{lmodern,csquotes,lipsum}

\usepackage{reledmac,reledpar}
\AtBeginDocument{
  % Determine the length of a quote environment
  \newlength{\widthofquote}
  \setlength{\widthofquote}{\dimexpr\textwidth-2\leftmargin-2\rightmargin\relax}

    % Fixe the length of columns
    \setlength{\Lcolwidth}{0.45\widthofquote}
    \setlength{\Rcolwidth}{0.45\widthofquote}

    % Centering correctly
    \columnsposition{C}
    \setlength{\beforecolumnseparator}{0.05\widthofquote}
  \setlength{\aftercolumnseparator}{0.05\widthofquote}
}
\AtBeginPairs{\sloppy}
\begin{document}
\begin{pairs}
    \begin{Leftside}
        \beginnumbering
            \pstart
 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            \pend
         \endnumbering
    \end{Leftside}
    %
    \begin{Rightside}
        \beginnumbering
            \pstart
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful.
            \pend
         \endnumbering
    \end{Rightside}
\end{pairs}
\Columns

\noindent\hfill\rule[0.5ex]{\widthofquote}{0.1mm}\hfill\null
\blockquote{\lipsum*[1]…}

\lipsum*[1]
\end{document}

最终输出

答案2

我至少可以帮助解决一个问题。

首先,据biblatex我所知,这些东西对于您的问题来说不是必需的,所以我删除了那段代码。

你可以csquotes告诉临界点为了什么时候缩进引文。我将其改为1000 行。这基本上意味着它不再缩进。

\documentclass{scrartcl}
\usepackage[english]{babel}
\usepackage{lmodern,lipsum}
\usepackage[
    threshold = 1000,
    thresholdtype = lines,
    ]{csquotes}

\usepackage{reledmac,reledpar}

\begin{document}

\begin{pairs}
    \begin{Leftside}
        \beginnumbering
            \pstart
 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            \pend
         \endnumbering
    \end{Leftside}
    %
    \begin{Rightside}
        \beginnumbering
            \pstart
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful.
            \pend
         \endnumbering
    \end{Rightside}
\end{pairs}
\Columns

\blockquote{\lipsum*[1]...}

\lipsum*[1]
\end{document}

在此处输入图片描述

相关内容