9

I'm trying to add this to my bibliography:

\bibitem{nasa}Alliance, N.P.A.R.C. Computational fluid dynamics (CFD)  verification and validation web site: http://www.grc.nasa.gov/WWW/wind/valid/lamcyl/Study1_files/Study1.html

But it says:

! Missing $ inserted.

I have written other webpages without problem, for example:

\bibitem{lorenab} Lorena A. Barba group. CFD Python: 12 steps to Navier Stokes. http://goo.gl/yVI2zk

What is happening?

moewe
  • 175,683

1 Answers1

13

the problem is the underscore in the url. it's being interpreted as an indicator for a subscript, which requires math. wrap the url with \url thus:

\url{http://www.grc.nasa.gov/WWW/wind/valid/lamcyl/Study1_files/Study1.html}

this will require a package. if you don't with to have hyperlinks, the url package will suffice.

\usepackage{url}

if you do wish to have hyperlinks, then use the hyperref package (which loads url). since this url is quite long, you may wish to allow it to be broken across lines; the breaklinks option will enable this:

\usepackage[breaklinks]{hyperref}

see the package documentation regarding the places where breaks are permitted.

the url package also has a (more complicated) line-breaking mechanism available. again, see the package documentation for details.

as reminded by @egreg, [breaklinks] works only if the output is dvi, to be converted by dvips and further converted to pdf by an additional tool.

  • 1
    Thank you very much. Just a small add-on: the hyperref package loads url internally, so there is really no need to load both. – moewe Feb 10 '16 at 14:57
  • @moewe -- thanks for that reminder. i've added it to the answer. – barbara beeton Feb 10 '16 at 15:03
  • @barbarabeeton breaklinks is only effective in latex+dvips+ps2pdf mode; with pdftex it's useless (but does no harm either). – egreg Feb 10 '16 at 15:10
  • @egreg -- i keep forgetting that (routinely use the dvips+distill method, which is more reliable when sent to the rip we use to make plates for the press). what, if anything, is a viable alternative? – barbara beeton Feb 10 '16 at 15:13
  • @barbarabeeton With pdflatex links are broken across lines; whether \url breaks or not, is another matter. – egreg Feb 10 '16 at 15:14
  • @egreg -- are links broken with xetex? – barbara beeton Feb 10 '16 at 15:18