[Tex/LaTex] Change .bst to put the pages number at the end

bibtex

My question is simple, but I searched in vain for an answer. Right now, my bibliography style (.bst) gives the following result for an article :

Baumgärtel Hans, « Julius Weisbach und die Einführung der neuen Markscheidekunst in die Praxis », Zeitschrift für Bergbau, Hüttenwesen und verwandteWissenschaften, 13 (1), pp. 371–377, 1961.

I would like to have it with the pages number after the date, so this way :

Baumgärtel Hans, « Julius Weisbach und die Einführung der neuen Markscheidekunst in die Praxis », Zeitschrift für Bergbau, Hüttenwesen und verwandteWissenschaften, 13 (1), 1961, pp. 371–377.

Here's the function, i've tried to work on it, but I really dont understand how it works :

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check
  author format.key output new.block
  format.title quote "title" output.check
  new.block
  crossref missing$
    { journal emphasize "journal" output.check
      eid empty$

    { format.vol.num.pages output } %
    { format.vol.num.eid output }
  if$
  format.date "year" output.check
}
{ format.article.crossref output.nonnull

  eid empty$
    { format.pages output }
    { format.eid output }
  if$
}
  if$
  format.issn output
  format.doi output
  format.url output
  new.block
  note output
  fin.entry
}

If you can help me, thanks very much in advance …
Thomas

List of all used packages :

\usepackage{appendix} \usepackage{bredele} % Appel de bredele.sty %\usepackage[sectionbib]{natbib} %\usepackage{bibtopics} \usepackage[round]{natbib} \usepackage{amsmath} \usepackage[nodisplayskipstretch]{setspace} % pour virer les espaces dans les environnements equation et alig\usepackage{etoolbox} % it\usepackage{array} \usepackage[bottom]{footmisc} % pour coller les notes en bas de page \usepackage{array} % pour centrer verticalement dans les tableaux \usepackage{multirow}

\usepackage[T1]{fontenc} % un peu superflu, pour tenter d'améliorer l'hyphenation 
\usepackage{lmodern} % un peu superflu, pour tenter d'améliorer l'hyphenation 
\usepackage{index} % pour l'index 
\usepackage{splitidx} % REMPLACE 
\usepackage{multind}  %
\usepackage[T1]{fontenc} % NEW %
\usepackage[utf8]{inputenc} % NEW 
\usepackage{colortbl}% pour les lignes en gris %
\usepackage{etoolbox} % pour utiliser \BeforeBeginEnvironment 
\usepackage{french}[babel] 
\usepackage{array} 
\usepackage{lscape} 
\usepackage[table]{xcolor} % mettre des cases de tableau en couleur %\usepackage{hyperref} % met des liens %
\usepackage{appendix} 
\usepackage{chngcntr} 
\usepackage[compact]{titlesec} 
\usepackage{tikz} % pour des diagrammes simples 
\usepackage[strict]{changepage} % pour mettre de grandes marges sur les pages d'annexes \usepackage{enumitem} \setlist{nolistsep} 
\usepackage{framed} % pour mettre des textes dans des boites

Best Answer

Save the orignal file abbrvnat.bst in your working directory and rename it to eg. mod-abbrvnat.bst

Now you have to modify two functions: format.vol.num.pages and article:

Here the modifications:

  • line 535

    FUNCTION {format.vol.num.pages}
    { volume field.or.null
      number empty$
        'skip$
        { "\penalty0 (" number * ")" * *
          volume empty$
            { "there's a number but no volume in " cite$ * warning$ }
            'skip$
          if$
        }
      if$
      format.date "year" output.check %<-new
      pages empty$
        'skip$
        { duplicate$ empty$
            { pop$ format.pages }
            { ", \penalty0 " * pages n.dashify * }%<-comma new, old :
          if$
        }
      if$
    }
    
  • line 700

    FUNCTION {article}
    { output.bibitem
      format.authors "author" output.check
      author format.key output
      new.block
      format.title "title" output.check
      new.block
      crossref missing$
        { journal emphasize "journal" output.check
          eid empty$
            { format.vol.num.pages output }
            { format.vol.num.eid output }
          if$
    %      format.date "year" output.check%<commented
        }
        { format.article.crossref output.nonnull
          eid empty$
            { format.pages output }
            { format.eid output }
          if$
        }
      if$
      format.issn output
      format.doi output
      format.url output
      new.block
      note output
      fin.entry
    }
    

After this modification the following mwe provides:

\documentclass [12pt,a4]{book}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Baumgaertel,
 title={Julius Weisbach und die Einführung der neuen Markscheidekunst in die Praxis},
 author={Baumgärtel, Hans},
 journal="Zeitschrift für Bergbau, Hüttenwesen und verwandteWissenschaften",
 volume={13},
 number={1},
 pages={pp~371 -- 377},
 year={1961} 
}
\end{filecontents}
\begin{document}
\cite{Baumgaertel}

\bibliographystyle{mod-abbrvnat}
\bibliography{\jobname}

\end{document}

enter image description here

Please note that more modifications are needed for other cases. I recommend the usage of biblatex.

Related Question