[Tex/LaTex] How to prevent verbatim from generating linebreak

line-breakingverbatim

I tried:

\begin{verbatim} is_terminating() \end{verbatim} function can be implemented as follows:

But the text after verbatim section will be printed in a next line, is there a way to prevent this happen? Thank you.

Best Answer

Consider using inline verbatim: \verb|is_terminating()|. For some discussion on the different verbatim environments, read this.

The listings package also provides a form of inline verbatim through its inline code macro \lstinline. It works uses the same interface as inline verbatim with delimiters defining the inline code range: \lstinline!is_terminating()!.