我已将照片格式化为 PDF,但似乎无法正常工作。以下是相关代码(我使用的是 IEEE 裸期刊模板和IEEEtran
带有选项的类journal
)。
以下是文档中的代码,其中以点表示填充符:
\documentclass[journal]{IEEEtran}
...
\ifCLASSINFOpdf
\usepackage[pdftex]{graphicx}
\else
\fi
...
\begin{document}
...
% biography section
%
% If you have an EPS/PDF photo (graphicx package needed) extra braces are
% needed around the contents of the optional argument to biography to prevent
% the LaTeX parser from getting confused when it sees the complicated
% \includegraphics command within an optional argument. (You could create
% your own custom macro containing the \includegraphics command to make things
% simpler here.)
\begin{IEEEbiography}[{\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{mshell}}]{Michael Shell}
% or if you just want to reserve a space for a photo:
\begin{IEEEbiography}{Michael Shell}
Biography text here.
\end{IEEEbiography}
...
\end{document}
我已取消注释该宏行以使用它,但它似乎对我不起作用(是的,我在正确的路径中有一个 mshell pdf 图像作为测试)。这是有问题的行(注释掉它会使错误消失):
\begin{IEEEbiography}[{\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{mshell}}]{Michael Shell}
我收到此错误:
<mshell.pdf, id=1, 72.27pt x 90.3375pt> <use mshell.pdf> <use mshell.pdf>
! TeX capacity exceeded, sorry [main memory size=5000000].
\par ->\hfil \penalty -\@M
\indent
l.685 \begin{IEEEbiography}{Michael Shell}
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on Heuristic_Paper.log.
PDF 图像只有 77KB - 我知道我以前在 TeX 文件中使用过更大的图像,没有出现内存问题。
答案1
你有两条\begin{IEEEbiography}
线:
\begin{IEEEbiography[{\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{mshell}}]{Michael Shell}
\begin{IEEEbiography}{Michael Shell}
环境IEEEbiography
不能嵌套。删除第二行,编译结果将正确。
\documentclass[journal]{IEEEtran}
\usepackage{graphicx}
\begin{document}
\begin{IEEEbiography}
[{\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{mshell}}]{Michael Shell}
Biography text here.
\end{IEEEbiography}
...
\end{document}
答案2
代码没有问题,只要把文件名的扩展名记下来就可以了。
下面的代码应该可以工作。
\begin{IEEEbiography}[{\includegraphics[width=1in,height=1.25in,clip,keepaspectratio]{mshell.pdf}}]{Michael Shell}