自定义 `\citeauthor*` 以显示完整的作者姓名,但仅显示首字母大写

自定义 `\citeauthor*` 以显示完整的作者姓名,但仅显示首字母大写

我正在使用带有样式的 biblatex verbose-trad1。当我使用该命令时,\citeauthor*我会得到作者的全名和 SmallCaps 的姓氏。这很好,但我想创建一个新命令,\citeauthor*以便我能够仅使用大写字母引用作者的全名。

例如:目前:\citeauthor*给我 John SKA(小型大写)我希望:\somenewcommand这给我 John Ska 但保留我所有其他引文(\autocite),即:小型大写的名字。

编辑:我稍微修改了@moewe 的答案,以准确获得我想要的结果。最终结果是:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{csquotes}                   
\usepackage[style=verbose-trad1,
backend=bibtex,
bibencoding=inputenc,           
language=french,                
natbib=true,                    
sortcites=true,
autopunct=true,                     
babel=hyphen,                       
hyperref=true,                          
block=space,
citetracker=true,
ibidpage=true,
ibidtracker=context,
idemtracker=true,
pagetracker=true,
url=false,
]{biblatex}

\bibliography{/Users/lucianocouto/Documents/Chartres/bibliographie.bib}

\DeclareCiteCommand*{\citeauthor}
{\defcounter{maxnames}{99}%
\defcounter{minnames}{99}%
\defcounter{uniquename}{2}%
\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex{\indexnames{labelname}}{}%
\printnames{labelname}}
{\multicitedelim}
{\usebibmacro{postnote}}

\DeclareCiteCommand*{\citeauthornsc}
{\renewcommand*{\mkbibnamelast}[1]{####1}  % avoid SmallCaps for the name
\defcounter{maxnames}{99}%
\defcounter{minnames}{99}%
\defcounter{uniquename}{2}%
\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex{\indexnames{labelname}}{}%
\printnames{labelname}}
{\multicitedelim}
{\usebibmacro{postnote}}

\DeclareCiteCommand{\citeauthornsc}
  {\renewcommand*{\mkbibnamelast}[1]{####1}  % avoid SmallCaps for the name
   \boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printnames{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\begin{document}

Standard small caps : \citeauthor{Milgrom:1991aa}

The new standard command : \citeauthornsc{Milgrom:1991aa}\autocite{Milgrom:1991aa}

Full name smallcaps : \citeauthor*{Milgrom:1991aa}

The new full name small caps : \citeauthornsc*{Milgrom:1991aa}\autocite{Milgrom:1991aa}

\enddocument

在此处输入图片描述

多谢 !!!

答案1

我们可以非常轻松地定义一个新命令\citeauthornsc,并且\citeauthornsc*从 的标准定义中,通过向预编码钩子\citeauthor添加不以小写字母打印姓氏的命令(由于命令在命令中重新定义的方式,因此需要大量的 s);预编码钩子只有本地范围,因此重新定义仅适用于此 cite 命令。这两个命令基本上是 定义的副本,并在预编码中添加了一行。\renewcommand*{\mkbibnamefamily}[1]{####1}%#biblatex.def

\documentclass{article}
\usepackage[french]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=verbose-trad1]{biblatex}

\addbibresource{biblatex-examples.bib}

\DeclareCiteCommand{\citeauthornsc}
  {\renewcommand*{\mkbibnamefamily}[1]{####1}%
   \boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printnames{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand*{\citeauthornsc}
  {\renewcommand*{\mkbibnamefamily}[1]{####1}%
   \boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printnames[][1-1]{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}


\begin{document}
Standard small caps:
\citeauthor{wilde}
our new command:
\citeauthornsc{wilde}
small caps again:
\citeauthor{wilde}
\autocite{wilde}
\end{document}

在此处输入图片描述

答案2

自 2016 年 3 月 (biblatex 3.3) 起,您需要更改

\mkbibnamefamily

代替

\mkbibnamelast

相关内容