1

I am trying to a overline a word inside a verbatim block but it does not work, for example:

\begin{verbatim}
Hwy3 =1  Hwy3   
Hooterville = 0  \overline{Hooterville}
\end{verbatim}

I have also tried \bar{} but i get the same problem. Anyone has a solution please?

  • You can never do any (simple?) customization to words inside \verbatim. – user156344 Apr 9 at 11:41
0

With the listings package, one can escape stuff in which latex commands should be recognised:

\documentclass{article}
\usepackage{listings}
\lstset{
    escapeinside={(*@}{@*)},   
}

\begin{document}

\begin{lstlisting}
Hwy3 =1  Hwy3   
Hooterville = 0  (*@$\overline{Hooterville}$@*)
\end{lstlisting}

\end{document}

enter image description here

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.