I am using TexMaker as editor and in a document I want to put some inline code so I am using lstinline{}
. The command works but strangely the text of the document after the closing curly bracket is printed in the same font and colour of the text inside the bracket.
For example considering this [mcve]:
\documentclass[12pt, letterpaper]{article}
\usepackage{xcolor}
\usepackage{listings}
\usepackage{xparse}
\lstset{language=C,keywordstyle={\bfseries \color{blue}}}
\begin{document}
hey \lstinline{for} asdasda
\end{document}
The output is fine, the source text appears as follow: where as you can see the text
asdasda
and even the \end{document}
are shown as if being part of the inline code.
A partial solution to this is to do \lstinline{for}\lstinline{}
but it is really confusing and time consuming.
Does anyone have a better solution?
\lstinline+hello+