更改 biblatex 详细样式中的速记使用方式

更改 biblatex 详细样式中的速记使用方式

我正在使用biblatex这种verbose风格。我想改变它使用简写的方式。目前,对于所有第一个条目,它都会给出完整的引用,后跟(以下称为 [简写])。我想通过两种方式进行更改:

(1) 我希望在第一个条目中,缩写出现在长标题之后的方括号中。我还希望缩写能够反映原始条目的风格:即,如果它是一篇文章,它将被括在引号中(“Line & Cave”),如果它是一本书,它将以斜体显​​示(伦理)。因此,目前我在下面给出的工作示例产生了:

约翰·马尔科姆。《界线与洞穴》。出处:实践智慧7(1962),第 38-45 页(以下简称 Line & Cave)

特伦斯·欧文。柏拉图的伦理学. 牛津:牛津大学出版社,1995 年(以下称为《伦理学》)

我想要实现的目标如下:

约翰·马尔科姆。《线与洞穴》[《线与洞穴》]。见:实践智慧7 (1962),第38-45页

特伦斯·欧文。柏拉图的伦理学[伦理牛津:牛津大学出版社,1995

(2) 我希望只有存在第二个使用简写形式的引文时才引入简写形式。也就是说,如果某部作品在文中只被引用一次,则不引入简写形式。

\documentclass{article}

\begin{filecontents}{\jobname.bib}
@ARTICLE{Malcolm1962,
  author = {John Malcolm},
  title = {The Line and the Cave},
  year = {1962},
  volume = {7},
  pages = {38-45},
  shorthand = {Line \& Cave},
  journal = {Phronesis}
}
@BOOK{Irwin1995,
  author = {Terence Irwin},
  title = {Plato's Ethics},
  year = {1995},
  publisher = {Oxford University Press},
  address = {Oxford},
  shorthand= {Ethics}
}

\end{filecontents}    
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[style=verbose, backend=biber]{biblatex}

\addbibresource{\jobname.bib}


\begin{document} 
\cite{Malcolm1962}

\cite{Irwin1995}

\cite{Irwin1995}
\end{document}

答案1

必须做到以下几点:

  • 启用该citecounter功能;

  • shorthandintro从 中删除bibmacro cite:full

  • 定义一个新的 bibmacro (例如, ) ,如果我们在参考书目之外并且当前条目被引用多次,shorthand:ifcitation:ifmultiplecited它将打印该字段;shorthand

  • 将新的bibmacro添加到字段的(类型相关)格式中title

  • 重新定义字段的格式shorthand,以原有字段定义为蓝本title


\documentclass{article}

\usepackage[style=verbose,citecounter=true]{biblatex}

\renewbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhypertarget]{%
    \usedriver
      {\DeclareNameAlias{sortname}{default}}
      {\thefield{entrytype}}}%
%  \usebibmacro{shorthandintro}}% DELETED
  }% NEW

\newbibmacro{shorthand:ifcitation:ifmultiplecited}{%
  \ifbibliography{%
  }{%
    \ifnumgreater{\value{citecounter}}{1}{%
      \iffieldundef{shorthand}{%
      }{%
        \nopunct\printtext[brackets]{\printfield{shorthand}}%
      }%
    }{%
    }%
  }%
}

\DeclareFieldFormat{title}{%
  \mkbibemph{#1}%
  \usebibmacro{shorthand:ifcitation:ifmultiplecited}%
}
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{%
    \mkbibquote{#1\isdot}%
    \usebibmacro{shorthand:ifcitation:ifmultiplecited}%
  }
\DeclareFieldFormat
  [suppbook,suppcollection,suppperiodical]
  {title}{%
    #1%
    \usebibmacro{shorthand:ifcitation:ifmultiplecited}%
  }

\DeclareFieldFormat{shorthand}{\mkbibemph{#1}}
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {shorthand}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat
  [suppbook,suppcollection,suppperiodical]
  {shorthand}{#1}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@ARTICLE{Malcolm1962,
  author = {John Malcolm},
  title = {The Line and the Cave},
  year = {1962},
  volume = {7},
  pages = {38-45},
  shorthand = {Line \& Cave},
  journal = {Phronesis},
}
@BOOK{Irwin1995,
  author = {Terence Irwin},
  title = {Plato's Ethics},
  year = {1995},
  publisher = {Oxford University Press},
  address = {Oxford},
  shorthand= {Ethics},
}
\end{filecontents}    

\addbibresource{\jobname.bib}

\begin{document}

\null\vfill% just for the example

\cite{Malcolm1962}

\cite{Irwin1995}

\cite{Irwin1995}

\printbibliography

\end{document}

在此处输入图片描述

相关内容