我如何获取下图中的图形标题?
\documentclass[a4paper,
10pt,
twocolumn,
%draft,
leqno,
%fleqn
]{scrartcl}
\usepackage{subfigure}
\usepackage{floatrow}
\begin{document}
\begin{figure}[htbp]
\centering
\begin{minipage}{.5\columnwidth}
\centering
\subfigure[primitiv]{\rule{1cm}{2cm}}
\subfigure[basisflächenzentriert]{\rule{1cm}{2cm}}
\captionof{figure}{monoklin}
\label{fig:monoklin}
\end{minipage}
\begin{minipage}{.4\columnwidth}
\centering
\subfigure[primitiv]{\rule{1cm}{2cm}}
\captionof{figure}{triklin}
\label{fig:triklin}
\end{minipage}
\end{figure}
\end{document}
答案1
subfigure
是过时的软件包。它被替换为subfig
- 标题太大,三张图片无法很好地容纳在列宽中。您可以考虑将图片放在两列上吗?
\documentclass[a4paper, twocolumn, leqno]{scrartcl}
\usepackage{subfig}
\usepackage{graphicx}
\usepackage{tabularx}
\begin{document}
\begin{figure}[htbp]
\setkeys{Gin}{height=24mm, width=\linewidth, keepaspectratio}%
\setlength\tabcolsep{2pt}
\captionsetup{skip=-1ex}
\begin{tabularx}{\linewidth}{@{} XXX @{}}
\subfloat[primitiv]{\includegraphics{example-image-duck}}
&
\subfloat[basisflächen\-zentriert]{\includegraphics{example-image-duck}}
&
\includegraphics{example-image-duck}
\\
\multicolumn{2}
{p{0.6\hsize}}
{\caption{monoklin}
\label{fig:monoklin}
}
&
\caption{triklin}
\label{fig:triklin}
\end{tabularx}
\end{figure}
\end{document}
- 如果你同意第二项,那么将上面的 MWE 替换
fig
为figure*
浮动环境。这样你将获得:
答案2
您可以使用subcaption
(带[t]
对齐)。我强烈建议使用figure*
来跨越两列。一列中的三张图片会非常狭窄,导致副标题不美观。
\documentclass[
a4paper,
10pt,
twocolumn,
%draft,
leqno,
%fleqn
]{scrartcl}
\usepackage{subcaption,graphicx}
\begin{document}
\begin{figure*}
\centering
\setlength{\tabcolsep}{0pt}% let TeX compute the spaces
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ccc@{}}
\begin{subfigure}[t]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{example-image}
\caption{primitiv}
\end{subfigure}
&
\begin{subfigure}[t]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\caption{basisflächenzentriert}
\end{subfigure}
&
\begin{subfigure}[t]{0.3\textwidth}
\includegraphics[width=\textwidth]{example-image}
\end{subfigure}
\\[-\normalbaselineskip]
\multicolumn{2}{c}{%
\begin{minipage}[t]{\dimexpr0.6\textwidth+2\tabcolsep}
\caption{monoklin}\label{fig:monoklin}
\end{minipage}%
}
&
\begin{minipage}[t]{0.3\textwidth}
\caption{triklin}\label{fig:triklin}
\end{minipage}
\end{tabular*}
\end{figure*}
\end{document}