我的朋友有一个问题,他\footcite
一起使用authorstyle-icomp
并希望将诸如“ibid.”(德语为 ebd.)之类的东西大写,当它们位于 的开头时footnote
。此外,他的参考书目包括阿拉伯姓氏,如“al-Kabir”,如果以它们开头,也需要将其大写footnote
。所以基本上:脚注必须始终以大写字母开头。
我尝试使用在https://stackoverflow.com/questions/2818119/automatically-capitalize-first-letter-of-first-word-in-a-new-sentence-in-latex( \uppercasesingleletter
),不幸的是 (a) 仍然将所有内容大写,并且 (b) 不允许其自身集成到更新的footnote
命令中。
这是最小不工作示例:
\documentclass{scrartcl}
\usepackage{csquotes}
\usepackage{polyglossia}
\setmainlanguage[spelling=new]{german}
\def\uppercasesingleletter#1{\uppercase{#1}}
\let\oldfootnote\footnote
% compiles, but doesn't do anything
\renewcommand\footnote[1]{\oldfootnote{\uppercasesingleletter{#1}}}
% does not compile in the first place
% \renewcommand\footnote[1]{\oldfootnote{\uppercasesingleletter{#1}}}
\begin{filecontents}{test.bib}
@book{ali:title:2008,
title = {Ali's Title},
author = {Ali, Jamal},
date = {2008}
}
@book{azzayn:title:1965,
title = {Az-Zayn's Title},
editor = {az-Zayn, Ahmad},
date = {1965}
}
\end{filecontents}
\usepackage[backend=biber,citestyle=authoryear-icomp]{biblatex}
\addbibresource{test.bib}
\DeclareFieldFormat*{citetitle}{\emph{#1}}
\begin{document}
\uppercasesingleletter{only the first letter of this should be uppercase!}
To this here I want to make a reference.\footcite[p. 14]{ali:title:2008} And another one.\footcite[p. 15]{ali:title:2008}
However, what follows needs some more explaining.\footnote{\cite[p. 16]{ali:title:2008}, compare \cite[p. 141]{azzayn:title:1965}.}
First we go back to the first source,\footcite[p. 12]{ali:title:2008} and then we can see that this is an entirely different thing though.\footcite[p. 150]{azzayn:title:1965}
\end{document}
答案1
这不起作用。\uppercase
是一个原语,它对于简单文本可以正常工作,但不能用于任意内容,也不能用于像这样的复杂命令\cite
。
就你的情况而言,我也认为没有必要使用它。大多数情况下,脚注已经以大写字母开头。有\Cite command
,对于 az-Zayn,你可以使用\autocap
:
@book{azzayn:title:1965,
title = {Az-Zayn's Title},
editor = {\autocap{a}z-Zayn, Ahmad},
date = {1965}
}
(也可以看看Biblatex,阿拉伯名字和名字前缀的大写)
\documentclass{scrartcl}
\usepackage{csquotes}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage[backend=biber,citestyle=authoryear-icomp]{biblatex}
\addbibresource{bib.bib}
\begin{document}
\footcite[14]{ali:title:2008}\footcite[1]{ali:title:2008}
\footnote{\Cite[16]{ali:title:2008}, compare \cite[141]{azzayn:title:1965}.}
\footcites[16]{ali:title:2008}[compare][141]{azzayn:title:1965}
\footcite[12]{ali:title:2008} \footcite[150]{azzayn:title:1965}
\end{document}
顺便说一句:不要在附注中添加“p”。让 biblatex 来做吧。