我正在尝试使用
\ExecuteBibliographyOptions
使 [附录] 字段同时为斜体和单倍行距。但是,{font=textit} 和 {space=double}/{spacing=double}/{space=doublespace}/{spacing=doublespace} 似乎不起作用。
对于斜体和单倍行距,正确的“键”和“值”格式是什么?
当前代码:
\usepackage[doublespacing]{setspace}
\usepackage[backend=biber,
style=authoryear,
maxbibnames=99
]{biblatex}
\addbibresource{Phi-Features and Animacy.bib}
\DeclareCiteCommand{\citeyear}
{}
{\bibhyperref{\printdate}}
{\multicitedelim}
{}
\ExecuteBibliographyOptions[addendum]{?????}
移动网络
\documentclass[12pt, letterpaper]{article}
\usepackage[document]{ragged2e}
\usepackage{fullpage}
\usepackage[margin=1in]{geometry}
\usepackage[doublespacing]{setspace}
\setlength{\parindent}{.5in}
\usepackage{filecontents}
\usepackage[doublespacing]{setspace}
\usepackage[backend=biber,
style=authoryear,
maxbibnames=99
]{biblatex}
\addbibresource{asdfggg.bib}
\ExecuteBibliographyOptions[addendum]{}
\DeclareFieldFormat{addendum}{\textit{#1}}
\DeclareCiteCommand{\citeyear}
{}
{\bibhyperref{\printdate}}
{\multicitedelim}
{}
\begin{filecontents}{asdfggg.bib}
@thesis{codename,
author = {Name Surname},
title = {Title: A Subtitle},
type = {Doctoral Dissertation},
institution = {University of Asdfg},
year = {3333},
location = {Location},
addendum = {\linebreak This is my annotation.}
}
\end{filecontents}
\begin{document}
\pagenumbering{arabic}
\nocite{*}
\uspunctuation
\printbibliography[
heading=bibintoc,
title={Annotated Bibliography}
]
\end{document}
对我来说似乎都\DeclareFieldFormat
不起作用。\ExecuteBibliographyOptions
答案1
并非所有的biblatex
自定义功能都可用作键值选项。特别是字段格式几乎完全通过 处理\DeclareFieldFormat
,它不使用键值语法,而是像普通的宏定义一样工作(我们可以理解\DeclareFieldFormat{<field>}{<code with #1>}
为定义一个辅助宏,然后将其应用为\<helper macro>{<field contents>}
)。
您已经使用了\textit
斜体addendum
,所以我们只需要添加一个命令或环境来提供单倍行距。由于您正在加载解决方案,因此setspace
解决方案可能看起来像
\DeclareFieldFormat{addendum}{%
\begin{singlespace}
\itshape #1%
\end{singlespace}%
\nopunct}
总共
\documentclass[12pt, letterpaper]{article}
\usepackage[document]{ragged2e}
\usepackage[margin=1in]{geometry}
\usepackage[doublespacing]{setspace}
\setlength{\parindent}{.5in}
\usepackage[backend=biber,
style=authoryear,
maxbibnames=99
]{biblatex}
\DeclareFieldFormat{addendum}{%
\begin{singlespace}
\itshape #1%
\end{singlespace}%
\nopunct}
\usepackage{lipsum}
\begin{filecontents}{\jobname.bib}
@thesis{codename,
author = {Name Surname},
title = {Title},
subtitle = {A Subtitle},
type = {phdthesis},
institution = {University of Asdfg},
year = {3333},
location = {Location},
addendum = {This is my annotation. \lipsum},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\uspunctuation
\printbibliography[
heading=bibintoc,
title={Annotated Bibliography}
]
\end{document}