csquotes——如何自定义/更改 blockquote 功能——缩进、字体大小、线宽

csquotes——如何自定义/更改 blockquote 功能——缩进、字体大小、线宽

引用要求可能千差万别,我还没有找到一种方法来csquotes根据我的目的调整标准。对于论文/论文,需要满足以下块引用标准:

  • 字体大小10pt(与正常字体大小不同)
  • 缩进1cm(相对于普通文本)
  • 行宽1.0(普通文本为1.5--\onehalfspacingsetspace包)
  • 在 - 的里面引号(通过设置csquotes
  • 使用斜体报价

由于还需要特定的语言设置,如果提出的解决方案使用相同的“csquotes”包,那将非常简单。

我发现

虽然第一个是仅相对于 nomrla 字体大小设置字体大小,但第二个几乎没有注释,因此对于像我这样的新手来说实际上不可能适应。

在这里你可以找到一个最简单的例子:

\documentclass{article}    

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{parskip}

\usepackage{setspace}       
\onehalfspacing

\usepackage[autostyle,german=guillemets]{csquotes}

\begin{document}
    Here comes a blockquotation:

    \begin{displayquote}
        Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.
    \end{displayquote}

\end{document}

答案1

我相信这可以满足您的要求。我对此进行了评论,希望它容易理解。

\makeatletter
%Take the original environment definition and change the leftmargin to 1cm
\renewenvironment*{displayquote}
  {\begingroup\setlength{\leftmargini}{1cm}\csq@getcargs{\csq@bdquote{}{}}}
  {\csq@edquote\endgroup}
\makeatother
%Hooks
%Use single spacing, set 10pt font, and begin beginning quotes

%%%Curly quotes version
%\renewcommand{\mkbegdispquote}
    %{\singlespacing\fontsize{10pt}{10pt}\selectfont\setquotestyle{quote}\textooquote}%
%%%German guillemets version
\renewcommand{\mkbegdispquote}
    {\singlespacing\fontsize{10pt}{10pt}\selectfont\textooquote}%
%%%German guillemets version plus italics
%\renewcommand{\mkbegdispquote}
    %{\singlespacing\fontsize{10pt}{10pt}\selectfont\itshape\textooquote}%
\renewcommand{\mkenddispquote}{\textcoquote}

我找不到任何方法来改变缩进大小...所以我搜索csquotes了定义displayquote。我复制了它并将其放在 之间\makeatletter...\makeatother(因为它包含@字符)。然后,我把\begingroup和放进\endgroup去,这样\leftmargini尺寸变化就只适用于displayquote环境。

接下来,我更新了适用于displayquote:\mkbegdispquote和的两个钩子命令\mkenddispquote。基本上,你只需在这里输入所需的任何更改。在本例中,你需要单倍行距、10pt 的字体大小、引号样式(如果需要,请参阅版本 2)和引号。然后,输入开头的引号和结尾的引号。

以下是示例中的完整版本:

\documentclass{article}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{parskip}

\usepackage{setspace}       
\onehalfspacing

\usepackage[autostyle,german=guillemets]{csquotes}
\makeatletter
%Take the original environment definition and change the leftmargin to 1cm
\renewenvironment*{displayquote}
  {\begingroup\setlength{\leftmargini}{1cm}\csq@getcargs{\csq@bdquote{}{}}}
  {\csq@edquote\endgroup}
\makeatother
%Hooks
%Use single spacing, set 10pt font, and beginning quotes
\renewcommand{\mkbegdispquote}
    {\singlespacing\fontsize{10pt}{10pt}\selectfont\textooquote}
%End displayquote environment with ending quotes
\renewcommand{\mkenddispquote}{\textcoquote}


\usepackage{geometry}
\geometry{lmargin=25mm,rmargin=25mm,}

\begin{document}
    Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:

    \begin{displayquote}
        Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.  Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.  Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.
    \end{displayquote}

Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:

\end{document}

修改 displayquote 环境,使用德语引号

并且,如果您想将引号改为 和您可以更改引号样式:

\documentclass{article}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{parskip}

\usepackage{setspace}       
\onehalfspacing

\usepackage[autostyle,german=guillemets]{csquotes}
\makeatletter
%Take the original environment definition and change the leftmargin to 1cm
\renewenvironment*{displayquote}
  {\begingroup\setlength{\leftmargini}{1cm}\csq@getcargs{\csq@bdquote{}{}}}
  {\csq@edquote\endgroup}
\makeatother
%Hooks
%Use single spacing, set 10pt font, set quote style curly quotes, and beginning quotes
\renewcommand{\mkbegdispquote}
    {\singlespacing\fontsize{10pt}{10pt}\selectfont\setquotestyle{quote}\textooquote}
%End displayquote environment with ending quotes
\renewcommand{\mkenddispquote}{\textcoquote}


\usepackage{geometry}
\geometry{lmargin=25mm,rmargin=25mm,}

\begin{document}
    Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:

    \begin{displayquote}
        Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.  Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.  Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.
    \end{displayquote}

Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:

\end{document}

使用标准引号修改 displayquote 环境

斜体版本(以及德文风格的引号):

\documentclass{article}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{parskip}

\usepackage{setspace}       
\onehalfspacing

\usepackage[autostyle,german=guillemets]{csquotes}
\makeatletter
%Take the original environment definition and change the leftmargin to 1cm
\renewenvironment*{displayquote}
  {\begingroup\setlength{\leftmargini}{1cm}\csq@getcargs{\csq@bdquote{}{}}}
  {\csq@edquote\endgroup}
\makeatother
%Hooks
%Use single spacing, set 10pt font, set italics, and beginning quotes
\renewcommand{\mkbegdispquote}
    {\singlespacing\fontsize{10pt}{10pt}\selectfont\itshape\textooquote}%\setquotestyle{quote}
%End displayquote environment with ending quotes
\renewcommand{\mkenddispquote}{\textcoquote}


\usepackage{geometry}
\geometry{lmargin=25mm,rmargin=25mm,}

\begin{document}
    Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:

    \begin{displayquote}
        Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.  Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.  Dies ist ein Zitat das nichts sagt. Und wenn sie noch nicht gestorben sind dann denken sie daran für immer zu sein.
    \end{displayquote}

Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation Here comes a blockquotation:

\end{document}

用斜体显示引用

答案2

我们可以避免一些修补,如果我们使用自定义方法displayquote如图所示csquotes.cfg

这个想法是首先根据 定义一个新环境,quote它可以完成我们想要的大部分工作。然后我们使用新环境代替标准quote环境\SetBlockEnvironment

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{parskip}

\usepackage{setspace}       
\onehalfspacing

\usepackage[autostyle,german=guillemets]{csquotes}

\newenvironment*{innerquote}
  {\setlength{\leftmargini}{1cm}%
   \quote
   \singlespacing\fontsize{10pt}{10pt}\selectfont\itshape}
  {\endquote}

\SetBlockEnvironment{innerquote}

\renewcommand{\mkbegdispquote}[2]{\textooquote}
\renewcommand{\mkenddispquote}[2]{\textcoquote#1#2}


\usepackage{lipsum}

\begin{document}
\lipsum[1]

\begin{displayquote}
\lipsum[2]
\end{displayquote}

\lipsum[3]
\end{document}

显示引文时,左右缩进 1cm、引号、行距较小、字体较小(10pt)且为斜体

请注意,从技术上讲\mkbegdispquote,和\mkenddispquote被定义为接受两个参数。

相关内容