I want to write this; /camera/image_raw
, but it seems impossible to compile. The forward slash is not the issue, but as soon as I put text behind it doesn't work :(
Does anyone know a solution?
The underscore _
is a special character that TeX interprets as an instruction. (In this case, it's a subscript instruction for use in math mode.) To actually make an underscore symbol appear you need to use \_
(or \textunderscore
). For example:
\documentclass{article}
\begin{document}
/camera/image\_raw
\end{document}
Or as Bernard mentioned, you can also use the \verb
command:
\documentclass{article}
\begin{document}
\verb+/camera/image_raw+
\end{document}
However, be careful with \verb
as you can't use it in the argument of a command. (See Why doesn’t verbatim work within …?.)
If your text represents a path (which it seems to) you can also use the \path
command provided by the url
package:
\documentclass{article}
\usepackage{url}
\begin{document}
\path{/camera/image_raw}
\end{document}
/camera/image\_raw
instead. If that doesn't work you need to include a minimal working example (MWE)._
is a special character: it is used in math formulae to denote a subscript. Write:/camera/image\_raw
or \verb+/camera/image_raw+ (in the latter case it will be typeset with a teletype font).