LaTeX forum ⇒ BibTeX, biblatex and bibercomma in page numbers Topic is solved

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
liuzr88
Posts: 2
Joined: Fri Apr 04, 2014 8:02 pm

comma in page numbers

Postby liuzr88 » Sat Apr 05, 2014 4:45 am

Hi, in my bibtex library, I have some references that don't have numerical pages numbers, e.g. like L03803'. When the latex file is processed, the page number in bibliography entry is formatted 'L03,803'. Obviously the comma is automatically added. I am not able to find how to turn this feature off. Any suggestions to fix this will be much appreciated!

I am using the most recent version of TexShop on Mac, and BibDesk to manage my library.

User avatar
Johannes_B
Site Moderator
Posts: 3582
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Apr 05, 2014 8:36 am

It is much more important for us to know how you implement the bibliography into your document. The best way to show us would be a Minimal working example (<- you can click the link). It might take a few minutes, but it is worth it.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

liuzr88
Posts: 2
Joined: Fri Apr 04, 2014 8:02 pm

Postby liuzr88 » Mon Apr 07, 2014 5:05 pm

Here is my Latex file:

  1. \documentclass[11pt]{article}
  2. \usepackage[square]{natbib}
  3.  
  4. \begin{document}
  5. \title {Article Title}
  6. \make title
  7. \cite{Ward2005}
  8. \bibliographystyle{agu08} % this specify the style of references
  9. \bibliography{test} % this specify where is the bibtex file
  10. \end{document}


It uses the test.bib file as following:

  1. @article{Ward2005,
  2. Author = {Ward, William E. and Fomichev, Victor I. and Beagley, Stephen},
  3. Journal = {Geophys. Res. Lett.},
  4. Pages = {L03803},
  5. Title = {Nonmigrating tides in equinox temperature fields from the Extended Canadian Middle Atmosphere Model.},
  6. Volume = {32},
  7. Year = {2005}}


In the output, the page number part L03803 becomes L03,803

I am not sure this is related to the agu08.bst file or it's a setting the BibTex. The agu08.bst is attached. I also tried to go through this agu08.bst file to find possible clue but was not successful. Thanks for the help!
Attachments
agu08.bst
agu08.bst
(42.09 KiB) Downloaded 110 times

beridel
Posts: 1
Joined: Mon Jul 28, 2014 10:11 am

Postby beridel » Mon Jul 28, 2014 10:41 am

Hi, I have the same issue. I've attached a .tar that includes everything you need to create the problem.

Thanks in advance for any help you can provide.
Attachments
bib_pb.tar
(47.5 KiB) Downloaded 109 times

User avatar
Johannes_B
Site Moderator
Posts: 3582
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Jul 28, 2014 11:01 am

If biblatex/biber is an option, use it.
  1. \begin{filecontents}{\jobname.bib}
  2. @article{Kostoglodov:2010ht,
  3. author = {Kostoglodov, Vladimir and Husker, Allen L and Shapiro, Nikola{\"\i} M and Payero, Juan S and Campillo, Michel and Cotte, Nathalie and Clayton, Robert W},
  4. title = {{The 2006 slow slip event and nonvolcanic tremor in the Mexican subduction zone}},
  5. journal = {Geophys. Res. Lett.},
  6. year = {2010},
  7. volume = {37},
  8. number = {24},
  9. pages = {{L24301}},
  10. doi = {10.1029/2010GL045424},
  11. rating = {0},
  12. date-added = {2014-01-20T07:22:06GMT},
  13. date-modified = {2014-05-23T15:30:19GMT},
  14. url = {http://www.agu.org/journals/gl/gl1024/2010GL045424/2010gl045424-fs02b.eps},
  15. local-url = {file://localhost/Users/beridel/Documents/Articles/2010/Kostoglodov/2010_Kostoglodov_Geophys._Res._Lett-1.pdf},
  16. file = {{2010_Kostoglodov_Geophys._Res._Lett-1.pdf:/Users/beridel/Documents/Articles/2010/Kostoglodov/2010_Kostoglodov_Geophys._Res._Lett-1.pdf:application/pdf}},
  17. uri = {\url{papers2://publication/doi/10.1029/2010GL045424}}
  18. }
  19. \end{filecontents}
  20. \documentclass{article}
  21. \usepackage[style=authoryear,natbib]{biblatex}
  22. \addbibresource{\jobname.bib}
  23.  
  24. \begin{document}
  25. This is a citation \citep{Kostoglodov:2010ht}.
  26. \printbibliography
  27. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

ErahsMuhs
Posts: 1
Joined: Wed Apr 27, 2016 12:04 pm

Postby ErahsMuhs » Wed Apr 27, 2016 12:09 pm

If this is still relevant for anybody: I found a solution.

Open the .bsp file and search for a function like this:

FUNCTION {format.journal.pages}
{ pages duplicate$ empty$ 'pop$
{ swap$ duplicate$ empty$
{ pop$ pop$ format.pages }
{
", " *
swap$
n.dashify
"pages" bibinfo.check
*
}
if$
}
if$



change this to:

FUNCTION {format.journal.pages}
{ pages duplicate$ empty$ 'pop$
{ swap$ duplicate$ empty$
{ pop$ pop$ format.pages }
{
", " *
swap$
%n.dashify
"pages" bibinfo.check
*
}
if$
}
if$

frankenschulz
Posts: 1
Joined: Wed Oct 18, 2017 11:05 am

Postby frankenschulz » Wed Oct 18, 2017 11:17 am

It's actually the function n.separate in n.dashify!

I had the same problem with Springer styles and found that neither current RevTeX nor AASTeX styles are calling n.separate in n.dashify. So, you just need to remove this:

  1. FUNCTION {n.dashify}
  2. {
  3. % n.separate
  4. 't :=
  5. ""
  6. { t empty$ not }
  7. { t #1 #1 substring$ "-" =
  8. { t #1 #2 substring$ "--" = not
  9. { "--" *
  10. t #2 global.max$ substring$ 't :=
  11. }
  12. { { t #1 #1 substring$ "-" = }
  13. { "-" *
  14. t #2 global.max$ substring$ 't :=
  15. }
  16. while$
  17. }
  18. if$
  19. }
  20. { t #1 #1 substring$ *
  21. t #2 global.max$ substring$ 't :=
  22. }
  23. if$
  24. }
  25. while$
  26. }


Return to “BibTeX, biblatex and biber”

Who is online

Users browsing this forum: No registered users and 3 guests