BibTeX, biblatex and bibercomma in page numbers

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

comma in page numbers

Post by liuzr88 »

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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

comma in page numbers

Post by Johannes_B »

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

comma in page numbers

Post by liuzr88 »

Here is my Latex file:

Code: Select all

\documentclass[11pt]{article}
\usepackage[square]{natbib}

\begin{document}
\title {Article Title}
\make title
\cite{Ward2005} 
\bibliographystyle{agu08}  % this specify the style of references
\bibliography{test}  % this specify where is the bibtex file
\end{document}
It uses the test.bib file as following:

Code: Select all

@article{Ward2005,
	Author = {Ward, William E. and Fomichev, Victor I. and Beagley, Stephen},
	Journal = {Geophys. Res. Lett.},
	Pages = {L03803},
	Title = {Nonmigrating tides in equinox temperature fields from the Extended Canadian Middle Atmosphere Model.},
	Volume = {32},
	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 429 times
beridel
Posts: 1
Joined: Mon Jul 28, 2014 10:11 am

Re: comma in page numbers

Post by beridel »

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 303 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

comma in page numbers

Post by Johannes_B »

If biblatex/biber is an option, use it.

Code: Select all

\begin{filecontents}{\jobname.bib}
@article{Kostoglodov:2010ht,
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},
title = {{The 2006 slow slip event and nonvolcanic tremor in the Mexican subduction zone}},
journal = {Geophys. Res. Lett.},
year = {2010},
volume = {37},
number = {24},
pages = {{L24301}},
doi = {10.1029/2010GL045424},
rating = {0},
date-added = {2014-01-20T07:22:06GMT},
date-modified = {2014-05-23T15:30:19GMT},
url = {http://www.agu.org/journals/gl/gl1024/2010GL045424/2010gl045424-fs02b.eps},
local-url = {file://localhost/Users/beridel/Documents/Articles/2010/Kostoglodov/2010_Kostoglodov_Geophys._Res._Lett-1.pdf},
file = {{2010_Kostoglodov_Geophys._Res._Lett-1.pdf:/Users/beridel/Documents/Articles/2010/Kostoglodov/2010_Kostoglodov_Geophys._Res._Lett-1.pdf:application/pdf}},
uri = {\url{papers2://publication/doi/10.1029/2010GL045424}}
}
\end{filecontents}
\documentclass{article}
\usepackage[style=authoryear,natbib]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
This is a citation \citep{Kostoglodov:2010ht}.
\printbibliography
\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

comma in page numbers

Post by ErahsMuhs »

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

comma in page numbers

Post by frankenschulz »

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:

[code]FUNCTION {n.dashify}
{
% n.separate
't :=
""
{ t empty$ not }
{ t #1 #1 substring$ "-" =
{ t #1 #2 substring$ "--" = not
{ "--" *
t #2 global.max$ substring$ 't :=
}
{ { t #1 #1 substring$ "-" = }
{ "-" *
t #2 global.max$ substring$ 't :=
}
while$
}
if$
}
{ t #1 #1 substring$ *
t #2 global.max$ substring$ 't :=
}
if$
}
while$
}[/code]
Post Reply