我试图将 4 个数字以 2figs x 2figs 的形式排列在这样的一列中
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage[compress]{cite}
\usepackage{times} % Font Times New Roman throughout the document
\usepackage{subfigure}
\usepackage{epsfig}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{array}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{tikz,pgfplots}
\usepackage{adjustbox}
\pgfplotsset{compat=1.14}
\usepgfplotslibrary{patchplots}
\usepgfplotslibrary{fillbetween}
\usepackage{caption}
\usetikzlibrary{arrows.meta}
\usepackage{graphicx,subfigure}
\usepackage{float}
\usepackage{url}
\usepackage{mathtools}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\newcommand{\prob}[1]{p(#1)}
%\newcommand{\overbar}[1]{\mkern 1.5mu\overline{\mkern-1.5mu#1\mkern-1.5mu}\mkern 1.5mu}
\newcommand*\overbar[1]{\overline{#1}}
\newcommand{\hull}[1]{\mbox{$<$$#1$$>$}}
\newcommand{\stext}[1]{{\scriptscriptstyle \text{#1}}}
\let\oldemptyset\emptyset
\let\emptyset\varnothing
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\usepackage{textcomp}
\usepackage{xcolor}
\usetikzlibrary{arrows,automata,positioning}
% \usepackage{subcaption}
\begin{document}
ñlakdfñlakdjfñlakdjfñlkjls
´ñsdfádjñlakdjñlakdjñlakdjñalkdjf
\begin{figure}[t!]
\centering
\begin{minipage}{1\linewidth}
\begin{subfigure}[b]{0.48\linewidth}
\centering
\includegraphics[width=\linewidth]{figs/Q4_c.eps}
\caption{{Q=4, \#tags=100}}
\label{fig:subfigure1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\linewidth}
\centering
\includegraphics[width=\linewidth]{figs/Q4Poiss_c.eps}
\caption{{Q=4, $\lambda=100$}}
\label{fig:subfigure2}
\end{subfigure}
\vskip\baselineskip
\begin{subfigure}[b]{0.48\linewidth}
\centering
\includegraphics[width=\linewidth]{figs/DFSA_c.eps}
\caption{{DFSA, \#tags{=}100}}
\label{fig:subfigure3}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\linewidth}
\centering
\includegraphics[width=\linewidth]{figs/DFSAPoiss_c.eps}
\caption{{DFSA, $\lambda{=1}00$}}
\label{fig:subfigure4}
\end{subfigure}
\caption{Probability of block identification.}
\label{fig:contour4}
\end{minipage}
\end{figure}
ñlakdñlkajdfñlkajdñflkjañldskjf
asdklfñlakdjlakjdñlakdjf
ñlkasdjfñlakdjfñakdjñlaksdjf
\end{document}
但编译时出现错误Latex Error: ./test.tex:76 Missing number, treated as zero.
。
如果我删除,{0.48\linewidth}
编译会顺利进行,但是图形会一个接一个地放置。
我希望得到这个结果
我遗漏了什么?我该如何解决这个问题?
问候
编辑
我也尝试过:
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage[compress]{cite}
\usepackage{times} % Font Times New Roman throughout the document
\usepackage{subfigure}
\usepackage{epsfig}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{array}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{tikz,pgfplots}
\usepackage{adjustbox}
\pgfplotsset{compat=1.14}
\usepgfplotslibrary{patchplots}
\usepgfplotslibrary{fillbetween}
\usepackage{caption}
\usetikzlibrary{arrows.meta}
\usepackage{graphicx}
\usepackage{float}
\usepackage{url}
\usepackage[caption=false]{subfig}
\usepackage{mathtools}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\newcommand{\prob}[1]{p(#1)}
%\newcommand{\overbar}[1]{\mkern 1.5mu\overline{\mkern-1.5mu#1\mkern-1.5mu}\mkern 1.5mu}
\newcommand*\overbar[1]{\overline{#1}}
\newcommand{\hull}[1]{\mbox{$<$$#1$$>$}}
\newcommand{\stext}[1]{{\scriptscriptstyle \text{#1}}}
\let\oldemptyset\emptyset
\let\emptyset\varnothing
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\usepackage{textcomp}
\usepackage{xcolor}
\usetikzlibrary{arrows,automata,positioning}
% \usepackage{subcaption}
\begin{document}
ñlakdfñlakdjfñlakdjfñlkjls
´ñsdfádjñlakdjñlakdjñlakdjñalkdjf
\begin{figure}
\centering
\subfloat[a\label{1a}]{%
\includegraphics[width=0.48\linewidth]{figs/Q4_c.eps}}
\hfill
\subfloat[b\label{1b}]{%
\includegraphics[width=0.48\linewidth]{figs/Q4Poiss_c.eps}}
\\
\subfloat[c\label{1c}]{%
\includegraphics[width=0.48\linewidth]{figs/DFSA_c.eps}}
\hfill
\subfloat[d\label{1d}]{%
\includegraphics[width=0.48\linewidth]{figs/DFSAPoiss_c.eps}}
\caption{(a), (b) Some examples from CIFAR-10 \cite{4}. Tmages.}
\label{fig1}
\end{figure}
ñlakdñlkajdfñlkajdñflkjañldskjf
asdklfñlakdjlakjdñlakdjf
ñlkasdjfñlakdjfñakdjñlaksdjf
\end{document}
乳胶
并使用 pdflatex
它没有显示任何文档并给出错误:
答案1
以下代码对我有用,使用subfig
包而不是subfigure
。
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage[compress]{cite}
\usepackage{times} % Font Times New Roman throughout the document
%\usepackage{subfigure}
\usepackage{epsfig}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{array}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{tikz,pgfplots}
\usepackage{adjustbox}
\pgfplotsset{compat=1.14}
\usepgfplotslibrary{patchplots}
\usepgfplotslibrary{fillbetween}
\usepackage{caption}
\usetikzlibrary{arrows.meta}
%\usepackage{graphicx,subfigure}
\usepackage{float}
\usepackage{lipsum}
\usepackage{url}
\usepackage{mathtools}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\newcommand{\prob}[1]{p(#1)}
%\newcommand{\overbar}[1]{\mkern 1.5mu\overline{\mkern-1.5mu#1\mkern-1.5mu}\mkern 1.5mu}
\newcommand*\overbar[1]{\overline{#1}}
\newcommand{\hull}[1]{\mbox{$<$$#1$$>$}}
\newcommand{\stext}[1]{{\scriptscriptstyle \text{#1}}}
\let\oldemptyset\emptyset
\let\emptyset\varnothing
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\usepackage{textcomp}
\usepackage{xcolor}
\usetikzlibrary{arrows,automata,positioning}
% \usepackage{subcaption}
\ifCLASSOPTIONcompsoc
\usepackage[caption=false, font=normalsize, labelfont=sf, textfont=sf]{subfig}
\else
\usepackage[caption=false, font=footnotesize]{subfig}
\fi
\begin{document}
ñlakdfñlakdjfñlakdjfñlkjls
´ñsdfádjñlakdjñlakdjñlakdjñalkdjf
\begin{figure}
\centering
\subfloat[Q=4, \#tags=100\label{1a}]{%
\includegraphics[width=0.45\linewidth]{example-image}}
\hfill
\subfloat[Q=4, $\lambda=100$\label{1b}]{%
\includegraphics[width=0.45\linewidth]{example-image}}
\\
\subfloat[DFSA, \#tags{=}100\label{1c}]{%
\includegraphics[width=0.45\linewidth]{example-image}}
\hfill
\subfloat[DFSA, $\lambda{=1}00$\label{1d}]{%
\includegraphics[width=0.45\linewidth]{example-image}}
\caption{Probability of block identification.}
\label{fig1}
\end{figure}
\lipsum[1-5]
ñlakdñlkajdfñlkajdñflkjañldskjf
asdklfñlakdjlakjdñlakdjf
ñlkasdjfñlakdjfñakdjñlaksdjf
\end{document}