3

In relation to my previous question

A particular customize with green line and letters for subfloat

I would like to have a green line with a center rounded square (with symbol)

enter image description here

where the labels (a, b, c, etc.) are automatic and the comments of the figures must only be on the caption line as shown in the attached image (it is a collage done with Paint):

enter image description here

My MWE is:

\documentclass[12pt]{book} 
\usepackage{newtxtext}
%%\usepackage{classico}%%%%%%%%%
\usepackage{subfig}
\usepackage{mathtools}
\usepackage[labelfont={sf,bf},skip=.3pt]{caption}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{figure}[htp]
\centering
\subfloat[][\small Le linee di universo passanti per l'origine saranno all'interno del cono. Si vede la linea blu che parte dal punto qui ed ora rappresentato dal vertice del cono.]
{\includegraphics[width=.45\textwidth]{example-image-a}} \quad
\subfloat[][\small  Linee di universo non ammesse nella teoria della relatività ristretta sono quelle che escono dal cono di luce; ad esempio la linea \textbf{(1)} esce dal cono che pertanto non sarà ammessa; la velocità nel punto $A$ della linea \textbf{(2)} è minore di quella della luce; la linea arancione \textbf{(3)} rappresenta un viaggiatore dello spazio-tempo con il dono dell'ubiquità; la linea \textbf{(4)} rappresenta un viaggio indietro nel tempo a una velocità maggiore di quella della luce.]
{\includegraphics[width=.45\textwidth]{example-image-b}}
\caption{\small Coni di luce.}
\end{figure}

\end{document}

EDIT 1: ADDENDUM:

Using \subfloat[][]{\includegraphics...} or \subfloat[][title of subfigure]{\includegraphics...} always inserts a label (a) etc. in the title of the subfigure. Can it be removed?

0

1 Answer 1

4

Something like this? I had to replace subfig by subcaption.

\documentclass[12pt]{book} 
\usepackage{newtxtext}
%%\usepackage{classico}%%%%%%%%%
\usepackage{mathtools}
\usepackage[labelfont={sf,bf},font=small,skip=.3pt]{caption}
\usepackage[labelformat=simple]{subcaption} % https://tex.stackexchange.com/a/135441/121799
\renewcommand\thesubfigure{\alph{subfigure}}
\usepackage{tikz}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareCaptionFormat{Sebastiano}{%#1#2\par
{\tikz[remember picture,baseline=-0.5ex]{%
\node[fill=green!80!black,text=white,font=\bfseries\sffamily\large,rounded
corners=0.2em,minimum width=1.8em,minimum height=1.8em](M){#1};
\draw[very thick,green!80!black] (M.west) -- ++ (-1,0);}}%
\hfill\hfill{\tikz[remember picture,overlay]{\coordinate(R);
\draw[very thick,green!80!black] (M.east) -- (M.east-|R);
}}\par
#3} 
\captionsetup[sub]{format=Sebastiano}
\begin{document}
\begin{figure}[htp]
\centering
\begin{subfigure}[t]{.45\linewidth}
 \centering
 \includegraphics[width=\textwidth]{example-image-a}
 \caption{\label{subfig:WorldLine}}
\end{subfigure}\quad%
\begin{subfigure}[t]{.45\linewidth}
 \centering
 \includegraphics[width=\textwidth]{example-image-b}
 \caption{\label{subfig:LightCone}}
\end{subfigure}     
\caption{Coni di luce. 
\textbf{(a)}~Le linee di universo passanti per l'origine saranno
all'interno del cono. Si vede la linea blu che parte dal punto qui ed ora
rappresentato dal vertice del cono.
\textbf{(b)}~Linee di universo non ammesse nella teoria della
relativit\`a ristretta sono quelle che escono dal cono di luce; ad esempio la
linea \textbf{(1)} esce dal cono che pertanto non sar\`a ammessa; la velocit\`a
nel punto $A$ della linea \textbf{(2)} \`e minore di quella della luce; la linea
arancione \textbf{(3)} rappresenta un viaggiatore dello spazio-tempo con il dono
dell'ubiquit\`a; la linea \textbf{(4)} rappresenta un viaggio indietro nel tempo
a una velocit\`a maggiore di quella della luce.}
\end{figure}
\end{document}

enter image description here

4
  • 1
    You're near to the my solution. :-) I'm so sorry to ask you for some directions. If you look carefully at the second figure in the green square there are no brackets, then the individual comments to each figure should move to the caption of Figure 1 where there is written new new, hello hello hello, hi, hi, hi. And I'm sorry about the extra work.
    – Sebastiano
    Mar 28, 2019 at 16:18
  • 2
    @Sebastiano I updated.
    – user121799
    Mar 28, 2019 at 16:45
  • 1
    Nothing. I have adding a edit yesterday.
    – Sebastiano
    Mar 29, 2019 at 7:32
  • @Sebastiano As for your question, this answer does not use \subfloat but removing the fancy subcaption here is a simple as commenting out \caption.
    – user121799
    Mar 29, 2019 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.