![在哲学-现代书目中添加年份括号](https://linux22.com/image/412944/%E5%9C%A8%E5%93%B2%E5%AD%A6-%E7%8E%B0%E4%BB%A3%E4%B9%A6%E7%9B%AE%E4%B8%AD%E6%B7%BB%E5%8A%A0%E5%B9%B4%E4%BB%BD%E6%8B%AC%E5%8F%B7.png)
使用哲学现代,我希望将年份放在括号中,例如 [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}