在文本中,我希望在 scshape 中包含所有作者的姓名。但是,如果我使用\DeclareNameAlias{default}{scdefault}
scshape,我不仅可以获得作者的姓名,还可以获得编辑的姓名(对于古代文本)。有没有办法“有选择地”设置字段以获得我的结果?谢谢
\begin{filecontents*}{\jobname.bib}
@book{ campanella:2010,
author = "Campanella, Tommaso",
title = "La città del sole",
editor = "Savinio, Alberto",
publisher = "Adelphi",
location = "Milano",
year = "2010"
}
\end{filecontents*}
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[babel,italian=guillemets]{csquotes}
\usepackage[italian]{babel}
\usepackage[style=philosophy-verbose]{biblatex}
\DeclareFieldFormat[article,inbook,incollection]{title}{\mkbibemph{#1}}
\DeclareNameAlias{default}{scdefault}
\addbibresource{\jobname.bib}
\begin{document}
\cite[33-39]{campanella:2010}
\fullcite[67-77]{campanella:2010}
\end{document}
答案1
这不是一个非常优雅的解决方案,但是却有效......
首先,定义一个命令,允许我们切换到小型大写字母
\newcommand{\makescshape}{%
\renewcommand{\mkbibnamefirst}{\textsc}%
\renewcommand{\mkbibnamelast}{\textsc}%
\renewcommand{\mkbibnameprefix}{\textsc}%
\renewcommand{\mkbibnameaffix}{\textsc}%
}
以及一个切换回来
\newcommand{\makenatshape}{%
\renewcommand{\mkbibnamefirst}{}%
\renewcommand{\mkbibnamelast}{}%
\renewcommand{\mkbibnameprefix}{}%
\renewcommand{\mkbibnameaffix}{}%
}
现在,使用xpatch
包(也就是我们需要的\usepackage{xpatch}
)我们将这些命令注入到处理参考书目中的名称的宏中:一次在开头切换到小写,然后在结尾切换回正常。
\xpretobibmacro{author}{\makescshape}{}{}
\xapptobibmacro{author}{\makenatshape}{}{}
\xpretobibmacro{editor+others}{\makescshape}{}{}
\xapptobibmacro{editor+others}{\makenatshape}{}{}
\xpretobibmacro{translator+others}{\makescshape}{}{}
\xapptobibmacro{translator+others}{\makenatshape}{}{}
平均能量损失
\begin{filecontents*}{\jobname.bib}
@book{ campanella:2010,
author = "Campanella, Tommaso",
title = "La città del sole",
editor = "Savinio, Alberto",
publisher = "Adelphi",
location = "Milano",
year = "2010"
}
\end{filecontents*}
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[babel,italian=guillemets]{csquotes}
\usepackage[italian]{babel}
\usepackage{xpatch}
\usepackage[style=philosophy-verbose]{biblatex}
\DeclareFieldFormat[article,inbook,incollection]{title}{\mkbibemph{#1}}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\newcommand{\makescshape}{%
\renewcommand{\mkbibnamefirst}{\textsc}%
\renewcommand{\mkbibnamelast}{\textsc}%
\renewcommand{\mkbibnameprefix}{\textsc}%
\renewcommand{\mkbibnameaffix}{\textsc}%
}
\newcommand{\makenatshape}{%
\renewcommand{\mkbibnamefirst}{}%
\renewcommand{\mkbibnamelast}{}%
\renewcommand{\mkbibnameprefix}{}%
\renewcommand{\mkbibnameaffix}{}%
}
\xpretobibmacro{author}{\makescshape}{}{}
\xapptobibmacro{author}{\makenatshape}{}{}
\xpretobibmacro{editor+others}{\makescshape}{}{}
\xapptobibmacro{editor+others}{\makenatshape}{}{}
\xpretobibmacro{translator+others}{\makescshape}{}{}
\xapptobibmacro{translator+others}{\makenatshape}{}{}
\nocite{matuz:doody,doody}
\begin{document}
\cite[33-39]{campanella:2010}
\fullcite[67-77]{campanella:2010}
\printbibliography
\end{document}