[texhax] Trying to find if a listing is continued with listings package

Adrian F. Clark alien at essex.ac.uk
Tue Dec 15 11:35:21 CET 2015


Hello,

I'm trying to do something literate with listings.sty.  I'm using 
\lstnewenvironment to define a new environment which receives a name as 
an argument, which is passed on via "\lstset{name=}".  I would like to 
do something slightly different in a continued listing of the name and 
the first time it appears.  I have tried things along the lines of

\expandafter
\ifx
   \csname \@lst @SaveFirstNumber\endcsname
   \undefined
   it's a new listing
\else
   it's a continued listing
\fi

but none of my attempts have worked.  Can anyone point me in the right 
direction?  I've attached a minimal example.

..Adrian
-- 
Dr Adrian F Clark, M0PDF      WEB: http://privatewww.essex.ac.uk/~alien/
EMAIL: alien/at/essex.ac.uk   TEL: +44 1206 872432  FAX: +44 1206 872900
PAPER: Comp Sci & Elec Eng, University of Essex, Colchester, CO4 3SQ, UK
"The great tragedy of science:  the slaying of a beautiful hypothesis by
  an ugly fact"  --  Huxley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: listings-try.tex
Type: application/x-tex
Size: 818 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20151215/122779b3/attachment.tex>


More information about the texhax mailing list