[Tex/LaTex] Caption below the figure and aligned with left side of figure

captions

How do I get my caption below the figure and at the same time aligned with left side of my figure?

Best Answer

Like this one?

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\captionsetup[figure]{slc=off} % "slc" is an abbreviation for "singlelinecheck"
\begin{document}
\begin{figure}
  \centering
  \captionbox
    {Blah... \label{fig:test}}
    {\includegraphics{test}}
\end{figure}
\end{document}

enter image description here

P.S.: The same effect can be archived using \ffigbox offered by the floatrow package, for example:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{floatrow,caption}
\captionsetup[figure]{slc=off}
\begin{document}
\begin{figure}
  \centering
  \ffigbox[\FBwidth]
    {\caption{Blah...}\label{test}}
    {\includegraphics{test}}
\end{figure}
\end{document}

(For making \captionsetup[figure]{slc=off} work the caption package is needed here additionally.)