4

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.

  • 4
    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
5

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

3

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:

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.