0

Recentely I have decided to use biblatex to auto-generate my bibliography. For my needs, I have selected the biblatex-phys style file. I did make some small modifications in standard.bbx, however I have so far been unable for the "addendum" field for article to be displayed. I've tried to change things (trial and error really) but with no avail. Bellow is the source code, can somebody please take a look and tell me what is preventing the field to be shown?

%% ---------------------------------------------------------------
%% biblatex-phys --- A biblatex implementation of the AIP and APS 
%%   bibliography style
%% Maintained by Joseph Wright
%% E-mail: [email protected]
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% ---------------------------------------------------------------
%% 

\ProvidesFile{phys.bbx}[2018/10/19 v1.1 biblatex bibliography style]

% Load the standard style to avoid copy-pasting unnecessary material
\RequireBibliographyStyle{numeric-comp}

% New options
\newtoggle{bbx:articletitle}
\newtoggle{bbx:chaptertitle}
\newtoggle{bbx:pageranges}
\DeclareBibliographyOption{articletitle}[true]{%
  \settoggle{bbx:articletitle}{#1}%
}
\DeclareBibliographyOption{chaptertitle}[true]{%
  \settoggle{bbx:chaptertitle}{#1}%
}
\DeclareBibliographyOption{pageranges}[true]{%
  \settoggle{bbx:pageranges}{#1}%
}
\DeclareBibliographyOption{biblabel}{%
  \ifstrequal{#1}{brackets}
    {%
      \DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{##1}}%
      \setlength{\biblabelsep}{10 pt}%
    }
    {%
      \DeclareFieldFormat{labelnumberwidth}{\mkbibsuperscript{##1}}%
      \setlength{\biblabelsep}{0 pt}%
    }%
}

% Alter settings that carry through from biblatex
\ExecuteBibliographyOptions
  {
    articletitle = true       ,
    chaptertitle = true       ,
    %biblabel     = superscript,
    doi          = false      ,
    eprint       = false      ,
    giveninits   = true       ,
    isbn         = false      ,
    maxnames     = 999        ,
    maxcitenames = 2          ,
    pageranges   = true       ,
    url          = false
  }

% Custom field formats
\DeclareFieldFormat[inproceedings]{booktitle}{#1}
\DeclareFieldFormat{eprint:arxiv}{%
  \ifhyperref
    {\href{https://arxiv.org/\abx@arxivpath/#1}{%
        arXiv\addcolon
        \nolinkurl{#1}%
        \iffieldundef{eprintclass}
          {}
          {\addspace\UrlFont{\mkbibbrackets{\thefield{eprintclass}}}}}}
    {arXiv\addcolon
      \nolinkurl{#1}%
      \iffieldundef{eprintclass}
        {}
        {\addspace\UrlFont{\mkbibbrackets{\thefield{eprintclass}}}}}}
\DeclareFieldAlias{eprint:arXiv}{eprint:arxiv}
\DeclareFieldFormat[online]{date}{\mkbibparens{#1}\nopunct}
\DeclareFieldFormat{doi}{%
  \ifhyperref
    {\href{https://doi.org/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}%
}
\DeclareFieldFormat{doi/url-link}{%
  \ifhyperref
    {%
      \iffieldundef{doi}
        {%
          \iffieldundef{url}
            {\@firstofone}
            {\href{\thefield{url}}}%
        }
        {\href{https://doi.org/\thefield{doi}}}%
    }
    {\@firstofone}%
      {#1}%
}
\DeclareFieldFormat{journaltitle}{#1\isdot}
\DeclareFieldFormat[article]{pages}{%
  \iftoggle{bbx:pageranges}{#1}{\mkfirstpage{#1}}%
}
\DeclareFieldFormat[article,inproceedings,patent]{title}{%
  \iftoggle{bbx:articletitle}
    {\mkbibquote{#1\isdot}}
    {}%
}
\DeclareFieldFormat[incollection]{title}{%
  \iftoggle{bbx:chaptertitle}
    {\mkbibquote{#1\isdot}}
    {}%
}
\DeclareFieldFormat{related:translatedas}{\mkbibbrackets{#1}}
\DeclareFieldFormat{titlecase}{\MakeSentenceCase*{#1}}
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat[article]{volume}{\mkbibbold{#1}}
\DeclareFieldFormat{year}{\mkbibparens{#1}}

% Simple modifications to punctuation, etc.
\renewcommand*{\begrelateddelim}{\addsemicolon\space}%
\renewcommand*{\intitlepunct}{\addspace}
\providecommand*{\mkibid}[1]{#1}
\renewcommand*{\newunitpunct}{\addcomma\space}

% Bibliography strings
\DefineBibliographyStrings{english}{%
  byeditor  = edited by,
  chapter   = Chap\adddot,
  volume    = Vol\adddot
}

% Bibliography macros
\renewbibmacro*{chapter+pages}{%
  \setunit{\addspace}%
  \printfield{chapter}%
  \setunit{\bibpagespunct}%
  \printfield{pages}%
  \newunit
}

\renewbibmacro*{institution+location+date}{%
  \setunit{\addspace}%
  \printtext[parens]{%
    \printlist{institution}%
    \newunit
    \printlist{location}%
    \newunit
    \usebibmacro{date}%
  }%
}

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

\renewbibmacro*{maintitle+booktitle}{%
  \printtext[doi/url-link]{%
    \iffieldundef{maintitle}
      {}
      {%
        \usebibmacro{maintitle}%
        \newunit
      }%
    \usebibmacro{booktitle}%
  }%
  \newunit\newblock
  \iffieldundef{volume}
    {}
    {%
      \printfield{volume}%
      \clearfield{volume}%
      \printfield{part}%
      \clearfield{part}%
    }%
  \newunit
}

\newbibmacro*{organization+date}{%
  \setunit{\addspace}%
  \printtext[parens]{%
    \printlist{organization}%
    \newunit
    \usebibmacro{date}%
  }%
  \newunit
}

\renewbibmacro*{publisher+location+date}{%
  \setunit{\addspace}%
  \printtext[parens]{%
    \printlist{publisher}%
    \newunit
    \printlist{location}%
    \newunit
    \usebibmacro{date}%
  }%
  \newunit
}

\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
  \newunit
  \printfield{eid}%
}

% New bibliography drivers, using the required order of fields. These
% are mainly copied from standard.bbx then modified.
\DeclareBibliographyDriver{article}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{bytranslator+others}%
  \newunit\newblock
  \printfield{version}%
  \newunit\newblock
  \printtext[doi/url-link]{%
    \usebibmacro{journal+issuetitle}%
    \newunit
    \usebibmacro{byeditor+others}%
    \newunit
    \usebibmacro{note+pages}%
    \newunit\newblock
    \iftoggle{bbx:isbn}
      {\printfield{issn}}
      {}%
    \setunit{\addspace}%
    \printfield{year}%
  }%
  \setunit{\addspace}%
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  %\usebibmacro{addendum+pubstate}%
  \renewbibmacro*{addendum+pubstate}{%
     \setunit{\addsemicolon\space}%
     \printfield{addendum}%
     \newunit\newblock
     \printfield{pubstate}
  }%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{inbook}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{bybookauthor}%
  \setunit*{\addcomma\space}%
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \usebibmacro{related}%
  \usebibmacro{finentry}}

\DeclareBibliographyDriver{inproceedings}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{organization+date}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{patent}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \printfield{type}%
  \setunit*{\addspace}%
  \printfield{number}%
  \iflistundef{location}
    {}
    {\setunit*{\addspace}%
     \printtext[parens]{%
       \printlist[][-\value{listtotal}]{location}}}%
  \setunit{\addspace}%
  \printtext[parens]{%
    \usebibmacro{byholder}%
    \newunit
    \usebibmacro{date}%
  }%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}%
}

% Deal with repeated names or journals in entry sets: based on
% http://tex.stackexchange.com/a/63013
\DeclareBibliographyDriver{set}{%
  \entryset
    {%
      \ifbool{bbx:subentry}
        {\printfield[bibentrysetcount]{entrysetcount}%
         \setunit*{\addnbspace}}
        {}%
     }
    {%
      \ifdef{\bbx@set@journal}
        {}
        {\savefield{journaltitle}{\bbx@set@journal}}%
      \ifdef{\bbx@set@namehash}
        {}
        {\savefield{namehash}{\bbx@set@namehash}}%
    }%
  \newunit\newblock
  \usebibmacro{setpageref}%
  \finentry
  \global\undef\bbx@set@namehash
  \global\undef\bbx@set@journal
}

\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {%
      \iffieldequals{namehash}{\bbx@set@namehash}
        {\nopunct}
        {%
          \global\undef\bbx@set@namehash
          \printnames{author}%
          \iffieldundef{authortype}
            {}
            {%
              \setunit{\addcomma\space}%
              \usebibmacro{authorstrg}%
            }%
        }%
      \iffieldundef{collaboration}
        {}
        {\printfield[parens]{collaboration}}}
    {}%
}


\renewbibmacro*{journal}{%
  \iffieldundef{journaltitle}
    {}
    {%
      \iffieldequals{journaltitle}{\bbx@set@journal}
        {\bibstring[\mkibid]{ibidem}}
        {%
          \global\undef\bbx@set@journal
          \printtext[journaltitle]{%
            \printfield[noformat]{journaltitle}%
            \setunit{\subtitlepunct}%
            \printfield[noformat]{journalsubtitle}%
          }%
        }% 
    }%
}

\newbibmacro*{related:translatedas}[1]{%
  \entrydata{#1}{%
    \usebibmacro{journal+issuetitle}%
    \newunit
    \usebibmacro{note+pages}%
    \newunit\newblock
    \setunit{\addspace}%
    \printfield{year}%
    \setunit{\addspace}%
    \iffieldundef{pages}
    {%
      \printfield{doi}%
      \clearfield{doi}%
    }%
    {}%
    \usebibmacro{doi+eprint+url}%
  }%
}


%% 
%% Copyright (C) 2012-2014,2016,2018 by
%%   Joseph Wright <[email protected]>
%% 
%% It may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version.  The latest
%% version of this license is in the file:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status) by
%%   Joseph Wright.
%% 
%% This work consists of the files biblatex-phys.bib,
%%                                 biblatex-phys.tex,
%%                                 phys.bbx and
%%                                 phys.cbx,
%%           and the derived file  biblatex-phys.pdf.
%% 
%%
%% End of file `phys.bbx'.

1 Answer 1

1

Before we start: You should never modify a file installed by your TeX distribution directly. That only leads to confusing incompatibilities when you share your document (or run it on a different machine, or ...). Furthermore, the file may be overwritten (and your changes obliterated) without warning during an update of the involved package. Instead you should only modify a renamed copy, that makes it clear to everybody that this is a different file.

By default all types display the addendum field if present (in the standard styles as well as biblatex-phys).

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=phys, backend=biber]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{sigfridsson,
  author       = {Sigfridsson, Emma and Ryde, Ulf},
  title        = {Comparison of methods for deriving atomic charges from the
                  electrostatic potential and moments},
  journaltitle = {Journal of Computational Chemistry},
  date         = 1998,
  volume       = 19,
  number       = 4,
  pages        = {377-395},
  doi          = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},
  addendum     = {Lorem ipsum dolor sit amet},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\cite{sigfridsson}
\printbibliography
\end{document}

E. Sigfridsson and U. Ryde, ‘Comparison of methods for deriving atomic charges from the electrostatic potential and moments’, Journal of Computational Chemistry 19, 377–395 (1998), Lorem ipsum dolor sit amet.

This means that the problem must lie with the modification if the modified code does not print this field.

And indeed your code contains

\DeclareBibliographyDriver{article}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{bytranslator+others}%
  \newunit\newblock
  \printfield{version}%
  \newunit\newblock
  \printtext[doi/url-link]{%
    \usebibmacro{journal+issuetitle}%
    \newunit
    \usebibmacro{byeditor+others}%
    \newunit
    \usebibmacro{note+pages}%
    \newunit\newblock
    \iftoggle{bbx:isbn}
      {\printfield{issn}}
      {}%
    \setunit{\addspace}%
    \printfield{year}%
  }%
  \setunit{\addspace}%
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  %\usebibmacro{addendum+pubstate}%
  \renewbibmacro*{addendum+pubstate}{%
     \setunit{\addsemicolon\space}%
     \printfield{addendum}%
     \newunit\newblock
     \printfield{pubstate}
  }%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}%
}

In particular we find that

  %\usebibmacro{addendum+pubstate}%

is commented out, which means that the macro is not used. And then there is

  \renewbibmacro*{addendum+pubstate}{%
     \setunit{\addsemicolon\space}%
     \printfield{addendum}%
     \newunit\newblock
     \printfield{pubstate}
  }%

which just redefines (\renewcommand) the macro locally. But the macro is never used.

You probably want something like

\DeclareBibliographyDriver{article}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{bytranslator+others}%
  \newunit\newblock
  \printfield{version}%
  \newunit\newblock
  \printtext[doi/url-link]{%
    \usebibmacro{journal+issuetitle}%
    \newunit
    \usebibmacro{byeditor+others}%
    \newunit
    \usebibmacro{note+pages}%
    \newunit\newblock
    \iftoggle{bbx:isbn}
      {\printfield{issn}}
      {}%
    \setunit{\addspace}%
    \printfield{year}%
  }%
  \setunit{\addspace}%
  \usebibmacro{doi+eprint+url}%
  \setunit{\addsemicolon\space}\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}%
}

Assuming the modified .bbx file is called phys-pml.bbx (you can get the entire file from https://gist.github.com/moewew/99f02576311ea80d63864b66c48f48b1) we'd modify the MWE slightly to get

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=phys, bibstyle=phys-pml, backend=biber]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{sigfridsson,
  author       = {Sigfridsson, Emma and Ryde, Ulf},
  title        = {Comparison of methods for deriving atomic charges from the
                  electrostatic potential and moments},
  journaltitle = {Journal of Computational Chemistry},
  date         = 1998,
  volume       = 19,
  number       = 4,
  pages        = {377-395},
  doi          = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},
  addendum     = {Lorem ipsum dolor sit amet},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\cite{sigfridsson}
\printbibliography
\end{document}

E. Sigfridsson and U. Ryde, ‘Comparison of methods for deriving atomic charges from the electrostatic potential and moments’, Journal of Computational Chemistry 19, 377–395 (1998); Lorem ipsum dolor sit amet.

as desired.

2
  • Thank you, sir (madam) for your answer. Unfortunately, I had already tried this and it does not solve the problem (I did change the copy again with your code just to be sure, but indeed it does not solve the problem). Nonetheless, since an authority has checked the code it means that the problem is elsewhere (standard.bbx most likely since it was the only other modified file)
    – PML
    Commented Sep 21, 2019 at 16:20
  • 1
    @PML As I say you should never modify system files. Especially if you want to communicate with other peoples (such as asking on a forum). I suggest you re-install biblatex and biblatex-phys to make sure your changes are made undone and then you ask a new question about what you actually want to do.
    – moewe
    Commented Sep 21, 2019 at 16:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .