Newsgroups: comp.text.tex
> Second, about the place it put the caption. The "listings" package > chooses to put the caption on top. But I see many book and articles > put the caption at the bottom. Besides, my table and figure captains > are at the bottom. Which place is considered the appropriate place > nowadays? And most important, how can I make the change accordingly?
(Did not test this) You can use the variable "captionpos" to set the listings top or bottom. ("t" for top, and "b" for bottom). So, \lstsett of \lstsetb.
> Third, about the name it use. The "listings" package chooses > "Listing ###" as its name. Is it possible to use it back to "Table > ###" and incorporate with the table numbering that I already have?
This is how you can change "Listing" into "Table":
To incorporate the table numbering, I am not sure: \renewcommand{thelstlisting}{thetable} does not work! It gives the listing the last table number, but does not increment it when the next listing is inserted. You can of course increment \thelstlisting and \thetable but there should be a much better way to do this.
Kris Luyten
> > "Listing ###" as its name. Is it possible to use it back to "Table > > >To incorporate the table numbering, I am not sure: >\renewcommand{\thelstlisting}{\thetable} does not work!
This is not sufficient, because \the… is just the name to *output* the value. Since you want to use internally the same counter, I guess you have to hack either listing or table to use the corresponding counter.
Maybe the following simple hack works for you (I have not tested it; but since nobody else replied…)
\makeatletter \let\c@lstlisting\c@table \makeatother
This makes the internal counter for "\thelstlisting" be the same as that of "\thetable". However, even if this works, this hack may give you undesired side effects. For example, if only *one* of the counters is reset with another counter (perhaps in certain classes when the chapter number is increased), then also the `joined' counter is reset.
Martin Vaeth