IEEE官网下载的Latex模板在Overleaf中使用时无法插入图片

最近在写论文准备投稿,于是乎去IEEE官网下载了Latex模板在Overleaf使用,但死活无法插入图片,经过百般尝试,最终发现了解决方法,供大家参考。

首先确保overleaf的编译器为pdflatex(虽然这东西老旧,但还是靠谱啊),然后将图片相关包的代码设置如下,重要的是把原来的\graphicspath{{…/pdf/}{…/jpeg/}}中的…去掉,个人认为这是Overleaf本身路径特色导致的,这时建立figures文件夹和pdf文件存放图片即可正常插入图片。

正确代码

\ifCLASSINFOpdf
\usepackage[pdftex]{graphicx}
% declare the path(s) where your graphic files are
\graphicspath{{pdf/}{figures/}}
% and their extensions so you won’t have to specify these with
% every instance of \includegraphics
\DeclareGraphicsExtensions{.pdf,.jpeg,.png}
\else
% or other class option (dvipsone, dvipdf, if not using dvips). graphicx
% will default to the driver specified in the system graphics.cfg if no
% driver is specified.
\usepackage[dvips]{graphicx}
% declare the path(s) where your graphic files are
\graphicspath{{…/eps/}}
% and their extensions so you won’t have to specify these with
% every instance of \includegraphics
\DeclareGraphicsExtensions{.eps}
\fi

插入图片示例代码

\begin{figure*}[!t]
\centering
\includegraphics[width=5.5in]{figure_name}
% where an .eps filename suffix will be assumed under latex,
% and a .pdf suffix will be assumed for pdflatex; or what has been declared
% via \DeclareGraphicsExtensions.
\caption{Simulation results for the network.}
\label{fig:multi-channal GAN}
\end{figure*}

你可能感兴趣的:(IEEE,Latex,IEEE,Latex,无法插入图片)