1

I am using the listings package.

According to the manual, this setting will put in the appropriate format the code between /*+ and */ and between /*- and */.

\lstset{
  morecomment=[s][\color{blue}]{/*+}{*/},
  morecomment=[s][\color{red}]{/*-}{*/}
}

The strings /*+, /*-, */ will still appear, which is desirable sometimes.

How can I do remove the delimiters from the rendered code? (I don't want the delimiter strings to be echoed in the listings).

alfC
  • 14,350
  • I'm pretty sure you just say [is] instead of [s]. The i stands for invisible. – Hood Chatham Aug 22 '18 at 21:20
  • 1
    @HoodChatham, thanks but from my quick test it looks like i makes the whole content disappear. – alfC Aug 22 '18 at 21:22
  • I think I found it \lstset{moredelim=[is][\ttfamily]{|}{|}} – alfC Aug 22 '18 at 21:24
  • Also, I was trying to use close parenthesis in my code which triggered a bug in listings https://tex.stackexchange.com/a/74856/1871 – alfC Aug 22 '18 at 22:19
  • 2
    From the comments it seems that you have solved your initial problem but now have a different question. Could you please edit you post so that it is clear what question you are asking and rather than posting snippets can you give a full minimal working example as this makes it much easier for people to answer your question. –  Aug 23 '18 at 01:21
  • 4
    I'm voting to close this question as off-topic because the asker already seems to have found a solution – siracusa Oct 20 '18 at 01:19

0 Answers0