alltt causes a line break (newline). How do i suppress this? I want something to the effect of \verb+HELLO+ in that it does what \begin{verbatim} \end{verbatim} does except doesn't cause the line to break.



 The line will break HERE: \alltt{a}

  • 2
    alltt should be used as an environment. You probably want \texttt{a}.
    – egreg
    Sep 8, 2012 at 7:53
  • Can you make a real example of usage?
    – egreg
    Sep 8, 2012 at 8:03
  • \texttt makes odd things to hyphens: tex.stackexchange.com/q/9813/81156
    – scrutari
    Jan 22, 2020 at 14:28

1 Answer 1


Package alltt defines an environemnt alltt that uses a list environment internally. Therefore it cannot be used the same way as \verb or \texttt.

The main point of package alltt is the unchanged use of \, { and }. The following macro \textalltt sets verbatim catcodes for its argument except for the three characters.



Verbatim text: \textalltt{Hello \textbf{\textsl{world}}}.


You must log in to answer this question.