我希望在biblatex
参考书目。下面是两个条目,我目前使用的 [2]。它在参考书目和文本中都显示小写前缀。我怎样才能在参考书目 ( von Surname
) 中实现小写前缀,而在文本 ( Von Surname
) 中实现大写前缀?
我尝试改变前缀大写,方法是使用{V}on Surname
(如1)。但是,它还将参考书目中的前缀大写,并且/或者在正文中将其删除。
\documentclass{article}
\begin{filecontents*}[overwrite]{ref.bib}
@article{abc,
author = {A Lastname and B von Surname},
title = {An article title 1},
journal = {Journal of First Articles},
year = 1999,
pages = {1-20}
}
@article{def,
author = {A Lastname and B {V}on Surname},
title = {An article title 2},
journal = {Journal of Second Articles},
year = 1999,
pages = {1-20}
}
\end{filecontents*}
\usepackage[
backend = biber,
useprefix = true
]{biblatex}
\addbibresource{ref.bib}
\begin{document}
See \citeauthor{abc}\ \cite{abc}.
See \citeauthor{def}\ \cite{def}.
\printbibliography
\end{document}
如果没有本机方法来实现这一点,我会接受以使用宏前缀的方式破解参考书目(假设,,在内\von{} Surname
打印)。von Surname
\printbibliography
Von Surname
\citeauthor{<bibkey>}
答案1
有一个解决方案,如果“von”前面没有名字(首字母),则在输出中将“von”放在姓氏前面时,将其大写。
输入应该仍然B. von Surname
和往常一样。所有这些都可以通过修改相关的 bibmacros 来完成。事实上,biblatex
已经有代码将“von”大写,以防您使用大写引用命令,例如\Cite
:我们只删除大写测试并始终大写。
宏的原始定义可以在中找到biblatex.def
,更改归结为替换
\ifcapital
{\mkbibnameprefix{\MakeCapital{#3}}\isdot}
{\mkbibnameprefix{#3}\isdot}%
和
\mkbibnameprefix{\MakeCapital{#3}}\isdot
在 bibmacros 中name:family
,name:family-given
姓氏不在名字后面。在这两种情况下,我们只关心真的的分支\ifuseprefix
,因为否则“von”将与名字分组,并被删除或放在姓氏后面。
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=numeric, useprefix=true]{biblatex}
\renewbibmacro*{name:family}[4]{%
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\mkbibcompletenamefamily{%
\ifdefvoid{#3}
{}
{\mkbibnameprefix{\MakeCapital{#3}}\isdot%
\ifprefchar{}{\bibnamedelimc}}%
\mkbibnamefamily{#1}\isdot}}
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibcompletenamefamily{%
\mkbibnamefamily{#1}\isdot}}}%
\renewbibmacro*{name:family-given}[4]{%
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\mkbibcompletenamefamilygiven{%
\ifdefvoid{#3}
{}
{\mkbibnameprefix{\MakeCapital{#3}}\isdot
\ifprefchar{}{\bibnamedelimc}}%
\mkbibnamefamily{#1}\isdot
\ifdefvoid{#4}
{}
{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}%
\ifdefvoid{#2}
{}
{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}}}
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibcompletenamefamilygiven{%
\mkbibnamefamily{#1}\isdot
\ifdefvoid{#4}
{}
{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}%
\ifboolexpe{%
test {\ifdefvoid{#2}}
and
test {\ifdefvoid{#3}}}
{}
{\revsdnamepunct}%
\ifdefvoid{#2}
{}
{\bibnamedelimd\mkbibnamegiven{#2}\isdot}%
\ifdefvoid{#3}
{}
{\bibnamedelimd\mkbibnameprefix{#3}\isdot}}}}
\begin{filecontents}{\jobname.bib}
@article{abc,
author = {A. Lastname and B. von Surname},
title = {An article title 1},
journal = {Journal of First Articles},
year = 1999,
pages = {1-20},
}
@incollection{brandt,
author = {von Brandt, Ahasver and Erich Hoffmann},
editor = {Ferdinand Seibt},
title = {Die nordischen Länder von der Mitte des 11.~Jahrhunderts
bis 1448},
date = 1987,
booktitle = {Europa im Hoch- und Spätmittelalter},
series = {Handbuch der europäischen Geschichte},
number = 2,
publisher = {Klett-Cotta},
location = {Stuttgart},
pages = {884-917},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Lorem \textcite{brandt,abc}
\printbibliography
\end{document}
如果您确实想区分此处的引用和参考书目,则可以使用类似的方法,但使用\AtBeginBibliography
。
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=numeric, useprefix=true]{biblatex}
\letbibmacro{name:family:normal}{name:family}
\newbibmacro*{name:family:cap}[4]{%
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\mkbibcompletenamefamily{%
\ifdefvoid{#3}
{}
{\mkbibnameprefix{\MakeCapital{#3}}\isdot%
\ifprefchar{}{\bibnamedelimc}}%
\mkbibnamefamily{#1}\isdot}}
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibcompletenamefamily{%
\mkbibnamefamily{#1}\isdot}}}%
\letbibmacro{name:family-given:normal}{name:family-given}
\newbibmacro*{name:family-given:cap}[4]{%
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\mkbibcompletenamefamilygiven{%
\ifdefvoid{#3}
{}
{\mkbibnameprefix{\MakeCapital{#3}}\isdot
\ifprefchar{}{\bibnamedelimc}}%
\mkbibnamefamily{#1}\isdot
\ifdefvoid{#4}
{}
{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}%
\ifdefvoid{#2}
{}
{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}}}
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibcompletenamefamilygiven{%
\mkbibnamefamily{#1}\isdot
\ifdefvoid{#4}
{}
{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}%
\ifboolexpe{%
test {\ifdefvoid{#2}}
and
test {\ifdefvoid{#3}}}
{}
{\revsdnamepunct}%
\ifdefvoid{#2}
{}
{\bibnamedelimd\mkbibnamegiven{#2}\isdot}%
\ifdefvoid{#3}
{}
{\bibnamedelimd\mkbibnameprefix{#3}\isdot}}}}
\renewbibmacro{name:family}{\usebibmacro{name:family:cap}}
\renewbibmacro{name:family-given}{\usebibmacro{name:family-given:cap}}
\AtBeginBibliography{%
\renewbibmacro{name:family}{\usebibmacro{name:family:normal}}%
\renewbibmacro{name:family-given}{\usebibmacro{name:family-given:normal}}}
\begin{filecontents}{\jobname.bib}
@article{abc,
author = {A. Lastname and B. von Surname},
title = {An article title 1},
journal = {Journal of First Articles},
year = 1999,
pages = {1-20},
}
@incollection{brandt,
author = {von Brandt, Ahasver and Erich Hoffmann},
editor = {Ferdinand Seibt},
title = {Die nordischen Länder von der Mitte des 11.~Jahrhunderts
bis 1448},
date = 1987,
booktitle = {Europa im Hoch- und Spätmittelalter},
series = {Handbuch der europäischen Geschichte},
number = 2,
publisher = {Klett-Cotta},
location = {Stuttgart},
pages = {884-917},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Lorem \textcite{brandt,abc}
\printbibliography
\end{document}
MWE 中的输出是相同的,但是样式不同,输出可能会不同。
答案2
这是一个使用宏作为前缀的选项。看来您必须使用 的biber
扩展名格式才能执行此操作:
\documentclass{article}
\begin{filecontents}[overwrite]{ref.bib}
@article{def,
author = {A Lastname and given=B, prefix=\von, prefixi=\vonprefix, family=Surname},
title = {An article title 2},
journal = {Journal of Second Articles},
year = 1999,
pages = {1-20}
}
\end{filecontents}
\usepackage[useprefix = true]{biblatex}
\addbibresource{ref.bib}
\DeclareRobustCommand{\von}{\ifbibliography{von}{Von}}
\DeclareRobustCommand{\vonprefix}{\ifbibliography{v}{V}\bibinitperiod}
\begin{document}
See \citeauthor{def} \cite{def}.
\printbibliography
\end{document}