Hello everyone, thank you for the replies.
First on this comment:
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:
Code: Select all
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{floatrow}
\DeclareNewFloatType{mylist}%
{name=Listing}
\begin{document}
\begin{mylist}
\caption{The caption}
\begin{center}
\begin{tabular}{| r | r |}
\hline
This is & a table. \\
\hline
\end{tabular}
\end{center}
\end{mylist}
\end{document}
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:
Code: Select all
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{floatrow}
\begin{document}
\captionsetup[table]{name=Listing}
\begin{table}
\caption{The caption}
\begin{center}
\begin{tabular}{| r | r |}
\hline
This is & a table. \\
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}
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.
Thanks once more,
Luís