5

I have this MWE:

    \documentclass[a4paper,12pt]{article}
    \usepackage{amsmath,amssymb}
    \usepackage{tikz}
    \usepackage{graphicx}
    \usepackage[labelformat=simple]{caption}
    \usepackage[labelformat=simple]{subcaption} % https://tex.stackexchange.com/a/135441/121799
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \DeclareCaptionFormat{Sebastiano}{%#1#2\par
    {\tikz[remember picture,baseline=-0.5ex]{%
    \node[fill=orange,text=white,font=\bfseries\sffamily\large,rounded
    corners=0.2em,minimum width=1.8em,minimum height=1.8em](M){#1};
    \draw[very thick,orange] (M.west) -- ++ (-1,0);}}%
    \hfill\hfill{\tikz[remember picture,overlay]{\coordinate(R);
    \draw[very thick,orange] (M.east) -- (M.east-|R);
    }}\par
    #3} 
    \DeclareCaptionFormat{Incredibile}{%#1#2\par
    {\tikz{%
    \node[text width=\linewidth-14pt,outer xsep=1.6pt,align=justify](MI){\textbf{\sffamily#1#2}#3};
    \draw[very thick,orange] (MI.north west) -- (MI.south west)
    (MI.north east) -- (MI.south east);
    }}\par
    } 
    \captionsetup{format=Incredibile}
    \captionsetup[sub]{format=Sebastiano}
    \newcommand{\IncludeClippedGraphics}[2][]{\begin{tikzpicture} 
    \node[rounded corners=5pt,clip,preaction={draw=orange,very thick},inner sep=-2pt]{%
    \includegraphics[#1]{#2}}; 
    \end{tikzpicture}}
\begin{document}
\begin{figure}[htp]
\centering
\begin{subfigure}[t]{.45\linewidth}
\centering
\IncludeClippedGraphics[width=\textwidth]{example-image-b}
\caption{\label{fig:subim12}}
\end{subfigure}\quad%
\begin{subfigure}[t]{.45\linewidth}
\centering
\IncludeClippedGraphics[width=\textwidth]{example-image-c}
\caption{\label{fig:subim29}}
\end{subfigure}     
\caption{Coordinate sferiche  $P(r,\varphi,\theta)$ nello spazio con linee coordinate e versori tangenti: notazione invertita tra $\varphi$ e $\theta$ rispetto a quella classica in Analisi Matematica.}
\end{figure}
\end{document}

with this screenshot:

enter image description here

Is it possible to put an orange \blacktriangle, before of the Figure 1, where every time that I have a new figure the symbol will rotate or in anticlockwise or in clockwise, starting from this position?

The example that I would to have is this below.

enter image description here

Sebastiano
  • 54,118

1 Answers1

4

EDITED to use \newcount math trick to perform required multiplication, so that each figure rotates the triangle an additional 90 degrees counter-clockwise.

The other key is that \figurename is the macro you need to update to reflect the desired caption label. Therefore, my additions amounted to this in the preamble:

\makeatletter
\newcount\figcnt
\newcommand\figrot{\figcnt=\numexpr\dimexpr90\c@figure\relax-90\relax}
\makeatother
\renewcommand\figurename{\figrot\textcolor{orange}{%
  \rotatebox[origin=c]{\figcnt}{$\blacktriangle$}} Figure}

The MWE:

    \documentclass[a4paper,12pt]{article}
    \usepackage{amsmath,amssymb}
    \usepackage{tikz}
    \usepackage{graphicx}
    \usepackage[labelformat=simple]{caption}
    \usepackage[labelformat=simple]{subcaption} % https://tex.stackexchange.com/a/135441/121799
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \DeclareCaptionFormat{Sebastiano}{%#1#2\par
    {\tikz[remember picture,baseline=-0.5ex]{%
    \node[fill=orange,text=white,font=\bfseries\sffamily\large,rounded
    corners=0.2em,minimum width=1.8em,minimum height=1.8em](M){#1};
    \draw[very thick,orange] (M.west) -- ++ (-1,0);}}%
    \hfill\hfill{\tikz[remember picture,overlay]{\coordinate(R);
    \draw[very thick,orange] (M.east) -- (M.east-|R);
    }}\par
    #3} 
    \DeclareCaptionFormat{Incredibile}{%#1#2\par
    {\tikz{%
    \node[text width=\linewidth-14pt,outer xsep=1.6pt,align=justify](MI){\textbf{\sffamily#1#2}#3};
    \draw[very thick,orange] (MI.north west) -- (MI.south west)
    (MI.north east) -- (MI.south east);
    }}\par
    } 
    \captionsetup{format=Incredibile}
    \captionsetup[sub]{format=Sebastiano}
    \newcommand{\IncludeClippedGraphics}[2][]{\begin{tikzpicture} 
    \node[rounded corners=5pt,clip,preaction={draw=orange,very thick},inner sep=-2pt]{%
    \includegraphics[#1]{#2}}; 
    \end{tikzpicture}}

\makeatletter \newcount\figcnt \newcommand\figrot{\figcnt=\numexpr\dimexpr90\c@figure\relax-90\relax} \makeatother \renewcommand\figurename{\figrot\textcolor{orange}{% \rotatebox[origin=c]{\figcnt}{$\blacktriangle$}} Figure} \begin{document} \begin{figure}[htp] \centering \begin{subfigure}[t]{.45\linewidth} \centering \IncludeClippedGraphics[width=\textwidth]{example-image-b} \caption{\label{fig:subim12}} \end{subfigure}\quad% \begin{subfigure}[t]{.45\linewidth} \centering \IncludeClippedGraphics[width=\textwidth]{example-image-c} \caption{\label{fig:subim29}} \end{subfigure}
\caption{Coordinate sferiche $P(r,\varphi,\theta)$ nello spazio con linee coordinate e versori tangenti: notazione invertita tra $\varphi$ e $\theta$ rispetto a quella classica in Analisi Matematica.} \end{figure}

\begin{figure} \caption{Next} \end{figure}

\begin{figure} \caption{Third} \end{figure} \end{document}

enter image description here

enter image description here

enter image description here