使用哲学现代,我希望将年份放在括号中,例如 [1972] 并且我已设置以下内容:
\documentclass[12pt]{article}
\usepackage{filecontents}
\begin{filecontents}{testbib.bib}
%
@book{davidson:1996,
Author = {Kenneth R. Davidson},
Publisher = {AMS},
Title = {C$^{*}$-Algebras by Example},
Year = {1996}}
%
@article{choi:1980,
Author = {Choi, Man-Duen},
Journal = {J. Oper. Theory},
Number = {2},
Pages = {271--285},
Title = {Some assorted inequalities for positive linear maps on C$^{*}$--algebras},
Volume = {4},
Year = {1980}}
%
\end{filecontents}
\usepackage[%
,backend=biber
,style=philosophy-modern
,firstinits = true]{biblatex}
%
\renewbibmacro*{date+extrayear}{%
\iffieldundef{year}%
{}%
{\makebox[\bibhang][l]{%
\hspace*{.5ex}%
\printtext{\mkbibbrackets{\printfield{labelyear}\printfield{extrayear}}%
\hskip\yeartitle}%
}}}
%
\bibliography{testbib} \begin{document}
%
\nocite{*}
\printbibliography
\end{document}
一切正常,但没有括号。我是否需要做些不同的事情?
答案1
philosophy-modern
使用宏\postsepyear
来排版参考书目中的年份。
其原始定义philosophy-modern.bbx
是
\renewcommand*{\postsepyear}[1]{%
\printtext{\makebox[\bibhang][r]{%
#1\hskip\yeartitle}}\nopunct}
我们可以\mkbibbrackets
在正确的位置添加
\documentclass[12pt]{article}
\usepackage[
,backend=biber
,style=philosophy-modern
,giveninits=true]{biblatex}
\renewcommand*{\postsepyear}[1]{%
\printtext{\makebox[\bibhang][r]{%
\mkbibbrackets{#1}\hskip\yeartitle}}\nopunct}
\addbibresource{biblatex-examples.bib}
\begin{document}
\nocite{nussbaum,sigfridsson}
\printbibliography
\end{document}