Math & Sciencebpchem, chemscheme | No Substitutions of temporary Labels

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
hoytesara
Posts: 13
Joined: Sat Feb 18, 2012 10:46 am

bpchem, chemscheme | No Substitutions of temporary Labels

Post by hoytesara »

I'm trying to number compounds in schemes, using chemscheme and bpchem. However, I can't get it to replace my temporary labels. The code I'm using is:

Code: Select all

\documentclass{article}

\usepackage[pdftex]{graphicx}	
\usepackage{bpchem}
\usepackage{chemscheme}				

\begin{document}

\begin{scheme}[htb]
\begin{center}
\schemerefsub[TMP1]{PtBCPPP}{a}
\schemerefsub[TMP2]{PtBCPPP}{b}
\schemerefsub[TMP3]{PtBCPPP}{c}
\schemerefsub[TMP4]{PtBCPPP}{d}
\includegraphics{schemes/ch2p1a}
\caption{Synthesis of [Pt(BCP)(P---P)] and [Pt(MCP)(P---P)]} 
\label{sch:ch2p1}
\end{center}
\end{scheme}

\end{document}
I've also tried adding using \usepackage[tracking=bpchem]{chemscheme}, but get an error saying "Value `bpchem' is not supported by option `tracking' ". I'm using pdflatex, but my graphic file is an eps. What am I doing wrong?
Attachments
ch2p1a.eps
(15.96 KiB) Downloaded 622 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

bpchem, chemscheme | No Substitutions of temporary Labels

Post by localghost »

The pdftex driver option for the graphicx package and the EPS file format usually don't go together. Drop the driver option and compile with LaTeX (perhaps with further conversion to PS and PDF).

If you are running a current version of the common TeX distributions (TeX Live 2011, MiKTeX 2.9), EPS files are converted automatically to PDF while compiling with PDFLaTeX. But presumably the replacement won't work either.


Thorsten
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

bpchem, chemscheme | No Substitutions of temporary Labels

Post by cgnieder »

Hello,

Maybe add

Code: Select all

\usepackage[runs=2]{auto-pst-pdf}
to your preamble to ensure postscript support with pdflatex. The document would need to be compiled with pdflatex --shell-escape your-doc.tex then.

I don't want you to change packages “mid-document” but I honestly believe the package chemnum (which I already suggested here) will make things easier, especially regarding sublabels. Your code would look like this:

Code: Select all

\documentclass{article}

% ensure postscript support, needs to be compiled with »--shell-escape«:
\usepackage[runs=2]{auto-pst-pdf}

\usepackage{graphicx}
\usepackage{chemnum}
\cmpdsetup{sub-input-sep=!}
\usepackage{chemscheme}

\begin{document}

\begin{scheme}[htb]
  \centering
  \cmpdref{PtBCPPP!a}
  \cmpdref{PtBCPPP!b}
  \cmpdref{PtBCPPP!c}
  \cmpdref{PtBCPPP!d}
  \includegraphics{schemes/ch2p1a}
  \caption{Synthesis of [Pt(BCP)(P---P)] and [Pt(MCP)(P---P)]}
  \label{sch:ch2p1}
\end{scheme}
\end{document}
Regards
site moderator & package author
hoytesara
Posts: 13
Joined: Sat Feb 18, 2012 10:46 am

bpchem, chemscheme | No Substitutions of temporary Labels

Post by hoytesara »

When I added \usepackage[runs=2]{auto-pst-pdf} to my thesis preamble, I got

Code: Select all

pdfTeX error: /usr/texbin/pdflatex (file ./thesis-pics.pdf): PDF inclusion: required page does not exist <32>
 ==> Fatal error occurred, no output PDF file produced
I also tried using chemnum before I went to bpchem, but it wouldn't download with the \usepackage command, and as I've only been using LaTeX for about 2 weeks, I went with the one that worked at the time. As I now keep coming across all these issue I probably should have figured out how to get it working...
Last edited by cgnieder on Fri Dec 28, 2012 5:09 pm, edited 1 time in total.
hoytesara
Posts: 13
Joined: Sat Feb 18, 2012 10:46 am

Re: bpchem, chemscheme | No Substitutions of temporary Label

Post by hoytesara »

As I mentioned, I've only been doing this for about two weeks, so forgive me if I'm giving the wrong info.

I'm using TeXShop, in pdftex mode, compiling with latex (and bibtex). My thesis has figures that are both from eps and pdf files that have come up fine in the output pdf, with no errors during compiling.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

bpchem, chemscheme | No Substitutions of temporary Labels

Post by cgnieder »

So you are using latex (producing a dvi file) and afterwards convert the file to pdf? Or (as I suspect) you use pdflatex which produces the pdf file directly?

In the fist case eps-files should be no problem. In the latter you need to use --shell-escape in order to get auto-pst-pdf to produce the to be included pdf-pictures.

Besides this there could be another cause: the »TMP1« (and friends) need to be saved as text strings in the eps. If they're not neither chemscheme nor chemnum have any chance. You can easily find out if this is the cause by opening the eps in a a text editor and searching for the string »TMP1«.
site moderator & package author
hoytesara
Posts: 13
Joined: Sat Feb 18, 2012 10:46 am

Re: bpchem, chemscheme | No Substitutions of temporary Label

Post by hoytesara »

I'm using pdflatex to produce the pdf file directly.

In that case, how do I use shell escape?

The TMP labels are there as text strings, so that's not the issue.

Thanks!


Sarah
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

bpchem, chemscheme | No Substitutions of temporary Labels

Post by cgnieder »

Hmm, a quick web search (I never used TeXshop myself) says it should be enabled as default setting.
The pdflatex engine used by TeXShop already has the --shell-escape option set by default. Take a look at TeXShop->Preferences->Engine->PdfTeX->Latex for the command used.
site moderator & package author
hoytesara
Posts: 13
Joined: Sat Feb 18, 2012 10:46 am

Re: bpchem, chemscheme | No Substitutions of temporary Label

Post by hoytesara »

It looks like I am already using shell escape... a quandary!
hoytesara
Posts: 13
Joined: Sat Feb 18, 2012 10:46 am

Re: bpchem, chemscheme | No Substitutions of temporary Label

Post by hoytesara »

I've switched from pdftex to dvi -> pdf and the numbering is working fine now. I'll have to go back and change about 5 of my figures into different formats, but since I've got 4 chapters with numbered schemes ahead of me, I think this way there'll be far less work!

Thanks!


Sarah
Post Reply