在哲学-现代书目中添加年份括号

在哲学-现代书目中添加年份括号

使用哲学现代,我希望将年份放在括号中,例如 [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}

参考文献以方括号标明年份

相关内容