更改 biblatex postnote 行为

更改 biblatex postnote 行为

我想改变样式biblatex的后记行为numeric。在我看来,将数字样式与后记中的大量数字相结合会使其阅读起来非常混乱。命令的后记\autocite应出现在圆括号内的方括号后面,如下所示:

在此处输入图片描述

我不确定关于可破坏空间等的正确方法是什么。我尝试过解决方案这个问题但它不适用于\autocite

梅威瑟:

\documentclass{scrartcl}
\usepackage{filecontents}
\begin{filecontents}{test.bib}
    @book{mdr,
      title = {Verordnung (EU) 2017/745 \"uber Medizinprodukte},
      author = {{N. N.}},
      date = {2017},
      location = {{Europ\"aisches Parlament, Br\"ussel}}
    }
\end{filecontents}

\usepackage[backend=biber, style=ext-numeric, citestyle=numeric-comp, autocite=inline,]{biblatex}
\addbibresource{test.bib}

\begin{document}

\autocite[Kapitel II, Art. 5, Abs. 3]{mdr}

Desired output: [1](Kapitel II, Art. 5, Abs. 3)

\end{document}

答案1

你可以重新定义两者\cite,并\parencite从其原始定义

\DeclareCiteCommand{\parencite}[\mkbibbrackets]
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \usebibmacro{postnote}}

\DeclareCiteCommand{\parencite}
  {\bibopenbracket
   \usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \bibclosebracket
   \usebibmacro{postnote}}

这意味着括号在后记之前关闭。然后只需更改postnotedelim后记格式即可。

请注意,这些定义是特定于样式的,此处的代码旨在与 配合使用(cite)sytle=numeric-comp。对于其他样式,代码将略作调整。

\documentclass{scrartcl}
\usepackage[backend=biber,
  bibstyle=ext-numeric, citestyle=numeric-comp,
  autocite=inline,]{biblatex}

\DeclareCiteCommand{\cite}
  {\bibopenbracket
   \usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \bibclosebracket
   \usebibmacro{postnote}}

\DeclareCiteCommand{\parencite}
  {\bibopenbracket
   \usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}%
   \bibclosebracket
   \usebibmacro{postnote}}

\DeclareDelimFormat{postnotedelim}{}
\DeclareFieldFormat{postnote}{\mkbibparens{\mkpageprefix[pagination][\mknormrange]{#1}}}

\begin{filecontents}{\jobname.bib}
@book{mdr,
  title        = {Verordnung (EU) 2017/745 über Medizinprodukte},
  author       = {{N. N.}},
  date         = {2017},
  organization = {Europäisches Parlament},
  location     = {Brüssel},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}

\autocite[Kapitel~II, Art.~5, Abs.~3]{mdr}

Desired output: [1](Kapitel II, Art. 5, Abs. 3)

\end{document}

[1](第二章第5条第3款)

相关内容