TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to insert some simple linux path inline with the text in my LaTeX document by using basic elements like:


..but it failed and this error below appears:

! Missing $ inserted.
<inserted text>
l.221 ...{/usr/share/myspell/dicts/hyph_pl_PL.dic}
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Extra }, or forgotten $.

I'm not sure why it appears, but for sure am not try to use math environment in this case, so what the compiler tried to explain to me.

Is there some simple workaround of this trivial problem? Some examples would be the perfect answer.

Details: using TeX Live 2013 with Texmaker 4.1.1 on Ubuntu 14.04.

share|improve this question
You just need to escape the underscores i.e. \_ rather than _. So, yes, there is a simple workaround! – cfr Apr 20 '14 at 19:20
Or you can use \detokenize: \texttt{\detokenize{/usr/share/myspell/dicts/hyph_pl_PL.dic}}. – Jubobs Apr 20 '14 at 19:38
Yeah, that's it! @Jubobs comes with great solution! Simple, but not have to change the original path. – Egel Apr 20 '14 at 19:46
up vote 13 down vote accepted

There is a command \path{/usr/share/myspell/dicts/hyph_pl_PL.dic} you can use to write paths like that.

That command is defined in the package url so you have to use \usepackage{url} in the preamble of the document.

share|improve this answer
I had never heard of \path. Thanks. – Jubobs Apr 20 '14 at 20:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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