1

I have a few subfloat captions that are too short to have an automatic linebreak, but I want to force one and still have centering among the lines:

Basically I would like a and b to be like c ...

subfigures

How can I do it?

MWE:

\documentclass[12pt, twoside, titlepage]{report}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\usepackage{caption}

\begin{document}

\begin{figure}
 \captionsetup[subfigure]{justification=centering}
\centering
\hspace*{-0cm}
    \subfloat[$v=0$\newline$\omega = \omega_2$]{\includegraphics[scale =0.58]{"satspecK1".pdf} }%
    \quad 
    \subfloat[general $v$\newline general $\omega$]{\includegraphics[scale =0.58]{"satspecK2".pdf} }%
    \quad 
    \subfloat[$v = \pm (\omega_1 - \omega_2)/2k$\newline$\omega = (\omega_1 + \omega_2)/2$]{\includegraphics[scale =0.58]{"satspecK3".pdf} }%
    \caption{}
    \label{fig:Ksatspec}%
\end{figure}


\end{document}
Mensch
  • 65,388
  • BTW: Never use \newline inside a \parbox or a caption typeset by the caption, subcaption or subfig package, you will get weird results, so use \\ instead. (The reason for this: \\ is re-defined for parboxes (in \@parboxrestore) so it will behave reasonable, but \newline is not, for whatever reason.) –  Apr 13 '19 at 12:52
  • if i understood your question correctly, you like to have centered only caption content and hanging caption label? – Zarko Apr 13 '19 at 13:44
  • If you want to align equations inside a caption, you should delete this question and start another one. – John Kormylo Apr 13 '19 at 13:49

0 Answers0