3

I'd like to write this sentence with a method in LaTeX:

"if you want to use Math.round method" and having Math.round in verbatim style. But if I write the code like this:

if you want to use \begin{verbatim}Math.round\end{verbatim} method the sentence is messed up. How can I do it? Thanks.

1

2 Answers 2

5

Inline verbatim is \verb but here you just want to select a monospace font so:

\texttt{Math.round}
2

To be clear, both \verb and texttt will present things in a monospace font.

The difference is that the \verb construct will not execute whatever code you have in there. If you include code that you want to display in a \texttt construct, it will execute the code, rather than display it. So which one you use will depend on whether or not that code will execute.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .