# How to prevent verbatim from generating linebreak?

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.

-
Do you know of \verb|is_terminating()| for inline verbatim? –  Werner Jul 20 '11 at 21:52
@Werner Grundlingh: Thank you sir! That's exactly what I want. –  Chan Jul 20 '11 at 22:03

## 2 Answers

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()!.

-
Thanks again ;) –  Chan Jul 20 '11 at 22:04

Use the \verb command instead. The first character after \verb acts as delimiter, "such that all text up to the next occurence of that character is printed literally. This character may not appear in the literal text, obviously." (Kopka and Daly, Guide to LaTeX)

\verb|is_terminating()| function can be implemented as follows:

-
Thanks a lot ;) –  Chan Jul 20 '11 at 22:03