I am using the chemscheme package and in order to replace numbering in these schemes I have in my document, I need to compile those eps files with latex, then dvips, and finally ps2pdf.
However, I have a very large number of images (upwards of 100, and it will only be increasing) that are perfectly fine to be used as the png they are in, or a precompiled pdf file. Since I need latex compilation for the chemscheme numbering, all those png or pdf images need to be in eps form, and it adds a solid 2-3 minutes to the compilation time.
Is there any solution for this type of situation?
I have read some solutions on here about packages like standalone and externalize but I confess to not fully understanding how to apply those solutions or if they even apply to this situation.
I thought I would add that without these extra images, my latex file compiles in about 30 secs, with the images it is now almost at 4 minutes compilation time :(
Here is an example of how the chemscheme package works (it is included as part of the chemstyle package. The file "reaction.eps" can be downloaded at the following link. The zip file also includes what the png looks like if you precompile it just on it's own (those TMP tags get replaced during the conversion process). The numbering commands \CNlabel and \CNlabelsub are sprinkled throughout the document, and they increment counters related to the compound numbering which is used in the replacement of the TMP tags within the images. However, only a handful of my images use these tmp tags and require this certain compilation. The rest have no TMP included and can be compiled externally without problem. In order to get the correct numbering, latex must be run twice, before calling dvips.
eps and pdf files: http://www.filedropper.com/reaction_1
\documentclass{article}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{bpchem}
\usepackage[tracking=bpchem]{chemstyle}
\begin{document}
I am a document about methanol (\CNlabelsub{alcohol}{Me}), and the related alcohol isoamyl %
alcohol (\CNlabelsub{alcohol}{isoamy}). \CNlabelsub{alcohol}{Me} can be converted to an alkyl %
halide with \BPChem{HCl} to give chloromethane (\CNlabel{MeCl}, \ref{sch:reaction}).
\begin{scheme}
\caption{I am a scheme}\label{sch:reaction}
\schemerefsub{alcohol}{Me}
\schemerefsub{alcohol}{isoamy}
\schemeref{MeCl}
\includegraphics{reaction}
\end{scheme}
\end{document}
Update, possible solution, but not quite finished
From Garbage Collector's answer, it did occur to me. I can provide a premade list of all the compounds in the document with a command \CNlabelnoref and \CNlabelsubnoref. I have done that, and below is a MWE using the standalone package. However, I now get an error a whole list of errors beginning at the \begin{figure} line, the first one being
LaTeX Error: Something's wrong--perhaps a missing \item.
\documentclass[border=0pt]{standalone}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{bpchem}
\usepackage[journal=rsc,tracking=bpchem]{chemstyle}
\renewcommand*{\schemerefformat}{\small\fontfamily{cmr}}
\newcommand{\chemdrawgraphic}[1]{\includegraphics[scale=1]{#1}}
\setcounter{BPCno}{200}
\CNlabelsubnoref{alcohol}{Me}
\CNlabelsubnoref{alcohol}{isoamy}
\CNlabelnoref{MeCl}
\begin{document}
\begin{figure}
\schemerefsub{alcohol}{Me}
\schemerefsub{alcohol}{isoamy}
\schemeref{MeCl}
\chemdrawgraphic{reaction}
\end{figure}
\end{document}
externalizeseems to mean theexternallibrary oftikz. That seems to be unrelated tochemscheme(at least tikz is not listed in its package dependencies). – Christian Feuersänger Aug 31 '12 at 20:59chemschemepackage uses temporary text holders in the eps file which are later replaced during the compilation ps conversion with numbers from the document. Compilation directly to pdf bypasses this and result in the temporary text holders not being replaced. – J M Sep 01 '12 at 08:24