你好,我正在使用 ieee 2 列格式。我将 4 个数字排成一行,但为什么它没有正确对齐,正如你所见,右侧的两个数字略高于左侧的数字 这是我的代码
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{subfig}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{makecell}%
%table
\usepackage[margin=1in]{geometry}
\usepackage{tabularx,booktabs}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\usepackage{blindtext}
\usepackage{times}
\usepackage{algorithm}
\usepackage{algorithmic}
\makeatletter
\newcommand{\removelatexerror}{\let\@latex@error\@gobble}
\makeatother
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}
\begin{figure*}
\centering
\setkeys{Gin}{width=0.48\linewidth}
\begin{minipage}[t]{0.48\linewidth}
\subfloat[ cc]{\label{Fig5:Fig5a}\includegraphics{z.png}}
\hfill
\subfloat[ccc]{ \label{Fig5:Fig5b}\includegraphics{z.PNG}}
\caption{vvvvy}
\label{Fig5:}
\end{minipage}
\hfill
\begin{minipage}[t]{0.48\linewidth}
\subfloat[ccc]{\label{Fig6:Fig6a}\includegraphics{z.PNG}}\hfill
\label{Fig7}
\subfloat[ccc]{\label{Fig6:Fig6b}\includegraphics{z.PNG}}
\caption{cccy}
\label{Fig6:}
\end{minipage}
\end{figure*}
\end{document}
答案1
您需要(a)更换两个都\begin{minipage}
with和 (b)的实例\begin{minipage}[t]
确保不要在两个环境之间留下全空行minipage
,因为这会导致换行(更准确地说,用 TeX 术语来说,是段落中断)。
哦,在这样做的同时,请同时删除有害的代码垃圾,例如\label{Fig7}
和定义宏的指令\BibTeX
。最后,请记住,多次加载包不会带来任何好处(请参阅:inputenc
,babel
)。
\documentclass[conference]{IEEEtran}
%% Remark: I've streamlined the preamble by removing all
%% stuff that's of no relevance for the issue at hand.
\IEEEoverridecommandlockouts
\usepackage[demo]{graphicx} % remove 'demo' option in real document
\usepackage{subfig}
\usepackage[english]{babel}
\usepackage[margin=1in]{geometry}
\usepackage{newtxtext} % times is obsolete
\begin{document}
\addtocounter{figure}{4} % optional
\begin{figure*}
\setkeys{Gin}{width=.49\linewidth}
\begin{minipage}[t]{1\columnwidth}
\subfloat[aaa]{\label{Fig5:Fig5a}\includegraphics{Fig5a}}\hfill
\subfloat[bbb]{\label{Fig5:Fig5b}\includegraphics{Fig5b}}
\caption{vvvvy} \label{Fig5:}
\end{minipage}\hfill % be sure not to leave a blank line
\begin{minipage}[t]{1\columnwidth}
\subfloat[ccc]{\label{Fig6:Fig6a}\includegraphics{Fig6a}}\hfill
\subfloat[ddd]{\label{Fig6:Fig6b}\includegraphics{Fig6b}}
\caption{cccy} \label{Fig6:}
\end{minipage}
\end{figure*}
\end{document}