TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the package dtsyntax to highlight code text based on listings. For in-line annotation they make a new command \modelica{ } based on lstinline as follows :


But when i use this as follows

this is a test concerning highlighting \modelica{"modelica"} in LaTeX ...

I get the following error which i can not trace back :

Package Listings Error: lstinline ended by EOL.

can anyone help me with this ?

share|improve this question
whereas '\modelica{modelica}' works fine, so the problem seems to concern the use of ' " ' ... – ruben baetens Aug 4 '11 at 12:44
up vote 1 down vote accepted

If you only have the one language in your document, you could add the following to your preamble:

\lstset{basicstyle=\ttfamily, language=modelica}

And then you can just write |"modelica"| and that should work. (I haven't tested this because I don't have dtsyntax)

The \lstset macro sets up global formatting options for all instances of \lstinline and lstlistings and similar environments. The \lstMakeShortVerb is optional, and allows you to specify a symbol that can be quickly used to enclose text to be "lstinlined".

The "ended by EOL" error suggests that the problem has something to do with linebreaks, but if the code is as you say it is, and if removing the " makes things work, then I am stumped...

share|improve this answer
it indeed (only) depends on " which defines the look of the text as this denotes a string in the code, if i put something in front it and behind it as a "test";, it also works perfectly fine ... – ruben baetens Aug 4 '11 at 13:23
That is odd. And might have something to do with " sometimes being active. (I'm out of my depth here, we'll have to wait for someone smarter to answer this one, I'm afraid...) – Seamus Aug 4 '11 at 13:33
@ruben: It'd be better to wait for a minimal working example (MWE). – Andrey Vihrov Aug 4 '11 at 13:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.