2

Starting from this question I edited the code presented there to achieve a citation like, journal-title+volume+pages+year

\renewbibmacro*{journal+issuetitle}{%
    \usebibmacro{journal}%
    \setunit*{\addspace}%
    \iffieldundef{series}
    {}
    {\newunit
        \printfield{series}%
        \setunit{\addspace}}%
    \printfield{volume}%
    \setunit{\addcomma\space}%
    \printfield{pages}%
    \setunit{\space (}%
    \usebibmacro{date})%
    \newunit}

Could it have been done better? Most likely, I dont know how macros is used but it works as intended with one minor problem. After the year, the pages are added again. I assume it is because the macro journal+issuetitle doesn't encompass pages, so try adding +pages to the name but it didn't do anything.

Was wondering what needs to be changed in the redefinition of the macros so pages is not shown again at the end.

Pic of how it looks like (there are more editions done to biblatex): enter image description here

Edit:

A working minimal example without the rest of the editions so that is shorter would be

\documentclass{article}
\usepackage[backend=biber, style=numeric-comp, sortcites=true, sorting=none, url=false,maxbibnames=99]{biblatex}
\addbibresource{biblatex-examples.bib}
\usepackage[utf8]{inputenc}
\renewbibmacro*{journal+issuetitle}{%
    \usebibmacro{journal}%
    \setunit*{\addspace}%
    \iffieldundef{series}
    {}
    {\newunit
        \printfield{series}%
        \setunit{\addspace}}%
    \printfield{volume}%
    \setunit{\addcomma\space}%
    \printfield{pages}%
    \setunit{\space (}%
    \usebibmacro{date})%
    \newunit}

\title{mwe}

\begin{document}
\maketitle

Lorem ipsum~\cite{sigfridsson} dolor~\cite{worman}.
\printbibliography
\end{document}

Thanks!

4

The pages are added again, because they are printed by the macro note+pages in the driver for @article. If you also print the pages in journal+issuetitle, you need to suppress the pages in note+pages.

The redefinition of journal+issuetitle below is based on the standard definition from standard.bbx. The only change is the added pages printing.

Note that it is usually bad style to have bare parentheses like ( and ) in \setunit. In my solution below, I used the ready-made macro issue+date that adds the parentheses and takes care of a few other things as well.

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

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

\DeclareFieldFormat[article,periodical]{pages}{#1}

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

\renewbibmacro*{note+pages}{%
  \printfield{note}%
  \newunit}

\addbibresource{biblatex-examples.bib}


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

Emma Sigfridsson and Ulf Ryde. ‘Comparison of methods for deriving atomic charges from the electrostatic potential and moments’. In: Journal of Computational Chemistry 19.4, 377–395 (1998). doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P.


If you want to understand how these macros work and why other stuff is printed, you should have a look at the bibliography drivers in standard.bbx, most relevant macros that are called there are either defined in standard.bbx or biblatex.def.

In biblatex 3.12 the driver for @article can be found in ll. 26-62 of standard.bbx. journal+issuetitle is in ll. 746-761 and note+pages in ll. 857-861.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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