NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Neither listings (which I already tried) nor minted seem to apply in this case. I tried newfloat, but unfortunately the document doesn't compile if add the package command. As for floatrow its manual has over 100 pages and so far I haven't found an example where the float element prefix is changed.
luis wrote:[…] I don't know where they fail, but I couldn't find examples where these packages are used to substitute a table caption prefix. […]
Of course they don't alter table captions. They offer new environments that are labeled as listings. At the moment I can't comprehend why you insist on altering the table caption prefix. Obviously you need something that you can label as listing. So it would be much smarter to create a new floating object or use a package that allows you to typeset listings. The corresponding tools have been mentioned. Perhaps you can elaborate what you want to put into the {table} environment and then label as a listing. Then it would be much easier to suggest a possible solution.
luis wrote:[…] Section 4 of the manual I have focus on new float types, not on captions. […]
The package allows to create a new float that you can label according to your needs. And Section 4 describes how to get one that is labeled e.g. as listing.
localghost wrote:At the moment I can't comprehend why you insist on altering the table caption prefix. Obviously you need something that you can label as listing. So it would be much smarter to create a new floating object or use a package that allows you to typeset listings.
And I don't understand why you insist on me doing something different from what I initially presented. Again, the use case is very simple: I have a {tabular} environment inside a {table} and I need to change its caption prefix from "Table" to "Listing". I do not want to change the contents of the floating environment, I just want to change the caption.
Regarding the newfloat package I have no idea why is it missing, I regularly run the updates on this system.
On defining a new floating environment, while I am able to change the prefix with floatrow, the caption is wrongly placed and seems to miss some of the presets of the {table} environment. Again, I'd say this way is not what I need, here's a minimum example:
Reading the floatrow manual the only example that seems to exactly fit the use case I'm presenting is using \captionsetup. Unfortunately this produces no effect, here's the example:
If someone can tell me why \captionsetup isn't working that would be great. Otherwise, using a new floating environment, if it is possible, things must be a bit more refined than what is shown in the manual.
luis wrote:And I don't understand why you insist on me doing something different from what I initially presented.
Because what localghost suggests is the "natural" way. The floating environments {figure}, {table}, ..., have distinct names, counters, and lists, so if someone needs "listing"s, the choice of creating a new (floating) environment is self-evident while the choice of abusing an existing one is not.
Again, the use case is very simple: I have a {tabular} environment inside a {table} and I need to change its caption prefix from "Table" to "Listing". I do not want to change the contents of the floating environment, I just want to change the caption.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p