2 列文档中的图无法放置在正确的位置

2 列文档中的图无法放置在正确的位置

我有一份 2 列文档,我必须在整个页面宽度上包含一些由 3 个子图组成的图形。使用\begin{figure*}我获得了图形的正确位移,但它们在页面内的位置不正确:我希望它们位于部分标题上方,但我无法做到这一点。有人能帮助我吗?

*代码已更新

\documentclass[11pt,twocolumn,a4paper]{article}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{cite,url,color}
\usepackage{graphics,amsfonts}
\usepackage{epstopdf}
\usepackage[pdftex]{graphicx}
\usepackage[cmex10]{amsmath}
\interdisplaylinepenalty=2500
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\let\labelindent\relax
\usepackage{enumitem}
\usepackage{afterpage}


\usepackage{array}
\usepackage{mdwmath}
\usepackage{mdwtab}
\usepackage{subfigure}
\usepackage{subfig}

\usepackage[top=1.5cm, bottom=2cm, right=1.6cm,left=1.6cm]{geometry}
\usepackage{indentfirst}

\usepackage{times}
\usepackage{paralist}
\usepackage{breqn}
\usepackage{booktabs}

\setlength\parindent{0pt}
\linespread{1}

\begin{document}



\clearpage
\section*{Performance Evaluation}\label{sec:perf_eval}
\begin{figure*}[h]
\centering 
\subfigure[Layer 1]{\includegraphics[width=0.31\textwidth]{example-image-a}}\quad
\subfigure[Layer 0]{\includegraphics[width=0.31\textwidth]{example-image-b}}\quad
\subfigure[Unlayered]{\includegraphics[width=0.31\textwidth]{example-image-c}}
\caption{Model 1 - SAD.}
\end{figure*}
\begin{figure*}[h]
\centering
\subfigure[Layer 1]{\includegraphics[width=0.31\textwidth]{example-image-a}}\quad
\subfigure[Layer 0]{\includegraphics[width=0.31\textwidth]{example-image-b}}\quad
\subfigure[Unlayered]{\includegraphics[width=0.31\textwidth]{example-image-c}}
\caption{Model 1 - ZNCC.}
\end{figure*}
\begin{figure*}[h]
\centering
\subfigure[Layer 1]{\includegraphics[width=0.31\textwidth]{example-image-a}}\quad
\subfigure[Layer 0]{\includegraphics[width=0.31\textwidth]{example-image-b}}\quad
\subfigure[Unlayered]{\includegraphics[width=0.31\textwidth]{example-image-c}}
\caption{Model 2 - SAD.}
\end{figure*}
\begin{figure*}[h]
\centering
\subfigure[Layer 1]{\includegraphics[width=0.31\textwidth]{example-image-a}}\quad
\subfigure[Layer 0]{\includegraphics[width=0.31\textwidth]{example-image-b}}\quad
\subfigure[Unlayered]{\includegraphics[width=0.31\textwidth]{example-image-c}}
\caption{Model 2 - ZNCC.}
\end{figure*}
\clearpage
\begin{figure*}[h]
\centering
\subfigure[Layer 1]{\includegraphics[width=0.31\textwidth]{example-image-a}}\quad
\subfigure[Layer 0]{\includegraphics[width=0.31\textwidth]{example-image-b}}\quad
\subfigure[Unlayered]{\includegraphics[width=0.31\textwidth]{example-image-c}}
\caption{Model 3 - SAD.}
\end{figure*}
\begin{figure*}[h]
\centering
\subfigure[Layer 1]{\includegraphics[width=0.31\textwidth]{example-image-a}}\quad
\subfigure[Layer 0]{\includegraphics[width=0.31\textwidth]{example-image-b}}\quad
\subfigure[Unlayered]{\includegraphics[width=0.31\textwidth]{example-image-c}}
\caption{Model 3 - ZNCC.}
\end{figure*}
\clearpage

\end{document}

答案1

如果该数字位于文档末尾,则可能的解决方案是停止使用twocolumn文档格式:

\documentclass[11pt,twocolumn]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{graphicx}
\usepackage{afterpage}

\usepackage{subfig}

\usepackage[a4paper,
            top=1.5cm, bottom=2cm, right=1.6cm,left=1.6cm,
            showframe]{geometry}
\usepackage{lipsum}

\setlength\parindent{0pt}
\linespread{1}

% making room for figure on the page
\renewcommand\topfraction{0.95}     % maximum size of the top area
\renewcommand\textfraction{0.05}    %c minimum size of the text area, i.e., the area that must not be occupied by floats

\begin{document}

\onecolumn  % <-- start with one column format
\section*{Performance Evaluation}\label{sec:perf_eval}
\begin{figure}[htb]
\centering
\subfloat[Layer 1]{\includegraphics[width=0.3\textwidth]{example-image-a}}\hfil
\subfloat[Layer 0]{\includegraphics[width=0.3\textwidth]{example-image-b}}\hfil
\subfloat[Unlayered]{\includegraphics[width=0.3\textwidth]{example-image-c}}
\caption{Model 1 - SAD.}

\subfloat[Layer 1]{\includegraphics[width=0.3\textwidth]{example-image-a}}\hfil
\subfloat[Layer 0]{\includegraphics[width=0.3\textwidth]{example-image-b}}\hfil
\subfloat[Unlayered]{\includegraphics[width=0.3\textwidth]{example-image-c}}
\caption{Model 1 - ZNCC.}

\subfloat[Layer 1]{\includegraphics[width=0.3\textwidth]{example-image-a}}\hfil
\subfloat[Layer 0]{\includegraphics[width=0.3\textwidth]{example-image-b}}\hfil
\subfloat[Unlayered]{\includegraphics[width=0.3\textwidth]{example-image-c}}
\caption{Model 2 - SAD.}
\subfloat[Layer 1]{\includegraphics[width=0.3\textwidth]{example-image-a}}\hfil
\subfloat[Layer 0]{\includegraphics[width=0.3\textwidth]{example-image-b}}\hfil
\subfloat[Unlayered]{\includegraphics[width=0.3\textwidth]{example-image-c}}
\caption{Model 2 - ZNCC.}
\end{figure}

\clearpage
\begin{figure}[ht]
\subfloat[Layer 1]{\includegraphics[width=0.3\textwidth]{example-image-a}}\hfil
\subfloat[Layer 0]{\includegraphics[width=0.3\textwidth]{example-image-b}}\hfil
\subfloat[Unlayered]{\includegraphics[width=0.3\textwidth]{example-image-c}}
\caption{Model 3 - SAD.}

\subfloat[Layer 1]{\includegraphics[width=0.3\textwidth]{example-image-a}}\hfil
\subfloat[Layer 0]{\includegraphics[width=0.3\textwidth]{example-image-b}}\hfil
\subfloat[Unlayered]{\includegraphics[width=0.3\textwidth]{example-image-c}}
\caption{Model 3 - ZNCC.}
\end{figure}

% \twocolumn (restore two columns, but it become effective on the next page)
\end{document}

实际上你需要解决两个问题:(i)figure*在插入文本后出现在页面上;(ii)如果浮动大于确定的默认比例,则将其移动到自己的页面(有关详细信息,请参阅 Frank Mittelbach回答)。因此,您可以得出结论,对于您的愿望来说空间不大,希望上述(肮脏的)黑客能帮助您。它给出(仅显示前两行子图):

在此处输入图片描述

无关:不要 同时加载subfigure和。subfig

相关内容