Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sublabels not shown within \psfrag{}{} #6

Open
lcnittl opened this issue Nov 22, 2017 · 3 comments
Open

Sublabels not shown within \psfrag{}{} #6

lcnittl opened this issue Nov 22, 2017 · 3 comments
Assignees
Labels

Comments

@lcnittl
Copy link

lcnittl commented Nov 22, 2017

I came across a problem using \cmpd+{} to substitute sublabels inside a \psfrag command. Interestingly, this is no problem using \replacecmpd{main.sub}, however, using \cmpd+{main.sub} outputs 2 questionmarks as the sublabel.

The whole thing works fine for mainlabels.

\documentclass{article}

\usepackage{graphicx}
\usepackage{auto-pst-pdf}
\usepackage{chemnum}

\begin{document}
  Using chiral alcohol \cmpd+{cmpd1.1} to get chiral ether \cmpd+{cmpd1.2}.
  
  \begin{figure}
    \centering
    \cmpd*{cmpd1.1}
    \psfrag{TMP1}[Bc][Bc]{Chiral molecule \cmpd+{cmpd1.1}}
    \replacecmpd[tag=TMP2]{cmpd1.2}
    \includegraphics[scale=1]{scheme-tmp.ps}
    \caption{Working here (\cmpd+{cmpd1.1}), however, not in psfrag. The second one (\cmpd+{cmpd1.2}) is working in both.}
  \end{figure}
\end{document}

image

Would you have an idea why this is happening, or how to solve this?

@lcnittl
Copy link
Author

lcnittl commented Dec 5, 2017

Seems that a missing runs=2 option for auto-pst-pdf packages caused this behaviour.

@cgnieder
Copy link
Owner

cgnieder commented Oct 2, 2019

There is a subtle difference between both use cases:

\replacecmpd{cmpd1.1} is basically the same as \cmpd*{cmpd1.1}\psfrag{TMP1}{\cmpd{cmpd1.1}}. You are using \cmpd*{cmpd1.1}\psfrag{TMP1}{\cmpd+{cmpd1.1}}.

It seems this slight difference means that two auxiliary compilations are needed instead of one.

BTW: with \cmpd*{cmpd1.1}\replacecmpd+{cmpd1.1} the sublabel wouldn't show, either.

This is a bug, but I haven't found the cause, yet. And since you found an easy fix for the time being I'll put this on hold.

@cgnieder cgnieder self-assigned this Oct 2, 2019
@cgnieder cgnieder added the bug label Oct 2, 2019
@markellos918
Copy link

markellos918 commented Nov 12, 2019

I have a similar problem. I've been trying to tweak xr to recognise \cmpd labels (see here) – by the way, this could be a good feature to implement in the future. All is fine until I try to use \submaincmpdplain or \cmpd+, for example in section titles. With the first command it doesn't print the sub label at all, with the second it prints ??. This only happens with labels imported from a different document, which I think is equivalent to predefine them in the preamble. Can you please look into this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants