0

I am able to compile perfectly, and the PDF output is nice. But editing-wise, it gets annoying that Texmaker colours everything after \lstinline as if it is a listing. Any quick fix for this?

Here is a quick example:

\documentclass[11pt,a4paper]{article}
\usepackage{listings}
\begin{document}

Hello, \lstinline{world}. This is now colored as if I were still writing inside of a listing. 

\end{document}
2

I have found a quick fix, which is not the best, but it can work until there is something more elegant.

Adding this before \begin{document}, and before any call to \lstinline (now \lil):

\newcommand{\lil}[1]{\lstinline{#1}}
\newcommand{\dummycommand}{\end{lstlisting}}

Basically, next line is just a useless command, but when Texmaker reads \end{lstlisting}, it will stop highlighting everything as a listing.

So now, instead of using \lstinline, \lil is used to avoid the issue.

| improve this answer | |

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.