自然包括图形

自然包括图形

我想知道如何修改nature.cls文件以包含图片。我注释了文件中的最后两行nature.cls,但编译返回错误。我将 和 图片分别提交.tex.bibNature。现在我只想在我的草稿中包含图片,然后我可以将我的草稿上传到 Arxiv。非常感谢。

答案1

该类nature.cls最后包含:

%% Redefine the figure and table environments.
%% The new figure environment defers printing of all figure captions
%% until the end of the document and prints them in sans serif font.
%% The \includegraphics command is ignored since Nature wants figures
%% as separate files.
%% The table environment was just changed to print on a separate page in
%% sans serif font.  Tables should all be moved to the end of the document
%% manually.

\renewenvironment{figure}{\let\caption\NAT@figcaption}{}

\newcommand{\NAT@figcaption}[2][]{\AtEndDocument{%
    \refstepcounter{figure}
    \ifthenelse{\value{figure}=1}{
        \newpage\noindent%
%        \rule{\textwidth}{1pt}
    }{
        \par\vfill
    }
    \sffamily\noindent\textbf{Figure \arabic{figure}}\hspace{1em}#2}
    }

\renewenvironment{table}{\@float{table}[p]\sffamily}{\end@float}

%% ignore all \includegraphics commands in the document
\AtBeginDocument{\let\includegraphics\NAT@ignore}

\newcommand{\NAT@ignore}[2][]{}

的含义是\includegraphics可以在之前保存\begin{document},之后恢复。环境figure也可以恢复:

\documentclass{nature}
\usepackage{graphicx}
\makeatletter
\let\saved@includegraphics\includegraphics
\AtBeginDocument{\let\includegraphics\saved@includegraphics}
\renewenvironment*{figure}{\@float{figure}}{\end@float}
\makeatother
\begin{document}
...
\end{document}

相关内容