Re: listings-package - Comment-delimiters in different font than comment-text

Actually I wanted to get the comment-delimiters written in a
different font than the comment-text - like in the single-line-
comments.

In the listings-package you can specify the formatting of all
comments via the "commentstyle"-key and the formatting of special
kinds of comments via some optional argument which can be passed
with the value of the "morecomments"-key.

I *think* I found---after reading in the listings-developers-
guide---a solution for modifying those comments which get their
formatting from the "commentstyle"-key:

Locally redefine within the AtBeginComment-hook the macros
\lst@DelimOpen and \lst@DelimClose which actually print the
delimiter.

I've introduced another key whose name is "commenttextstyle".
If you don't specify it or specify it equal to "commentstyle",
both comment-text and comment-delimiters will be formatted
as specified in "commentstyle". Otherwise comment-text will
be formatted according to what is given in "commenttextstyle"
and comment-delimiters will be formatted according to what is
given in "commentstyle".

All this does not apply to comments which get their formatting
provided through the "morecomments"-key.

I give no warranties of any kind as this was the first time that
I took a closer look at the internals of the listings-package.
Also this is not extensively tested.

Ulrich

\documentclass{article}
\usepackage{listings}

\begin{filecontents*}{mylisting.txt}
aA/ A single comment-line.
bB/ A comment spanning multiple comment-lines.
The comment-delimiters are not nestable.
The comment-delimiters are not nestable. /Bb
cC/ A comment spanning multiple comment-lines.
cC/ The comment-delimiters are nestable.
cC/ More nesting. /Cc /Cc
/Cc
dD/ A comment spanning one line.
dD/ Not a comment spanning one line.
\end{filecontents*}

Relevant Pages

Re: find and replace... is still note finding words in my footnotes.... then specify the text or formatting in the Find what box. ...Specify the formatting correctly. ... through only the main document (not headers (header and footer: ...(microsoft.public.word.docmanagement)

Re: find and replace... case it will go through all the footnotes and then stop, ... > then specify the text or formatting in the Find what box. ...Microsoft Word displays the comment in a balloon in the ...(microsoft.public.word.docmanagement)

Re: K&R2 ex 1-8... Which you should specify in the body, ... > int c,n1,n2,n3; ... complain about unused parameters.... The formatting is purely a matter of style. ...(comp.lang.c)

Re: find and replace... things would find words in the main body and footnotes.... >> then specify the text or formatting in the Find what box. ... A footer appears at the bottom of every page. ...(microsoft.public.word.docmanagement)

Re: word document recover... You should be able to at least get the unformatted text, if you specify... With luck, the text including the formatting might ...Regards,...(microsoft.public.word.docmanagement)