无论我做什么,似乎都无法将这些小页面标题的底线居中。除了下面代码中的几种变体外,我还尝试了\usepackage[justification=centering]{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}
答案1
和 的组合\centering
并\newline
没有给出期望的输出,正如从这个简单的文档中看到的那样:
\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}
因此,请不要\newline
在标题中使用,而\\
应使用:
\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}
答案2
您既不需要,figure
也不需要\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}
答案3
为什么不直接将 的内容放在\caption
中tabular
(或者array
,取决于您的喜好)?
\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}