"Listings" writing in my Table Of Contents

49 views
Skip to first unread message

maiVassallo

unread,
Apr 25, 2006, 6:57:37 PM4/25/06
to LaTeX Users Group
Hi all,

I used the "listings" package to insert some pieces of source code in
my latex document...

Tex automatically creates for me a Table Of Contents with the index of
all listings, but it places the writing "Listings" at the top of it.
What do I have to do to change this title? for example I want the TOC
to be:

Source Code <--- I want to write this!

1.1 Code number one . . . . . 23
1.3 Code numenr two . . . . .34
1.4 Code number three . . . .45

instead of:

Listings <-- created by default

1.1 Code number one . . . . .23
1.3 Code numenr two . . . . .34
1.4 Code number three . . . .45

I want to do the same with the captions of the listings:

I want the caption to be: "Code 3.1" insetad of "Listing 3.1"

thank you all!

mv

Ted Pavlic

unread,
Apr 29, 2006, 10:24:12 AM4/29/06
to LaTeX Users Group
Take a look at the listings manual:

http://www.math.ntnu.no/~berland/latex/docs/listings.pdf

Look in section 4.9 (Captions). I think the two macros you want to
change are:

\lstlistlistingname

\lstlistingname

Try doing something like:

\renewcommand{\lstlistlistingname}{Source Code}
\renewcommand{\lstlistingname}{Code}

I'm not endorsing this idea though. I think it's probably better if you
kept the defaults.

Reply all
Reply to author
Forward
0 new messages