I want to write clean underscores without backslashes and hyphenate words by underscores.

I tried to use underscore package, but it doesn't work with clean underscores and also breaks includegraphics, when there are underscores in picture name.




        \begin{tabular}{ | m{3cm}| } 
            SOME\_LONG\_COMMAND  \\\hline
            SOME\_LONG \_COMMAND  \\\hline                  % looks as I want, but stiil have backslashes before underscore
            \detokenize{SOME_LONG_COMMAND}  \\\hline



I'm not sure I fully understand your requirements, but I think you need to set up a pair of switches to change the catcode of the underscore (just as \makeatletter and makeatother do for @).



enter image description here

Note that you need to load fontenc or else you will get strange effects, related to the fact that the original TeX fonts have no underscore glyph (they used a short rule in its place).

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.