1

I have a main document and I am using the natbib package to handle my bibtex database. Here is my bottom part of the document displaying the bibliography code

...
\backmatter
\nocite{*}
\bibliographystyle{plainnat}
\bibliography{mybiblifile}
\end{document}

This is the bottom part of my code and it seems pretty normal. When I typeset everything after several runs of BibTeX, I get this error message:

Misplaced alignment tab character &. You have placed an alignment tab character '&' in the wrong place. If you want to align something, you must write it inside an align environment such as \begin{align} … \end{align}, \begin{tabular} … \end{tabular}, etc. If you want to write an ampersand '&' in text, you must write \& instead.

Now I am opening the bibliography file mybiblifile.bib, one entry draws my attention.

@INPROCEEDINGS{frenkel_fine_2013,
title = {Fine temperature measurement and fabrication of on-chip whispering-gallery mode micro-sensors},
url = {http://proxy.library.nyu.edu/login?url=http://search.ebscohost.com/login.aspx?direct=true&db=edselc&AN=edselc.2-52.0-84901804547\&site=eds-live},
doi = {10.1115/MNHMT2013-22003},
booktitle = {{ASME} 2013 4th {International} {Conference} on {Micro}/{Nanoscale} {Heat} and {Mass} {Transfer}, {MNHMT} 2013},
publisher = {American Society of Mechanical Engineers (ASME)},
author = {Frenkel, M. and Avellan, M. and Guo, Z.},
year = {2013},
note = {Conference Proceedings}
}

I realized that it is the & characters inside the URL entry of the Bibtex that causes the problem. When I delete these characters from the URL entry, the typesetting works fine and no more error messages appear.

How do we deal with this problem?

1

You did not show us a complete MWE, showing your used documentclass and used packages. Please next time show a complete MWE, not only code snippets ...

It seems you miised to call package hyperref (this packages calls url internaly) or if you do not use hyperref you should call package url or xurl.

See the following MWE (package filecontents is only used to have bib file and tex code together in a MWE):

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@INPROCEEDINGS{frenkel_fine_2013,
  title = {Fine temperature measurement and fabrication of on-chip whispering-gallery mode micro-sensors},
  url = {http://proxy.library.nyu.edu/login?url=http://search.ebscohost.com/login.aspx?direct=true&db=edselc&AN=edselc.2-52.0-84901804547\&site=eds-live},
  doi = {10.1115/MNHMT2013-22003},
  booktitle = {{ASME} 2013 4th {International} {Conference} on {Micro}/{Nanoscale} {Heat} and {Mass} {Transfer}, {MNHMT} 2013},
  publisher = {American Society of Mechanical Engineers (ASME)},
  author = {Frenkel, M. and Avellan, M. and Guo, Z.},
  year = {2013},
  note = {Conference Proceedings}
}
\end{filecontents*}


\documentclass[10pt,a4paper]{article}

\usepackage{natbib}
%\usepackage{xurl}
\usepackage{hyperref}


\begin{document}

\nocite{*} % to test all bib entrys
\bibliographystyle{plainnat}
\bibliography{\jobname}

\end{document}

and its result without error messages:

enter image description here

If you do not like the empty space at the end of one line you can uncommment line

\usepackage{xurl}

in my given MWE.

  • I was actually thinking of posting a full MWE but it's so damn long! – billyandriam Dec 12 '18 at 3:04
  • 2
    Well, that is art of creating an MWE to find out which packages you used you can leave out for the MWE. :-) – Mensch Dec 12 '18 at 3:15
  • Thank you for the advice and for your response! It really solved my issue and I will post an MWE from now on. – billyandriam Dec 12 '18 at 3:21
0

I found a very concise and helpful answer here.

In short, insert the following line in the preamble:

\usepackage[hyphens]{url}
  • Thank you for digging that information. I will check it out – billyandriam Jul 12 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.