1

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

4
  • 1
    Welcome to TeX.SE. natbib is primarily a citation management package. The formatting of bibliographic entries is not governed by natbib, but by the bibliography style that's in use. Curiously, the particular output you're showing in the screenshot does not look anything like what's generally known to be produced by the unsrtnat style. Do you maybe have more than one \bibliographystyle instruction in your document?
    – Mico
    Commented Sep 22, 2020 at 17:52
  • 1
    Just on the off chance that the version of the unsrtnat.bst file that's on your system somehow got corrupted, please perform the following diagnostic check: Download the file https://www.ctan.org/tex-archive/macros/latex/contrib/natbib/unsrtnat.bst from the CTAN, copy it to the directory that contains your main tex file (and sample.bib too, presumably), and perform a full recompilation cycle: LaTeX, BibTeX, and LaTeX twice more. Does the odd-ball formatting of the bibliographic entries persist?
    – Mico
    Commented Sep 22, 2020 at 17:58
  • @Mico Thank you for your anser, I tried using the bst files from ctan (and did a full recompilation) but unfortunately it did not change. I updated the question with the cls file I'm using, probably it can provide us more info about the issue. Commented Sep 23, 2020 at 9:29
  • 1
    Update: Removing the openbib option in the cls file solved the issue Commented Sep 23, 2020 at 9:33

1 Answer 1

1

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.

1
  • Thank you, this was the issue, I uploaded the cls file I'm using, It was setting somewhere openbib. removing it solved the problem. Commented Sep 23, 2020 at 9:33

You must log in to answer this question.

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