# Justification of captions

I know there are a few similar questions about this, but the option justification=justified is not working properly on my figures. I'm getting everything but "Figure n:" justified, so the numbering labels are off justification. The same happens with justification=centering. I'm using option \captionof{figure}, can this be the problem?

\documentclass[12pt,twoside,titlepage,headinclude]{scrreprt}
\usepackage{graphicx}
\usepackage[font=small,labelfont=bf,justification=justified]{caption}
\begin{document}

\begin{center}\vspace{1cm}
\includegraphics[width=0.7\linewidth]{Image}
\captionof{figure}[Solar atmosphere temperature-height distribution.]{Solar atmosphere temperature-height distribution as determined by \cite{15}. Height is given in kilometers measured above zero point where $\tau=1$. Regions of line formation are also indicated. From right to left: photosphere, temperature minimum (4,000K), chromosphere, transition region (8,500K) and Lyman valley (20,000K).}
\label{fig:vernazza}
\end{center}\vspace{1cm}

\end{document}

• Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – jub0bs Apr 10 '14 at 18:01

Thanks for posting an MWE. I'm not sure how to interpret your observation that

I'm getting everything but "Figure n:" justified, so the numbering labels are off justification.

I assume you're trying to avoid "hanging indentation" of the caption material on the lines after the first one. If this interpretation is correct, you can achieve the desired effect by specifying the option format=plain of the caption package.

\documentclass[12pt,twoside,titlepage,headinclude]{scrreprt}
\usepackage[demo]{graphicx} % remove demo option in real document
\usepackage[font=small,labelfont=bf,
justification=justified,
format=plain]{caption} % 'format=plain' avoids hanging indentation
\begin{document}
\begin{center}
\vspace{1cm}
\includegraphics[width=0.7\linewidth]{Image}
\captionof{figure}[Solar atmosphere temperature-height distribution.]{Solar atmosphere temperature-height distribution as determined by \cite{15}. Height is given in kilometers measured above zero point where $\tau=1$. Regions of line formation are also indicated. From right to left: photosphere, temperature minimum (4,000K), chromosphere, transition region (8,500K) and Lyman valley (20,000K).}
\label{fig:vernazza}
\end{center}
\vspace{1cm}
\end{document}

• This seems to work for figures. What about for tables? – user1271772 Oct 20 '18 at 0:48
• @user1271772 - Did you try \captionof{table}[...]{...}? – Mico Oct 20 '18 at 2:58
• Tried: \captionsetup[table]{ labelsep=newline, justification=justified, singlelinecheck=false, textfont=it, } with \usepackage{threeparttable} – user1271772 Oct 20 '18 at 3:00
• oh you're talking about in the command for making the caption. The problem is that I'm using LyX. Let me try it with ERT. – user1271772 Oct 20 '18 at 3:01
• tried that now. No improvement at all. Tried \captionof{table}[Table1]{Description of the table} in an ERT box within the float:Table. It worked, in that the caption still does appear exactly where it did before, despite using ERT instead of LyX's built in caption mechanism. But it's not justified at all. It's completely centered instead of left-justified. – user1271772 Oct 20 '18 at 3:05