# .bib file causes build crash, url error

I have this code in my .bib file:

``````@misc{akcelerometry,
author = {Prof. Ing. Miroslav Husák, CSc.},
title = "Akcelerometry {[online]}",
type = {web page},
month = november,
year = {{2013}},
note = "[cit. 2014-03-08]"
}
``````

It crashes but when i change url for example to `http://tex.stackexchange.com/` it works good.

EDIT:

bibliography style: http://pastebin.com/9KGLbuCB csn690.bst

latex code:

``````\bibliographystyle{csn690}
\bibliography{mybibliographyfile}
``````
-
Welcome to TeX.SE! Which bibliography style do you use? –  Mico Mar 8 '14 at 17:18
I have my own csn690.bst –  SpeedEX505 Mar 8 '14 at 17:20
A link to the bib style and a minimal example of LaTeX code are necessary. –  egreg Mar 8 '14 at 17:22
check my edit I've done –  SpeedEX505 Mar 8 '14 at 17:27
Try escaping the % character: `url = {http://www.micro.feld.cvut.cz/home/X34SES/prednasky/08\%20Akcelerometry.pdf}` –  vaettchen Mar 8 '14 at 17:29

The cause of the problem is the `%` character -- which has a "special" meaning in TeX -- in the field

``````url = {http://www.micro.feld.cvut.cz/home/X34SES/prednasky/08%20Akcelerometry.pdf},
``````

"Escaping" the `%` symbol, i.e., writing it as `\%`, might at first blush seem to provide a fix. However, it introduces a new problem: A backslash character is now printed in the URL string, which makes it almost certain that your readers will be unable to find the publication online.

Rather than "escape" the `%` symbol, you should encase the entire URL string in the instruction `\url`, i.e., write the field as

``````url = "\url{http://www.micro.feld.cvut.cz/home/X34SES/prednasky/08%20Akcelerometry.pdf}",
``````

The command `\url` not only typesets its argument in a monospaced ("typewriter") font but, importantly, also suspends any TeX-special meanings of characters such as `&`, `^`, `%`, `\$`, `#`, and `~`.

You will need to load either the `url` or the `hyperref` package in the preamble of your document to activate the command `\url`.

-
Thanks, that provides me with a solution for a situation that I so far have simply accepted for my own work! –  vaettchen Mar 8 '14 at 20:02

The url command suggested by Mico did not work for me (with the url package). It resulted in my bibliography appearing with "\url{my_url_here}" (i.e. the command rewritten verbatim), instead of just "my_url_here".

I was using the IEEEtran.bst bib style, with the follow LaTeX code:

``````\bibliographystyle{IEEEtran}
\bibliography{IEEEabrv,Metrics}
``````

As an alternative solution, this worked for me; just use quotes in the .bib entry:

``````url = "my_url_here",
``````
-
For this answer to be meaningful I think you need to compare your situation to that of the original poster and to that which Mico posited. What bib style, etc? –  dgoodmaniii Jun 2 at 17:22
Good point, thanks. I was using the IEEEtran.bst bib style. Latex code: \bibliographystyle{IEEEtran} \bibliography{IEEEabrv,MyBiblio} –  davidgw Jun 4 at 8:22

Escaping the `%` character:

``````url = {http://www.micro.feld.cvut.cz/home/X34SES/prednasky/08\%20Akcelerometry.pdf}
``````

will help!

-
It will also print a backslash character in the URL string, presumably rendering it invalid. –  Mico Mar 8 '14 at 18:01