I would like to add a little code block in line with paragraph text. For example:
In order to do this just run the [code block] command in your terminal.
Can anybody help?
The minted package offers you \mintinline; since it uses Pygments, its highlighting quality is superb:
\documentclass{article}
\usepackage{minted}
\begin{document}
You can use \mintinline{python}{def boring(args = None):} and some more text.
\end{document}
The listings package provides a command for inline code snippets:
\documentclass{article}
\usepackage{listings}
\lstset{language = C++}
\begin{document}
In order to do this just run the
\lstinline!#include <iostream>! command
command in your terminal.
\end{document}
Instead of the exclamation mark you could use any character as delimiter, as long as it does not appear in the code snippet.
def boring(args=None)according to PEP8. – magu_ Aug 10 '15 at 21:26