我使用 BibLaTeX,后端是 biber,风格是 philosopy-modern。我所追求的是:我希望参考书目中的书籍、收藏等的副标题以直立字体显示,即不像主标题那样以斜体显示。
几个月前我找到了一个解决方案(如果我没记错的话,我通过 重新定义了主文档中的标题\renewbibmacro*{title ...}
),但现在我无意中更改了一些字符,我不记得如何重新建立我的定义。我没有做的是复制\newbibmacro*{title ...}
,在 之间重新定义它\makeatletter
,并通过删除[titlecase]
前面的\makeatother 来重新定义它{subtitle}
(至少它不再起作用)。
有人知道吗?(我没有附加示例,因为其他 biblatex 样式、不同的 biber 选项、各个部分的重新定义仍然存在同样的问题biblatex.def
......)
答案1
在以下示例中,我title
根据需要修改了 bibmacro。请注意,应将类似的更改应用于booktitle
、maintitle
、journal
、periodical
和issue
bibmacros(均位于 中biblatex.def
)。
附录:修改并不明显 - 只是从一行代码中删除了一个右括号,并将其添加到另一行代码中。效果是\printfield[titlecase]{subtitle}
不再是 的参数的一部分\printtext[title]
。
\documentclass{article}
\usepackage{biblatex}
\renewbibmacro*{title}{%
\ifboolexpr{
test {\iffieldundef{title}}
and
test {\iffieldundef{subtitle}}
}
{}
{\printtext[title]{%
\printfield[titlecase]{title}%
% \setunit{\subtitlepunct}% DELETED
% \printfield[titlecase]{subtitle}}% DELETED
\setunit{\subtitlepunct}}% NEW
\printfield[titlecase]{subtitle}% NEW
\newunit}%
\printfield{titleaddon}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
subtitle = {An introduction},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}
答案2
最后,我必须重新定义标题并在副标题的定义中删除标题大小写。
这就是我所做的(虽然看起来不太专业,但确实有效)
\renewbibmacro*{title}{%
\ifboolexpr{
test {\iffieldundef{title}}
and
test {\iffieldundef{subtitle}}
}
{}
{\printtext[title]{%
\printfield[titlecase]{title}%
\setunit{\subtitlepunct}%
\printfield{subtitle}}%
\newunit}%
\printfield{titleaddon}}
\renewbibmacro*{booktitle}{%
\ifboolexpr{
test {\iffieldundef{booktitle}}
and
test {\iffieldundef{booksubtitle}}
}
{}
{\printtext[booktitle]{%
\printfield[titlecase]{booktitle}%
\setunit{\subtitlepunct}%
\printfield{booksubtitle}}%
\newunit}%
\printfield{booktitleaddon}}
\renewbibmacro*{maintitle}{%
\ifboolexpr{
test {\iffieldundef{maintitle}}
and
test {\iffieldundef{mainsubtitle}}
}
{}
{\printtext[maintitle]{%
\printfield[titlecase]{maintitle}%
\setunit{\subtitlepunct}%
\printfield{mainsubtitle}}%
\newunit}%
\printfield{maintitleaddon}}
\renewbibmacro*{journal}{%
\iffieldundef{journaltitle}
{}
{\printtext[journaltitle]{%
\printfield[titlecase]{journaltitle}%
\setunit{\subtitlepunct}%
\printfield{journalsubtitle}}}}
\DeclareFieldFormat[book, thesis, online, collection,
proceedings, journal]{subtitle}{\textnormal{#1}}
\DeclareFieldFormat[collection,
proceedings]{mainsubtitle}{\textnormal{#1}}
\DeclareFieldFormat{booksubtitle}{\textnormal{#1}}
\DeclareFieldFormat{journalsubtitle}{\textnormal{#1}}