TransWikia.com

Remove newlines between Authors, title and journal in bibliography using natbib

TeX - LaTeX Asked by Steeven Villa on April 28, 2021

recently I had to change the layout of my document, and the new layout uses natbib. The issue that natbib is adding a line break between author’s name, title and journal name.

I’m not changing any parameter or redefining anything in the document so I wonder where can be the problem.

usepackage[authoryear]{natbib}
bibliographystyle{unsrtnat}
setcitestyle{authoryear,open={(},close={)}}
bibliography{sample}

I want to have each entry in one line (not all the bibliography in one line):
example:

Yuanhang Wang, Chao Deng, Jun Wu, Yingchun Wang, and Yao Xiong. A corrective maintenance scheme for engineering equipment. Engineering Failure Analysis, 36:269–283, 2014.

Richard C Dorf and Robert H Bishop. Modern control systems. Pearson, 2011.

and not:

Yuanhang Wang, Chao Deng, Jun Wu, Yingchun Wang, and Yao Xiong.
A corrective maintenance scheme for engineering equipment.
Engineering Failure Analysis, 36:269–283, 2014.

Richard C Dorf and Robert H Bishop.
Modern control systems.
Pearson, 2011.

But this is what I’m getting:

enter image description here

Thanks in advance.

Update:
This is the cls file the journal provided me: IWCOMP.cls

One Answer

I can reproduce the output with the openbib option.

begin{filecontents*}{jobname.bib}
@article{wang-et-al2014,
  author={{Yuanhang Wang} and {Chao Deng} and {Jun Wu} and {Yingchun Wang} and {Yao Xiong}},
  title={A corrective maintenance scheme for engineering equipment},
  journal={Engineering Failure Analysis},
  volume={36},
  pages={269–283},
  year=2014,
}
@book{dorf-bishop2011,
  author={Richard C. Dorf and Robert H. Bishop},
  title={Modern control systems},
  publisher={Pearson},
  year=2011,
}
end{filecontents*}

documentclass[openbib]{article}
usepackage[authoryear]{natbib}

begin{document}

cite{wang-et-al2014}, cite{dorf-bishop2011}

bibliographystyle{unsrtnat}
setcitestyle{authoryear,open={(},close={)}}
bibliography{jobname}

end{document}

enter image description here

Check that your document class doesn't set the option.

Correct answer by egreg on April 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP