Math & Sciencechemstyle | Compound Numbering in Schemes

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Rambuch
Posts: 4
Joined: Wed Dec 07, 2011 7:45 am

chemstyle | Compound Numbering in Schemes

Post by Rambuch »

Hello everyone,

I've been trying to get chemstyle to number my compounds for quite some time without any luck. I tried a lot of different solutions without luck. The problem is that whenever I compile I get a nice pdf but without any autonumbering only the labels, "TMP", I gave the compounds will appear. I used chemdraw to create the EPS with the TMP labels.

I can see that it generates a PDF picture called ...-eps-converted-to.pdf with the TMP as labels. I also tried to enable write18, compile with "LaTeX => PDF" and "LaTeX => PS => PDF" profiles.

The most weird thing is that I send a MWE to a friend who didn't have any problems making the labels work. After discovering this I also updated my TeXnicCenter and MiKTeX to the latest version, still with no luck.

MWE looks as follows, a version is also attached along with the EPS file and the PDF I get after compiling.

Code: Select all

\documentclass[english,12pt,a4paper,twoside]{report}
\usepackage{graphicx,epstopdf,psfrag,chemstyle}
%\usepackage[runs=2]{auto-pst-pdf}

\begin{document}

\begin{scheme}[ht]
\centering
\schemeref{afctxx}
\schemeref{iafct}
\schemeref{dafct} 
\includegraphics{afct} 
\caption{General AFCT process}
\label{sch:afct-process}
\end{scheme}

\end{document}
In advance thanks for any help.


Cheers
Rasmus
Attachments
AFCT.eps
three compounds labeled with TMP1-3
(17.35 KiB) Downloaded 411 times
MWE.tex
(385 Bytes) Downloaded 397 times
MWE.pdf
pdf after compiling
(14.39 KiB) Downloaded 360 times

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

chemstyle | Compound Numbering in Schemes

Post by cgnieder »

It seems you have to leave out the epstopdf package. The \psfrag command used by chemscheme replaces the TMP string in the eps file.

Code: Select all

\documentclass[english,12pt,a4paper,twoside]{report}
\usepackage{chemstyle}
% \usepackage{epstopdf} doesn't work when used
\usepackage[runs=2]{auto-pst-pdf}
\begin{document}

\begin{scheme}[ht]
\centering
\schemeref{afctxx}
\schemeref{iafct}
\schemeref{dafct}
\includegraphics[scale=.8]{AFCT.eps}
\caption{General AFCT process}
\label{sch:afct-process}
\end{scheme}

\end{document}
site moderator & package author
Rambuch
Posts: 4
Joined: Wed Dec 07, 2011 7:45 am

chemstyle | Compound Numbering in Schemes

Post by Rambuch »

thanks for the quick reply.
If I do that with Latex=> pdf I'll get a error saying

Code: Select all

File ´MWE-pics.pdf´not found
and with the Latex=>ps=> pdf it won't show the picture but will come up with a square box saying MWE-pics.pdf instead of the picture .
I can see from a DVI file generated somewhere in the process that it tries to replace the TMP but they are not in the right place and it does not show on the pdf.
Attachments
MWE.dvi
(1.21 KiB) Downloaded 397 times
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Re: chemstyle | Compound Numbering in Schemes

Post by cgnieder »

I can not reproduce that error but a similar one, if I rename the the picture. I have noticed though, that you called the picture "AFCT.eps" but had the line "\includegraphics{afct}" (with lowercase letters) in your example.
Also you need to run latex with shell-escape (or write18) enabled.

Is there a reason, why you're not using pdflatex, but latex -> dvips -> ps2pdf?
site moderator & package author
Rambuch
Posts: 4
Joined: Wed Dec 07, 2011 7:45 am

chemstyle | Compound Numbering in Schemes

Post by Rambuch »

I tried to change to uppercase letters with no effect and I have write18 enabled in "command line arguments to pass to the compiler" by the following

Code: Select all

--enable-write18 -interaction=nonstopmode "%pm"
Normally I use pdflatex but since my friend got it to work with Latex=>ps=> pdf I have been trying with both output profiles whenever I change something.
Rambuch
Posts: 4
Joined: Wed Dec 07, 2011 7:45 am

chemstyle | Compound Numbering in Schemes

Post by Rambuch »

I found the source of the problem which was the pdfcrop, so a solution is to use the following code to turn pdfcrop off

Code: Select all

\usepackage[crop={off},runs={2}]{auto-pst-pdf}
As far as I could tell it has something to do with a Perl script that is supposed to cut the white edges of the generated pdf.
dave8927
Posts: 2
Joined: Sat Jul 21, 2012 6:42 pm

chemstyle | Compound Numbering in Schemes

Post by dave8927 »

I am having a similar problem.

I am running pdflatex from the terminal as:

Code: Select all

pdflatex -shell-escape untitled.tex
Following the above - end up with a error message:

Code: Select all

! Package pdftex.def Error: File `untitled-pics.pdf' not found.
The resulting pdf displays a blank box with untitled-pics.pdf across it.

Code: Select all

\documentclass[a4paper]{article}
\usepackage{a4wide}
\usepackage[nodayofweek]{datetime}
\usepackage{parskip}
\usepackage{wrapfig}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{graphicx}
\usepackage[version=3]{mhchem}
\usepackage[crop=off,runs=2]{auto-pst-pdf}
\usepackage{chemstyle}

\begin{document}

\section{section title here}

Refer to compounds \compound{cmpd_A} and \compound{cmpd_B}

\begin{scheme}
	\begin{center}
		\schemeref[TMP1]{cmpd_A}
		\schemeref[TMP2]{cmpd_B}
		\includegraphics{hexa.eps}
	\end{center}
\end{scheme}

\end{document}
Any help would be greatly appriciated.

Dave
Attachments
hexa.eps
(20.41 KiB) Downloaded 380 times
untitled.tex
(709 Bytes) Downloaded 365 times
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Re: chemstyle | Compound Numbering in Schemes

Post by cgnieder »

Your example runs fine for me (TeX Live 2012 on a Linux system). What TeX distribution are you using?
site moderator & package author
dave8927
Posts: 2
Joined: Sat Jul 21, 2012 6:42 pm

chemstyle | Compound Numbering in Schemes

Post by dave8927 »

I'm using Tex Live 2012 on OS X. This http://tug.org/mactex/
Post Reply