4

I'm really new to LaTeX, and even newer to this website, so forgive me in advance for all the mistakes I may have made.

Here's my problem: I'm trying to replace the temporary labels (TMP1,...) in an .eps file (made with chemdraw), in a modus operandi chapter for my master thesis, and it doesn't work the way it should. The TMP labels indeed disappear, but the 1,2 and 3 expected to replace them appear on the left of the figure, not at all where they should be. Moreover, there's also a message saying "frag replacements", appearing on the graph in the dvi file. When I try to export it as pdf, it doesn't even change the labels and I get stuck with TMP1,2,3.

Here is the code:

\documentclass[a4paper,12pt,notitlepage]{book}


%Packages

\usepackage[utf8]{inputenc}
\usepackage[francais]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{epstopdf}
%chemistry packages
\usepackage{chemstyle}
\usepackage{chemscheme}
\usepackage{chemschemex}
\usepackage{chemnum}

\usepackage{titling}
\usepackage{titlesec}    %to correct spacing of chapters
        \titleformat{\chapter}[display]   
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}   
\titlespacing*{\chapter}{0pt}{-50pt}{20pt}
    \titleformat{\chapter}[hang] 
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter:}{1em}{}



%Titre
\title{Partie expérimentale}
\author{Me}


\begin{document}

\chapter{Partie Expérimentale}
\section{Synthèse du thiéno[3,2-b]thiophène-2,5-diylbis((3-bromothiophèn-2-yl)méthanol)}

\begin{scheme}[ht]

\cmpd*{a}
\cmpd*{b}
\cmpd*{c}

   \replacecmpd[TMP1]{a}
    \replacecmpd[TMP2]{b}
    \replacecmpd[TMP3]{c}
    \includegraphics[scale=0.7]{Schema_Synthese_3.eps}

        \caption{Schéma réactionnel 1}

\end{scheme}


\end{document}

And it gives the following result : enter image description here

Could you help me ?

EDIT: here is the .eps file

DRi
  • 847
Allan
  • 51

1 Answers1

4

The results you are seeing come from not compiling the document file correctly. The following workflow will provide a pdf file with the labels replaced

latex file
dvips file -o
pstopdf file.ps

The output is then in file.pdf. Alternatively you can remove the epstopdf package and load the auto-pst-pdf package, with

\usepackage{auto-pst-pdf}

in your preamble, and then compile simply with

pdflatex -shell-escape file

Sample output

\documentclass[a4paper,12pt,notitlepage]{book}


%Packages

\usepackage[utf8]{inputenc}
\usepackage[francais]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx,auto-pst-pdf}
%\usepackage{epstopdf}
%chemistry packages
\usepackage{chemstyle}
\usepackage{chemscheme}
\usepackage{chemschemex}
\usepackage{chemnum}

\usepackage{titling}
\usepackage{titlesec}    %to correct spacing of chapters
        \titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{-50pt}{20pt}
    \titleformat{\chapter}[hang]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter:}{1em}{}



%Titre
\title{Partie expérimentale}
\author{Me}


\begin{document}

\chapter{Partie Expérimentale}
\section{Synthèse du thiéno[3,2-b]thiophène-2,5-diylbis((3-bromothiophèn-2-yl)méthanol)}


\cmpd*{a}
\cmpd*{b}
\cmpd*{c}

\begin{scheme}[ht]
   \replacecmpd[TMP1]{a}
    \replacecmpd[TMP2]{b}
    \replacecmpd[TMP3]{c}
    \includegraphics[scale=0.7]{Schema_Synthese_3.eps}

        \caption{Schéma réactionnel 1}

\end{scheme}


\end{document}
Andrew Swann
  • 95,762
  • Thank you. I was forced to answer below because it was too big for just this comment section, as other problems arose. – Allan Feb 16 '17 at 14:43
  • If you compile with pdflatex directly, you might have to use \usepackage[crop=off,runs=2]{auto-pst-pdf} – Simon N. Oct 15 '20 at 09:35