1

Good evening,

I am using \setlabel from the chemnum package to rename some of my figures and make them contain references to other labelled compounds (\cmpd).

\documentclass[a5paper, 11pt, headinclude, footinclude, headsepline, footsepline, DIV10, twoside, openright]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{chemnum}

\begin{document}
\begin{center}
\replacecmpd{I}
\replacecmpd{I_II}\setcmpdlabel{I_II}{\cmpd{I}\_\cmpd{II}}
\replacecmpd{II}
    \includegraphics{60-CO2-HCOOH/Abbildungen/ameisensaure-rgl}
\captionof{figure}{caption}
\label{fig:formic-acid}
\end{center}
\end{document}

I know how to change the fontsize within the graphics I am setting labels for (I am using \setchemnum{format =\tiny, replace-style =\sffamily}). Now, How can I adapt the label size used in the text? At the moment, all the labels set by \setcmpdlabel are smaller than the rest of the labels. adjusting one of the sizes would suffice for me to unify the style a little.

Thanks a million for you help!!

1
  • @clemens Thanks for editing the question. Did you have an anwer to the question as well?
    – TheMaus
    Nov 19, 2019 at 12:13

1 Answer 1

1

chemnum neither provides \setlabel nor \setcmpdlabel. I guess you refer to a suggestion of mine to another question here on tex.sx: Defining own labels with chemnum 1.0 where I defined a macro \setcmpdlabel. I'll use it for this answer, too.

Since format changes the style of all labels but replace-style only the ones replaced in eps files you just need

\setchemnum{ replace-style = \tiny\sffamily }

Keep in mind that replace-style acts in addition to and before format.

\documentclass[a5paper, 11pt]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{chemnum}
\usepackage{graphicx}
\usepackage{auto-pst-pdf}

\ExplSyntaxOn
\NewDocumentCommand \setcmpdlabel {mm}
  { \chemnum_compound_set_property:nnn {#1} {counter-representation} {#2} }
\ExplSyntaxOff

\setchemnum{ replace-style = \tiny\sffamily }

\begin{document}

\cmpd{I} xxx \cmpd{II}

\begin{center}
  \replacecmpd{I}
  \replacecmpd{I_II}\setcmpdlabel{I_II}{\cmpd{I}\_\cmpd{II}}
  \includegraphics{scheme-tmp.ps}
  \captionof{figure}{caption}
  \label{fig:formic-acid}
\end{center}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .