3

With biblatex I want to imitate the amsplain style for article entries in the bibliography. Specifically, I still need to make the volume, number, and year parts to appear in the form

vv (yr), no. n

— with the "number" field following the (parenthesized) year — as in the following amsplain example:

Article entry with amsplain bibliography style

Here's how far I've gotten with biblatex. The source is:

\documentclass[12pt]{memoir}

\usepackage[style=numeric,backend=bibtex]{biblatex}

\begin{filecontents}{ref.bib}
@article{EulerE1776,
    Author = {Euler, Leonhard},Title = {All about E},
    Journal = {Math.\ Psychol.},
    Year = {1776},Volume = {4},number={1},
    pages={1--2718}
}
\end{filecontents}

\addbibresource{ref.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document} 

And my biblatex.cfg is:

% BIBLATEX.CFG
% mimic amsplain
%
\ProvidesFile{biblatex.cfg}
%
\renewcommand*{\newunitpunct}{\addcomma\space}
%
\DeclareNameAlias{sortname}{last-first}
%
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{\mkbibemph{#1}}% no quote marks
  \DeclareFieldFormat{journaltitle}{#1}
  %
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {volume}{\mkbibbold{#1}}  
\DeclareFieldFormat{pages}{#1}% no prefix for the `pages` field in the bibliography
%
\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}

The output with that biblatex configuration is:

Biblatex article entry

I presume I have to at least modify the definition of \DeclareBibliographyDriver{article} and perhaps modify some bibmacro, but I've been unable to penetrate the documentation to see how to do that.

Note: Owing to other reasons, I must use biblatex rather than just the amsplain style with bibtex.

murray
  • 7,944
  • You may want to check out my comments on your last question here. – moewe Oct 25 '16 at 20:17
  • @moewe: Of course I checked those comments and used them, but the problem is that in standard.bbx I just don't find any mention of a year macro, so I don't know what to modify how. – murray Oct 25 '16 at 20:24
  • Now I'm confused, I didn't talk about the year macro, did I? I said something about \mkbibemph instead of \emph etc. – moewe Oct 25 '16 at 20:31
  • Since I'm trying to move the number field after the year field, that's why I mentioned the latter. – murray Oct 25 '16 at 20:33
  • Ah, well you'll find the answet to your question in my answer below. My comment here was just so I don't have to repeat my earlier comment. It has nothing to do with your question as such, it just gives some general hints. (I thought that since I posted the comment after my answer, you might not have read it.) – moewe Oct 25 '16 at 20:38

1 Answers1

3

We only need to modify the macro journal+issuetitle from standard.bbx. Because it was easier I have scattered the definition of volume+number+eid throughout journal+issuetitle instead of retaining it as a separate macro.

\DeclareFieldFormat[article,periodical]{number}{\bibstring{number}~#1}% number of a journal

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

We essentially split up the macro volume+number+eid into its volume and number parts and moved the date printing in between the two.

moewe
  • 175,683
  • That works - but why? In my .bib file, I have a year field. Where/how does that get translated into the bibmacro for journal+issuetitle? (That's the sort of thing I'm not understanding in order to modify the style myself.) – murray Oct 25 '16 at 20:38
  • @murray The year field gets parsed into a date-structure, that is printed with the macro issue+date we call in the code above. Unfortunately finding out where what gets printed it is not always as easy as looking for the field name. You can always start from the driver and unwrap the macro definitions by looking the up in standard.bbx and biblatex.def, that can get you quite far, but may take some time. – moewe Oct 25 '16 at 20:40
  • I don't find an issue+date macro defined in standard.bbx or in biblatex.sty or in 'bib latex.def` Where does it come from? – murray Oct 25 '16 at 20:43
  • @murray It's in standard.bbx (line 785 on my machine). Essentially it does \usebibmacro{date} wrapped in printtext[parens] if you don't have issuetitle defined. date then is defined in biblatex.def as \newbibmacro*{date}{\printdate}. \printdate you can look up in the manual, or you guess from the name that it prints the date. – moewe Oct 25 '16 at 20:45
  • OK, see the explanation of \printdate in biblatex.pdf but not finding its definition in biblatex.sty or standard.bbx or biblatex.def. Am I just missing finding it in the actual files? – murray Oct 25 '16 at 21:03
  • @murray \printdate is a bit tricky, it is defined in biblatex.styin a roundabout way. – moewe Oct 25 '16 at 21:05
  • @murray See my comment in chat. – moewe Oct 26 '16 at 15:21