Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

No matter what I do, I can't seem to center the bottom line of these minipage captions. Along with the several variations in the code below, I have also tried \usepackage[justification=centering]{caption}. Advice? Thanks!

A misaligned caption

\begin{figure}[H]
\centering
\minipage{0.14\textwidth}
\includegraphics[width = \linewidth]{five3}
\caption*{\scriptsize ($d.d.d.d, c.d.c.d, \newline  b.d.d.b.d.d, \newline a.d.a.d.c.b.c.d$) \newline $c=a+b$ \newline $d=c+b$}
\endminipage\hfill

\minipage{0.14\textwidth} \centering
\includegraphics[width=\linewidth]{four3}\caption*{\scriptsize ($d.d.d.d, \newline d.c.c.c, \newline  b.c.b.c.b.d.d, \newline a.d.a.d.b.c.b.c.d$) \newline $c=a+b$ \newline $d=c+b$ \centering}
\endminipage\hfill
\endminipage
\end{figure}
share|improve this question
    
A minimal working example to work with would be nice. –  Svend Tveskæg Aug 28 '13 at 23:07
add comment

3 Answers

Why not just place the content of the \caption in a tabular (or array, depending on your preference)?

enter image description here

\documentclass{article}
\usepackage{caption,graphicx}% http://ctan.org/pkg/{caption,graphicx}
\begin{document}

\begin{figure}[ht]
  \centering
  \minipage{.5\linewidth}
    \centering
    \includegraphics[width = 100pt]{example-image-a}
    \caption*{\scriptsize $\array{c}(d.d.d.d, c.d.c.d, \\
        b.d.d.b.d.d, \\
        a.d.a.d.c.b.c.d) \\
        c = a+b \\
        d = c+b
      \endarray$}
  \endminipage
\end{figure}

\end{document}
share|improve this answer
    
Perhaps also \array{@{}c@{}}...? –  Gonzalo Medina Aug 28 '13 at 23:37
add comment

The combination of \centering and \newline does not give the desired output, as one can see from this simple document:

\documentclass{article}

\begin{document}
\noindent\parbox{\textwidth}{\centering
First line\newline Second line}
\par\bigskip
\noindent\parbox{\textwidth}{\centering
First line\\ Second line}
\end{document}

enter image description here

So don't use \newline inside your caption but \\ instead:


\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}

\begin{document}
\begin{figure}[H]
\centering
\captionsetup{justification=centering,font=scriptsize}
\minipage{0.14\textwidth}
\includegraphics[width = \linewidth]{five3}
\caption*{($d.d.d.d, c.d.c.d,$ \\  $b.d.d.b.d.d,$ \\ $a.d.a.d.c.b.c.d$) \\ $c=a+b$ \\ $d=c+b$}
\endminipage\hfill

\minipage{0.14\textwidth} \centering
\includegraphics[width=\linewidth]{four3}
\caption*{($d.d.d.d,$ \\ $d.c.c.c,$ \\  $b.c.b.c.b.d.d,$ \\ $a.d.a.d.b.c.b.c.d$) \\ $c=a+b$ \\ $d=c+b$}
\endminipage\hfill
\end{figure}
\end{document}

enter image description here

share|improve this answer
add comment

You need neither figure nor \caption*.

\documentclass{article}
\usepackage[demo]{graphicx} % demo is just for the example
\usepackage{lipsum}

\begin{document}
\lipsum[1]

\begin{center}
\includegraphics[width = .14\columnwidth]{five3}\\[\abovecaptionskip]
\scriptsize
($d.d.d.d,$\\
$c.d.c.d,$
$b.d.d.b.d.d,$\\
$a.d.a.d.c.b.c.d$)\\
$c=a+b$\\
$d=c+b$
\end{center}

\lipsum[2]

\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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