# Insert a function by “Verbatim”, but not start a new line

I want to insert a function using verbatim so that my code looks like in a good way (different than regular text). When I insert a function, I always start a new line. Could I insert the function just followed my text by not starting a new line? Thank you. PS: I want put the text "We call the function below via" and the function "tran.prob(N=5, q=0.5)" in the same line.

Here is my code:

We call the function below via
\begin{verbatim}
tran.prob(N=5, q=0.5)
\end{verbatim}

• Use \verb|tran.prob(N=5, q=0.5)| – Clément Feb 4 '15 at 20:41
• I would even say: Welcome to TeX.SX! ! – Clément Feb 4 '15 at 20:50
• If you need the verbatim "conditioned" in any way (color, size, shape, etc.) other than what \verb|tran.prob(N=5, q=0.5)| yields, let me know. There are other options for more fancy verbatim forms. – Steven B. Segletes Feb 4 '15 at 21:27

Just use \verb|tran.prob(N=5, q=0.5)|.
\documentclass{article}

• Or simply \texttt – egreg Feb 4 '15 at 20:45
• Yes, but \texttt would not work if the function was called tran%prob: File ended while scanning use of \texttt . – Clément Feb 4 '15 at 20:48
• I had no doubt that you knew that :-) – Clément Feb 4 '15 at 20:52