# Text in quote style with caption

I need to put a output of a program in a quote stile but i need to put a \caption tag like an image or a table.

I need to do something like:

text
other text
...
Output X: something

What i can do this?

Edit 1:

I have a multiline quote like this:

\begin{quote}
{\bf Percorso del dataset:} Utile in caso di approccio \ac{MC} per individuare il dataset con le epoche random che ha portato allo score migliore;\\
{\bf Numero totale di epoche:} Utile nel caso 3 per specificare qual'è il numero di epoche che portato allo score migliore; \\
{\bf Istanti di transizione da un epoca all'altra:} Utile in caso di approccio \ac{MC} per caratterizzare la sequenza di epoche appresa che ha portato allo score migliore; \\
{\bf Score globale:} Score dell'intera sequenza di strutture; \\
{\bf Lista dei NaN:} Eventuale lista degli score con valore \ac{NaN};
\end{quote}


I need to put a label "Quote X: blablabla" at the bottom of the quote. I don't like the figure tag, because it isn't a figure.

-
Could you please add a fully compilable (minimum working) example with a snippet of some code to your post by editing it? We are guessing right now, it would help the solvers a lot. –  Malipivo Apr 15 at 12:08
@Neptune: What is the \ac command? –  Bernard Apr 17 at 12:24
(A little off-topic) Did you tried the Dialogue package to typeset dialogues? It will spare you those {\bf ... }. –  Clément Jul 17 at 22:35

One can create a new float type that I call floatquote with the float package. It's not used in the document body, as I can't imagine why one would make a quotation float. Instead, you have the captionof command from the caption package. In addition, I included a demonstration of the cleveref package (cross-references that detect the type of structure you're referencing, so you don't have to type its name). I also added the enumitem package to use a compact description environment which I find better suited to your case and babelto have correct hyphenation in italian. Not knowing what the \ac command is supposed to do, I decided quite arbitrarily it was "\relax".

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{float}
\newfloat{floatquote}{tbp}{loq}
\floatname{floatquote}{Quote}
\usepackage{caption}
\captionsetup{font =small, format = hang}
\usepackage{cleveref}
\crefname{floatquote}{quote}{quotes}
\Crefname{floatquote}{Quote}{Quotes}

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[italian,  english]{babel}
\usepackage{float}
\newfloat{floatquote}{tbp}{loq}
\floatname{floatquote}{Quote}
\usepackage{caption}
\captionsetup{font =small, format = hang}
\usepackage{cleveref}
\crefname{floatquote}{quote}{quotes}
\Crefname{floatquote}{Quote}{Quotes}
\usepackage{enumitem}

\newcommand\ac{\relax}

\begin{document}
\noindent Some text preceding the quote environment.
\begin{quote}{\selectlanguage{italian}
\begin{description}[noitemsep = 0pt]%style = nextline,
\item[Percorso del dataset:] Utile in caso di approccio \ac{MC} per individuare il dataset con le epoche random che ha portato allo score migliore;
\item[Numero totale di epoche:] Utile nel caso 3 per specificare qual'è il numero di epoche che portato allo score migliore;
\item[Istanti di transizione da un epoca all'altra:] Utile in caso di approccio \ac{MC} per caratterizzare la sequenza di epoche appresa che ha portato allo score migliore;
\item[Score globale:] Score dell'intera sequenza di strutture;
\item[Lista dei NaN:] Eventuale lista degli score con valore \ac{NaN};
\end{description}}
\captionof{floatquote}{Output of the Program}\label{quo1}
\end{quote}
In \cref {quo1} we find the output of the program.
\end{document}


-
Before looking at your example, I thought that the caption would be "Quote 1: foo bar" and cleveref would have picked the "quote" name for the reference. ;( –  T. Verron Apr 15 at 13:13
@T. Verron: I thought first you wanted to have "Figure". A new code example has been uploaded. –  Bernard Apr 15 at 13:56
I'm not the OP, who knows, maybe he wants figure. But isn't it nicer with "quote"? (Also, it seems that you have a useless label in the body of \captionof.) –  T. Verron Apr 15 at 14:04
OK. I didn't check all the modifications I did. –  Bernard Apr 15 at 14:13
My quote is multiline and I need to put the label at the bottom. I have put an example in the first post. –  Neptune Apr 17 at 9:49

The figure environment can still do it for you, it doesn't have to be a graphic figure:

    \begin{figure}
\begin{quotation}
\lipsum[1]
\end{quotation}
\caption{Caption}
\end{figure}

-
I don't like the figure tag because it isn't a figure. –  Neptune Apr 17 at 9:53

There is a quote environment, but that doesn't float. You can put text in a figure floating environment:

\documentclass{article}
\begin{document}
This is some body text

\begin{figure}[h]
\centering
\small{This is text.  It's in a figure environment but it's still text}
\caption{\label{fig_text}Some text that can float as a figure}
\end{figure}

In figure~\ref{fig_text} some text was displayed as a figure.
\end{document}


So you could if you chose do

\begin{figure}
\begin{quote}
this is some quoted text
\end{quote}
\caption{\label{fig_quote}A quote in a figure}
\end{figure}


You might need to clarify: Do you want a separate counter (you've got figure and table already, do you want e.g. output` as well?)

-
@GonzaloMedina, fixed, thanks. That was typed in place rather than pasted from my editor - it shows. –  Chris H Apr 15 at 15:58