In the following MWE, the environment "quoter" is used let's say a little bit as a "pseudo"-caption: it is not a real \caption or \captionof, but still it generates a counter and displays a word such as "Quote" or "Figure" (or anything else to your liking) and a counted number after it.
I am just wondering how I could easily reference to a certain instance of such a "quoter"-environment, with the number and additionally a title/description of the "Quote" (in casu, or in other cases: "Figure", or anything else).
With a real \caption or \captionof, this is not all too hard. But, how do we do it for this "pseudo"-caption? A vital step is to know how to recuperate the number of a certain labeled Quote, but not reference to it according to its number (because that might change because the whole document might change). It might be good to somehow automatically \label a quote's title/description, and then through that: automatically recuperate the Quote's number.
The MWE shows how a desired end-result could look like.
MWE
\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{calc}
%%%%% quoter environment
\newcounter{quote}
\newmdenv[
hidealllines=true,
innertopmargin=16pt,
innerbottommargin=10pt,
leftmargin=0cm,
rightmargin=0cm,
skipabove=10pt,
skipbelow=10pt,
singleextra={
\coordinate (aux) at ( $ (O)!0.5!(P) $ );
\fill[rounded corners=6pt,line width=1pt,blue!30]
(O|-P) --
(aux|-P) --
([yshift=12pt]aux|-P) --
([yshift=12pt,xshift=4cm]aux|-P) --
([xshift=4cm]aux|-P) --
(P) {[sharp corners] --
([yshift=-6pt]P) --
([yshift=-6pt]O|-P) } -- cycle;
\draw[rounded corners=6pt,line width=1pt,blue]
(O|-P) --
(aux|-P) --
([yshift=12pt]aux|-P) --
([yshift=12pt,xshift=4cm]aux|-P) --
([xshift=4cm]aux|-P) --
(P) --
(P|-O) --
(O) -- cycle;
\node at ([xshift=2cm,yshift=3pt]aux|-P)
{\refstepcounter{quote}\large Quote~\thequote} ;
},
firstextra={
\coordinate (aux) at ( $ (O)!0.5!(P|-O) $ );
\fill[rounded corners=6pt,line width=1pt,blue!30,overlay]
(O|-P) --
(aux|-P) --
([yshift=12pt]aux|-P) --
([yshift=12pt,xshift=4cm]aux|-P) --
([xshift=4cm]aux|-P) --
(P) {[sharp corners] --
([yshift=-6pt]P) --
([yshift=-6pt]O|-P) } -- cycle;
\draw[rounded corners=6pt,line width=1pt,blue,overlay]
(O) --
(O|-P) --
(aux|-P) --
([yshift=12pt]aux|-P) --
([yshift=12pt,xshift=4cm]aux|-P) --
([xshift=4cm]aux|-P) --
(P) --
(P|-O);
\node[overlay] at ([xshift=2cm,yshift=3pt]aux|-P)
{\refstepcounter{quote}\large Quote~\thequote} ;
},
middleextra={
\draw[rounded corners=6pt,line width=1pt,blue,overlay]
(O|-P) --
(O);
\draw[rounded corners=6pt,line width=1pt,blue,overlay]
(P) --
(P|-O);
},
secondextra={
\coordinate (aux) at ( $ (O)!0.5!(P|-O) $ );
\draw[rounded corners=6pt,line width=1pt,blue,overlay]
(O|-P) --
(O) --
(P|-O) --
(P);
},
]{quoter}
%%%%% begin the beguine
\begin{document}
If you are interested in this, please see \textbf{Quote 1: Kierkegaard's quote, reproduced blindly from the internet}.
\begin{quoter}
\begin{center}
\textbf{Kierkegaard's quote, reproduced blindly from the internet}
\vspace{0.5em}
\hrule
\vspace{1em}
\end{center}
The function of prayer is not to influence God, but rather to change the nature of the one who prays.\footnote{Kierkegaard.}
\end{quoter}
\end{document}
P.S.: It would be handy, of course, to have the \nameref, or the "pseudo"-nameref automatically (or optionally) clickable hyperlink to the actual Quote.
\namerefinto\labelthen, in the OP? – O0123 Apr 21 '16 at 08:32