I am writing a document that has a two page limit. I am trying to find a way to make it so that each citation in the bibliography does not start on a new line. This would be sufficient to fit into my page limit.

I am using natbib and bibtex with the "super" (nature-style) citation option. I tried a version of the solution presented in

One paragraph style bibliography

to get this behavior. It works fine when used with author-year style citations, but produces awkward indentation when used with the super (numeric) option (see non-uniform spacing between entries below):

enter image description here

Does anyone know how to configure things so that the entries in the bibliography look flush like this:

enter image description here

but with the dots replaced by the numbers used to refer to each reference in the text?



I invoke natbib with:


Then call:




And here is the style file:


NB that this is a slightly modified version of https://github.com/keflavich/tex_compact_bib. I deleted the "SORT" commands from the original bst file to get the citations to appear non-alphabetically.

  • Please provide us the complete source code which does not produce your intended results. That gives us more time to experiment and find the solution for you rather than typing all the codes from scratch. And welcome to TeX.SE.
    – Masroor
    Commented Mar 7, 2018 at 6:05
  • I just edited it. Hopefully that clarifies things... Commented Mar 7, 2018 at 15:22
  • Thanks for asking this; I've updated tex_compact_bib with the solution suggested below: github.com/keflavich/tex_compact_bib/commit/…
    – keflavich
    Commented Apr 19, 2022 at 19:31

1 Answer 1


Solution in Brief

The \hfil in the arguments of \items which actually render the bibitems is responsible for the horizontal white spaces.

Rendering of bibitems is done by the \@lbibitem command. So, we need to redefine it. One way for this will be to use \renewcommand. But definitely, a smarter way will be to use \patchcmd.


The Full Code









    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
        [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004"

    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"

  title={Detection of a branched alkyl molecule in the interstellar medium: iso-propyl cyanide},
  author={Belloche, Arnaud and Garrod, Robin T and M{\"u}ller, Holger SP and Menten, Karl M},
  publisher={American Association for the Advancement of Science}

  title={Is anxiety sensitivity distinguishable from trait anxiety? Reply to Lilienfeld, Jacob, and Turner (1989).},
  author={McNally, Richard J},
  publisher={American Psychological Association}





% \show\bibitem

% \makeatletter
% \show\@lbibitem
% \makeatother


The Output

enter image description here

The Sleuthing Activity

An inspection of the .bbl file shows that each bibliographic entry is rendered by a \bibitem.

So, we issue a \show\bibitem inside our source. This gives:

\bibitem=\long macro: ->\@ifnextchar [{\@lbibitem }{\@lbibitem []}.

We delve deeper and look inside \@lbibitem.



[#1]#2->\if \relax \@extra@b@citeb \relax \else \@ifundefined {br@#2\@extra@b@c
iteb }{}{\@namedef {br@#2}{\@nameuse {br@#2\@extra@b@citeb }}}\fi \@ifundefined
 {b@#2\@extra@b@citeb }{\def \NAT@num {}}{\NAT@parse {#2}}\def \NAT@tmp {#1}\ex
pandafter \let \expandafter \bibitemOpen \csname NAT@b@open@#2\endcsname \expan
dafter \let \expandafter \bibitemShut \csname NAT@b@shut@#2\endcsname \@ifnum {
\NAT@merge >\@ne }{\NAT@bibitem@first@sw {\@firstoftwo }{\@ifundefined {NAT@b*@
#2}{\@firstoftwo }{\expandafter \def \expandafter \NAT@num \expandafter {\the \
c@NAT@ctr }\@secondoftwo }}}{\@firstoftwo }{\global \advance \c@NAT@ctr \@ne \@
ifx {\NAT@tmp \@empty }{\@firstoftwo }{\@secondoftwo }{\expandafter \def \expan
dafter \NAT@num \expandafter {\the \c@NAT@ctr }\global \NAT@stdbsttrue }{}\bibi
tem@fin \item [\hfil \NAT@anchor {#2}{\NAT@num }]\global \let \NAT@bibitem@firs
t@sw \@secondoftwo \NAT@bibitem@init }{\NAT@anchor {#2}{}\NAT@bibitem@cont \bib
item@fin }\@ifx {\NAT@tmp \@empty }{\NAT@wrout {\the \c@NAT@ctr }{}{}{}{#2}}{\e
xpandafter \NAT@ifcmd \NAT@tmp (@)(@)\@nil {#2}}.

Which, I must say, is a mouthful and somewhat difficult to perceive. So, we open the natbib.sty file in an editor and search for \@lbibitem.

The subsequent lines show how the bibliographic entry is being rendered. The line,


raises our suspicion and tweaking with this confirms that we have hit the right point.

Further Reading

If you want to know more about \patchcmd, please take a look at this wonderful answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .