使用 biblatex-abnt 时如何使作者姓名以小写形式显示?

使用 biblatex-abnt 时如何使作者姓名以小写形式显示?

我创建了一个小示例,希望获取小写字母的作者姓名。预期结果是Knuth(1984)但它正在生产KNUTH(1984)

\documentclass{article}
\usepackage[style=abnt,ittitles]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{donaldknuth1984,
 author = {Donald E. Knuth},
 title = {The TeXbook},
 publisher = {Addison-Wesley Professional},
 year = {1984},
 isbn = {0201134489}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\newcommand\posscite[1]{\citeauthor*{#1}'s \citeyear{#1}}
\begin{document}
\posscite{donaldknuth1984}
\end{document}

可能需要重新\citeauthor定义abnt.cbx,但我没能做到。我也尝试过强制\posscite使用小写:\newcommand\posscite[1]{\lowercase\expandafter{\citeauthor*{#1}}'s \citeyear{#1}},但也没用。

答案1

我建议你使用\posscite我的答案\textcite 的作者姓名为所有格

\documentclass{article}
\usepackage[style=abnt,ittitles]{biblatex}

\DeclareNameWrapperFormat{textlabelname:poss}{#1's}

\DeclareFieldFormat{shorthand:poss}{%
  \ifnameundef{labelname}{#1's}{#1}}

\DeclareFieldFormat{citetitle:poss}{\mkbibemph{#1}'s}

\DeclareFieldFormat{label:poss}{#1's}

\newrobustcmd*{\posscitealias}{%
  \AtNextCite{%
    \DeclareNameWrapperAlias{labelname}{textlabelname:poss}%
    \DeclareFieldAlias{shorthand}{shorthand:poss}%
    \DeclareFieldAlias{citetitle}{citetitle:poss}%
    \DeclareFieldAlias{label}{label:poss}}}

\newrobustcmd*{\posscite}{%
  \posscitealias%
  \textcite}

\newrobustcmd*{\Posscite}{\bibsentence\posscite}

\newrobustcmd*{\posscites}{%
  \posscitealias%
  \textcites}

\addbibresource{biblatex-examples.bib}

\begin{document}
\posscite{worman}
\end{document}

女人 (2002)

这种方法的优点是您不必\posscite通过将多个\...cite...命令合并为一个来定义\newcommand(这通常会对引用跟踪产生负面影响,而且如果您想正确获得前后注释,则更难处理)。

答案2

我添加了另一个作者(一个假的作者)并使用命令\textcite{}和版本正确处理多个\textcites{}

\usepackage[style=abnt,ittitles]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{donaldknuth1984,
 author = {Donald E. Knuth},
 title = {The TeXbook},
 publisher = {Addison-Wesley Professional},
 year = {1984},
 isbn = {0201134489}
}
@book{other2021,
  author = {Other Author},
  title = {Title},
  publisher = {Addison-Wesley Professional},
  year = {2021},
  isbn = {0201134489}
}
\end
\end{filecontents*}
\addbibresource{\jobname.bib}
\newcommand\posscite[1]{\citeauthor*{#1}'s \citeyear{#1}}
\begin{document}
%\posscite{donaldknuth1984}
\textcite{donaldknuth1984}

\textcites{donaldknuth1984}{other2021}
\end{document}

结果如下。请注意,只有复数版本\textcites{A}{B}...{N-1}{N}在引用 {N-1} 和 {N} 之间添加了字母“e”。

在此处输入图片描述

相关内容