更改订购号和年份 biblatex

更改订购号和年份 biblatex

我想更改 biblatex 中数字和年份的顺序。我试过

\documentclass[a4paper,10pt,twoside]{article}
\usepackage[hidelinks]{hyperref}
%\usepackage{lipsum}
%%%%%
%bibliography
%%%%%
\usepackage[style=alphabetic,backend=biber,isbn=false,doi=false,url=false,hyperref=true,block=none]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{mybibfile.bib}
@article{ams-07,
    AUTHOR = {Ardizzoni, A. and Menini, C. and {\c{S}}tefan, D.},
     TITLE = {Hochschild cohomology and ``smoothness'' in monoidal categories},
   JOURNAL = {J. Pure Appl. Algebra},
  FJOURNAL = {Journal of Pure and Applied Algebra},
    VOLUME = {208},
      YEAR = {2007},
    NUMBER = {1},
     PAGES = {297--330},
      ISSN = {0022-4049},
     CODEN = {JPAAA2},
   MRCLASS = {16E40},
  MRNUMBER = {2269845},
MRREVIEWER = {Mariano Suarez-Alvarez},
       DOI = {10.1016/j.jpaa.2005.12.003},
       URL = {http://dx.doi.org/10.1016/j.jpaa.2005.12.003},
}
@article{hoc-45,
    AUTHOR = {Hochschild, G.},
     TITLE = {On the cohomology groups of an associative algebra},
   JOURNAL = {Ann. of Math. (2)},
  FJOURNAL = {Annals of Mathematics. Second Series},
    VOLUME = {46},
      YEAR = {1945},
     PAGES = {58--67},
      ISSN = {0003-486X},
   MRCLASS = {09.1X},
  MRNUMBER = {0011076},
MRREVIEWER = {R. Baer},
}
@book{mac-98,
    AUTHOR = {Mac Lane, Saunders},
     TITLE = {Categories for the working mathematician},
    SERIES = {Graduate Texts in Mathematics},
    VOLUME = {5},
   EDITION = {Second Edition},
 PUBLISHER = {Springer-Verlag},
   ADDRESS = {New York},
      YEAR = {1998},
     PAGES = {xii+314},
      ISBN = {0-387-98403-8},
   MRCLASS = {18-02},
  MRNUMBER = {1712872 (2001j:18001)},
}
\end{filecontents*}
\addbibresource{mybibfile.bib}
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}
%\printfield{date}
\printfield{number}
}
%\DeclareFieldFormat{journaltitle}{\mkbibemph{#1},} % italic journal title with comma
\DeclareFieldFormat[article,book,inbook,incollection,thesis,unpublished]{title}{\mkbibemph{#1}}%\addperiod % italic title with period
\DeclareFieldFormat[article,book,inbook,incollection,thesis,unpublished]{journaltitle}{#1} % title of journal article is printed as normal text
\DeclareFieldFormat[article,book,inbook,incollection,thesis,unpublished]{volume}{vol. {\bf #1}}
\DeclareFieldFormat[article]{date}{#1}
\DeclareFieldFormat[book,inbook,incollection,thesis,unpublished]{date}{(#1)}
\DeclareFieldFormat[article,book,inbook,incollection,thesis,unpublished]{number}{no. #1,}
\DeclareFieldFormat[article,book,inbook,incollection,thesis,unpublished]{pages}{#1}
\renewbibmacro{in:}{}

%%%%%


\begin{document}
In \cite{mac-98}, \cite{ams-07} and perhaps \cite{hoc-45}.

\printbibliography

\end{document}

这使: 在此处输入图片描述

虽然我想要类似的东西

... 卷208 (2007),号1,297-330。

适用于 [AMS07]。有什么想法吗?谢谢!

答案1

使用

\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \printfield{volume}%
  \setunit{\addspace}%
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \setunit{\addcomma\space}%
  \printfield{number}%
  \newunit}

您还应该将标点符号命令移出,并\DeclareFieldFormat可以使用\bibstring

\DeclareFieldFormat*{title}{\mkbibemph{#1}}
\DeclareFieldFormat*{journaltitle}{#1}
\DeclareFieldFormat*{volume}{\bibstring{volume}~\mkbibbold{#1}}
\DeclareFieldFormat[article]{volume}{\bibstring{jourvol}~\mkbibbold{#1}}
\DeclareFieldFormat*{date}{\mkbibparens{#1}}
\DeclareFieldFormat[article]{date}{#1}
\DeclareFieldFormat*{number}{\bibstring{number}~#1}
\DeclareFieldFormat*{pages}{#1}

如果您想要将指令应用于所有条目类型,则可以使用带星号的版本,该版本更短,并且您不会忘记任何类型。例如

\DeclareFieldFormat*{pages}{#1}

代替\DeclareFieldFormat[article,book,inbook,incollection,thesis,unpublished]{pages}{#1}


由于您将所有日期都括在括号中,因此您可能需要添加 - 诚然有点粗俗 -

\renewbibmacro*{date}{\setunit{\addspace}\printdate}

以避免出现逗号括号的情况。

相关内容