[texhax] white space problem

Tom Schneider toms at ncifcrf.gov
Sun Jul 12 03:06:42 CEST 2009


Folks:

I've often been puzzled when bibtex objects to having white space in
between references.  It turns out that this happens for some journal
styles and not for others.  In particular, it happens with Cell:

http://www.ccrnp.ncifcrf.gov/~toms/ftp/cell.sty

I've tracked it down somewhat but need help identifying the exact
problem since I don't understand the code well.

For this latex file:

\documentclass[12pt]{article}
\newcommand{\theversion}{{version = 1.00 of cew.tex 2009 Jul 11 }}
\usepackage{celltest}
\begin{document}
\bibliographystyle{unsrt}
\cite{Schneider1986, Schneider1988, Schneider1989}.
\bibliography{all}
\end{document}

with this test style file:

% version = 1.00 of celltest.sty
% white space problem comes from this code:
\def\@citex[#1]#2{\if at filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  \def\@citea{}\@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{; }\@ifundefined
       {b@\@citeb}{{\bf ?}\@warning
       {Citation `\@citeb' on page \thepage \space undefined}}%
{\csname b@\@citeb\endcsname}}}{#1}}

I get a paper.aux:

\relax 
\bibstyle{unsrt}
\citation{Schneider1986, Schneider1988, Schneider1989}
\bibdata{all}

and bibtex objects:

This is BibTeX, Version 0.99c (Web2C 7.5.5)
The top-level auxiliary file: paper.aux
The style file: unsrt.bst
White space in argument---line 3 of file paper.aux
 : \citation{Schneider1986,
 :                          Schneider1988, Schneider1989}
I'm skipping whatever remains of this command
Database file #1: all.bib
(There was 1 error message)

But if I make the style file empty (or don't call it with usepackage)
then the paper.aux is:

\relax 
\bibstyle{unsrt}
\citation{Schneider1986}
\citation{Schneider1988}
\citation{Schneider1989}
\bibdata{all}

and bibtex is happy:

This is BibTeX, Version 0.99c (Web2C 7.5.5)
The top-level auxiliary file: paper.aux
The style file: unsrt.bst
Database file #1: all.bib

So the question is how to get the semicolon between references in the
final output (which is Cell's style) without being forced to remove
spaces in the citations?  How do I fix the celltest.sty code?

(How the chunk of style code generates the commas and space in a
different format is mysterious to me since it's not explicitly in the
code.)

Thanks!

Tom

  Dr. Thomas D. Schneider
  National Institutes of Health
  schneidt at mail.nih.gov
  toms at alum.mit.edu (permanent)
  http://alum.mit.edu/www/toms 


More information about the texhax mailing list