如何修改 biblatex 'useprefix' 选项

如何修改 biblatex 'useprefix' 选项

在回答这个问题时:在 bibtex 中保留小写字母我发现处理名称前缀的方式biblatex有点奇怪,因为它似乎是“全有或全无”。

更新该问题已从原文进行了修改,以进一步阐明问题。

来自biblatex手册:

useprefix=true, false default: false

在引文中打印姓氏时是否考虑名字前缀(von、van、of、da、de、della 等)。这也会影响参考书目的排序和格式以及某些类型标签的生成。如果启用此选项,则biblatex始终在姓氏前面加上前缀。例如,默认情况下,Ludwig van Beethoven 将被引用为“Beethoven”,并按字母顺序排列为“Beethoven, Ludwig van”。如果启用此选项,他将被引用为“van Beethoven”,并按字母顺序排列为“Van Beethoven, Ludwig”。使用Biber,此选项也可以根据每种类型进行设置。

在一个非常相似的问题中:我怎样才能在引用中将名称的前缀放在前面,但在参考书目中却不放呢?步调一致提出了一种解决方案,即在文档的开头打开前缀的使用(从而用于文本引用),但在参考书目的开头关闭前缀的使用(从而不用于参考书目的排序)。

以下是一个例子:

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
% Use useprefix=false to ignore name prefixes
\usepackage[style=authoryear,backend=biber,useprefix=false]{biblatex}
\usepackage{ifpdf}
\makeatletter
\AtBeginDocument{\toggletrue{blx@useprefix}}
\AtBeginBibliography{\togglefalse{blx@useprefix}}
\makeatother
\begin{filecontents}{\jobname.bib}
@book{Saussure1995,
    Author = {Ferdinand de Saussure},
    Origyear = {1916},
    Publisher = {Payot},
    Title = {Cours de Linguistique G{\'e}n{\'e}rale},
    Year = {1995}}

@book{Labov1972,
    Address = {Philadelphia},
    Author = {William Labov},
    Publisher = {University of Pennsylvania Press},
    Title = {Sociolinguistic Patterns},
    Year = {1972}}

\end{filecontents}
\addbibresource{\jobname}
\begin{document}
The relation between the the sign and the signified is arbitrary \autocite{Saussure1995,Labov1972}. 

Language change is driven by language variation. \autocite{Labov1972}.

\printbibliography


\end{document}

这正确地在文内引文中产生了“de Saussure”,在参考书目中产生了“Saussure, Ferdinand de”,但它仍然有一个副作用。在引文列表中,由于useprefix设置为 true,因此文内引文产生了“(de Saussure 1995; Labov 1972)”而不是“(Labov 1972; de Saussure 1995)”。

问题是:

我们如何才能biblatex 使用引用中的前缀,不使用参考书目中的前缀,正确排序文本引用列表,以便我们在引用列表中得到“de Saussure”并按 S 而不是 D 排序?

authoryear这是任何或风格的一般问题author,因此我创建了一个新问题来反映这一点,并添加了标签。

答案1

现在是正确的;-)

该选项sortcites应该有效:

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}

\usepackage[style=authoryear,backend=biber,useprefix=false,sortcites=true]{biblatex}
\usepackage{ifpdf}
\makeatletter
\AtBeginDocument{\toggletrue{blx@useprefix}}
\AtBeginBibliography{\togglefalse{blx@useprefix}}
\makeatother
\begin{filecontents}{\jobname.bib}
@book{Saussure1995,
    Author = {Ferdinand de Saussure},
    Origyear = {1916},
    Publisher = {Payot},
    Title = {Cours de Linguistique G{\'e}n{\'e}rale},
    Year = {1995}}

@book{Labov1972,
    Address = {Philadelphia},
    Author = {William Labov},
    Publisher = {University of Pennsylvania Press},
    Title = {Sociolinguistic Patterns},
    Year = {1972}}

\end{filecontents}
\addbibresource{\jobname}
\begin{document}
The relation between the the sign and the signified is arbitrary \autocite{Saussure1995,Labov1972}. 

Language change is driven by language variation. \autocite{Labov1972}.

\printbibliography


\end{document}

在此处输入图片描述

答案2

我实际上有一个以我个人风格实现的选项。以 Marco 为例,我添加了一个切换按钮citeprefix,并定义了一个 BibliographyOption citeprefix

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear,backend=biber]{biblatex}
\defbibheading{bibliography}{\centering Works Cited}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Saussure1995,
    Author = {Ferdinand de Saussure},
    Origyear = {1916},
    Publisher = {Payot},
    Title = {Cours de Linguistique G{\'e}n{\'e}rale},
    Year = {1995}}

@book{Labov1972,
    Address = {Philadelphia},
    Author = {William Labov},
    Publisher = {University of Pennsylvania Press},
    Title = {Sociolinguistic Patterns},
    Year = {1972}}
\end{filecontents}
\addbibresource{\jobname.bib}

\providetoggle{citeprefix}
\toggletrue{citeprefix}
\DeclareBibliographyOption{citeprefix}[true]{\settoggle{citeprefix}{#1}}
\ExecuteBibliographyOptions{citeprefix=true}
\renewbibmacro*{name:last}[4]{%
  \iftoggle{citeprefix}
    {\usebibmacro{name:delim}{#3#1}%
     \usebibmacro{name:hook}{#3#1}%
     \ifblank{#3}
       {}
       {\ifcapital
          {\mkbibnameprefix{\MakeCapital{#3\isdot}}}
          {\mkbibnameprefix{#3\isdot}}%
        \ifpunctmark{'}{}{\bibnamedelimc}}}
    {\ifuseprefix
    {\usebibmacro{name:delim}{#3#1}%
     \usebibmacro{name:hook}{#3#1}%
     \ifblank{#3}
       {}
       {\ifcapital
          {\mkbibnameprefix{\MakeCapital{#3\isdot}}}
          {\mkbibnameprefix{#3\isdot}}%
        \ifpunctmark{'}{}{\bibnamedelimc}}}
    {\usebibmacro{name:delim}{#1}%
     \usebibmacro{name:hook}{#1}}}%
  \mkbibnamelast{#1}}%
\begin{document}
The relation between the the sign and the signified is arbitrary \autocite{Saussure1995}. 

Language change is driven by language variation. \autocite{Labov1972}.

\printbibliography


\end{document}

在此处输入图片描述

相关内容