[Tex/LaTex] Formatting of references with biblatex

biblatexbibliographies

I use a style in the following example to arrange references. I want to make some changes in the style. I need to add the condition of the status of a comma after the name of the scientific journal and writing vol. at volume

    \RequirePackage{filecontents}
    \begin{filecontents}{\jobname.bib}
    @article{einstein,
        author =       "Albert Einstein",
        title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
            [{On} the electrodynamics of moving bodies]",
        journal =      "Annalen der Physik",
        volume =       "322",
        number =       "10",
        pages =        "891--921",
        year =         "1905",
        DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
    }

    @book{latexcompanion,
        author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
        title     = "The \LaTeX\ Companion",
        year      = "1993",
        publisher = "Addison-Wesley",
        address   = "Reading, Massachusetts"
    }

    @misc{knuthwebsite,
        author    = "Donald Knuth",
        title     = "Knuth: Computers and Typesetting",
        url       = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
    }
    \end{filecontents}


        \documentclass[a4paper,10pt]{article}
        \usepackage[english]{babel}
        \usepackage[utf8]{inputenc}

        \usepackage{csquotes}
        \usepackage[%
          style=numeric, 
          sortcites,
          backend=biber,
          giveninits=true % <===================================================
        ]{biblatex}
        \addbibresource{\jobname.bib}

        \DeclareNameAlias{default}{family-given} % <============================
\renewbibmacro{in:}{}
        \renewcommand*\newunitpunct{\addcomma\space} % <========================
     \renewcommand*\newunitpunct{\addcomma\space} % <========================
        \renewcommand*{\finalnamedelim}{%
          \addspace\bibstring{and}\space}%
        % <===== ^^^^^^^^^^^^^^^^^ =============================================



        \begin{document}

        \section{First Section}
        This document is an example of BibTeX using in bibliography management. 
        Three items are cited: \textit{The \LaTeX\ Companion} book 
        \cite{latexcompanion}, the Einstein journal paper \cite{einstein}, and 
        the Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related 
        items are \cite{latexcompanion,knuthwebsite}. 

        \medskip

        \printbibliography

        \end{document}

The output

Einstein, A., "Zur Elektrodynamik bewegter Körper. (German) [On the
electrodynamics of moving bodies]", Annalen der Physik 322.10
(1905), pp. 891—921, DOI: http://dx.doi.org/10.1002/andp.19053221004.

I need to have the output like this

Einstein, A., "Zur Elektrodynamik bewegter Körper. (German) [On the
electrodynamics of moving bodies]", Annalen der Physik, vol. 322.10
(1905), pp. 891—921, DOI: http://dx.doi.org/10.1002/andp.19053221004.

I need to add the condition of the status of a comma after the name of the scientific journal and writing vol. at volume. ie., Annalen der Physik 322.10 to Annalen der Physik, vol. 322.10

Best Answer

You only need a small change to the journal+issuetitle bibmacro and the volume field format.

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
        [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004"
}

@book{latexcompanion,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

@misc{knuthwebsite,
    author    = "Donald Knuth",
    title     = "Knuth: Computers and Typesetting",
    url       = "http://www-cs-faculty.stanford.edu/~uno/abcde.html"
}
\end{filecontents}


\documentclass[a4paper,10pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\usepackage{csquotes}
\usepackage[%
  style=numeric, 
  sortcites,
  backend=biber,
  giveninits=true,
]{biblatex}
\addbibresource{\jobname.bib}

\DeclareNameAlias{default}{family-given}
\renewbibmacro{in:}{}
\renewcommand*\newunitpunct{\addcomma\space} 

\DefineBibliographyExtras{english}{%
  \let\finalandcomma=\empty
  \let\finalandsemicolon=\empty}

\DeclareFieldFormat[article,periodical]{volume}{\bibstring{jourvol}~#1}
\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addcomma\space}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addcomma\space}}%
  \usebibmacro{volume+number+eid}%
  \setunit{\addspace}%
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}

\begin{document}
\section{First Section}
This document is an example of BibTeX using in bibliography management. 
Three items are cited: \textit{The \LaTeX\ Companion} book 
\cite{latexcompanion}, the Einstein journal paper \cite{einstein}, and 
the Donald Knuth's website \cite{knuthwebsite}. The \LaTeX\ related 
items are \cite{latexcompanion,knuthwebsite}. 

\printbibliography
\end{document}

reference section of the example document

Related Question