0

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

  • 3
    See Suppress “In:” biblatex – moewe Sep 15 '17 at 16:33
  • 1
    You have the \renewcommand*\newunitpunct{\addcomma\space} line twice. In url = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html" you should not escape the ~, so better go with url = "http://www-cs-faculty.stanford.edu/~uno/abcde.html" the link will work correctly then. – moewe Sep 15 '17 at 16:33
  • @Mico I need to add the condition of the status of a comma after the name of the scientific journal and writing vol. at $\textbf{volume}$ – Emad kareem Sep 15 '17 at 18:16
  • @moewe I am grateful to you for your help and to answer my questions. Can you help me with add the condition of the status of a comma after the name of the scientific journal and writing vol. at volume} – Emad kareem Sep 15 '17 at 18:17
  • 1
    @Mico I think it would have been easier to ask a new question rather than to completely change this one. – moewe Sep 15 '17 at 18:20
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.