当我在论文中添加图形时,尽管它周围没有任何多余的白色边框,但即使使用 ,它也会向右移动\centering
。我总是必须手动将其带回来\hspace{-1cm}
。这是我的代码,
\documentclass[conference]{IEEEtran}
\usepackage{algorithm, algpseudocode, dsfont, color, soul, tikz, amsmath, amssymb, amsfonts, amsthm, bbm, bbold, fixmath, mathtools, multirow, boldline, xcolor, colortbl, url, footnote, cite}
\begin{document}
\begin{figure}
\hspace{-1cm}
\includegraphics[scale=.73]{RWD.pdf}
\caption{Picture}
\label{fig: RWD}
\end{figure}
\end{document}
\hfil
另外我想知道您是否能告诉我和以及和\hfill
之间有什么区别。\hspace
\hspace*
答案1
不要使用指令,执行时\hspace{-1cm}
不要使用选项。相反,正如@egreg在评论中所建议的那样,将图形的宽度设置为。scale=...
\includegraphics
\columnwidth
您似乎正在加载相当多的软件包。但是,有些软件包(例如fixmath
)根本不应该加载,至少对于不使用 Computer Modern 字体系列的文档来说不应该加载。其他软件包不需要明确加载,因为它们会被其他软件包自动加载。哦,一定要问问自己是否真的需要加载这些软件包。一个好的经验法则是,如果您不知道某个软件包的作用,那么您可能一开始就不需要加载它……
\documentclass[conference,demo]{IEEEtran} % omit 'demo' option in real doc.
\usepackage[table]{xcolor}
\usepackage[hyphens]{url}
\usepackage{algorithm, algpseudocode, dsfont,
%color, % don't load this since you're loading 'xcolor' as well
soul, tikz,
%amsmath, % is loaded automatically by mathtools package
amssymb,
%amsfonts, % is loaded automatically by 'amssymb' package
amsthm, bbm, bbold,
%fixmath, % don't load this package since Times Roman font is in use
mathtools, multirow, boldline,
%url, % don't load 'url' without the 'hyphens' option
%xcolor, colortbl, % don't load these two packages independently
footnote, % was last updated in 1997! do you really need it?!
cite}
\usepackage{lipsum} % source of filler text
\begin{document}
\lipsum[1] % filler text
\begin{figure}[h!] % "[h!]" used just for this example
%\hspace{-1cm} % don't use this!
\includegraphics[width=\columnwidth]{RWD}
\caption{Picture}
\label{fig:RWD} % default exension is ".pdf"
\end{figure}
\lipsum[2] % more filler text
\end{document}