4

I'm using Chemstyle to label the compounds in my thesis and am using the a \renewcommand to re-size the labels. However, this seems to change the font as well. I need the numbers to be in Arial 8 pt or another non-serif font.

Here's an example:

    \documentclass[11pt,oneside,a4paper]{report}
    \usepackage[left=4.0 cm,right=2.0 cm,top=2.0 cm,bottom=2.0 cm]{geometry}
    \usepackage{graphicx}
    \usepackage{chemstyle} 
    \renewcommand*{\schemerefformat}{\fontsize{5pt}{6pt}\textbf{}} %set size of chemlabels


    \begin{document}

    \leavevmode\compound*{cmpd1}
    \compound*{cmpd2}
    \compound*{cmpd4}

   Arene \compound{cmpd1} was used to obtain a diastereomeric mixture upon complexation that was easily separable by column chromatography (\ref{sch2}). After hydrolysis of the ester the two enantiomeric complexes \textit{pS}-\compound{cmpd4} and \textit{pR}-\compound{cmpd4} were obtained.

    \begin{scheme}[htbp]
    \centering
    \caption{Chiral resolution.}
    \schemeref[TMP1]{cmpd1}
    \schemeref[TMP2]{cmpd2}
    \schemeref[TMP4]{cmpd4}
    \includegraphics[width=0.82\textwidth]{1-3.eps}
      \label{sch2}
    \end{scheme}

    \end{document}

And the output: enter image description here

Here's the dropbox link to the MWE if needed: Dropbox Folder with example and image

  • edit: Accidentally added the jpg instead of the eps to the dropbox - fixed now! – Ann.KK Aug 12 '14 at 22:43
2

You don't need to add bold formatting via \schemerefformat – setting the labels bold is done by the underlying package that provides the numbering of compounds. Unless specified otherwise this is the chemcompounds package. \schemerefformat adds additional formatting for the labels in schemes. Per default its definition is

\newcommand*\schemerefformat{\textsf}

i.e. it uses sans serif font for the labels in schemes. Note that it uses \textsf without the trailing argument. Your definition

\renewcommand*{\schemerefformat}{\fontsize{5pt}{6pt}\textbf{}}

does not use sans serif which is why you're getting none. Also \textbf{} has no effect since you've added an empty argument to \textbf. The labels still are bold since as I've said above this is done by chemcompounds.

You need a definition like

\renewcommand*\schemerefformat{\tiny\textsf}

Also a definition using \sffamily (a font switch without argument) would do:

\renewcommand*\schemerefformat{\tiny\sffamily}

Since I couldn't find the EPS in the Dropbox link you provided I use a different scheme for the following example:

% arara: pdflatex: { shell: on }
% arara: pdflatex: { shell: on }
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{chemstyle} 

\usepackage[runs=2]{auto-pst-pdf}

\begin{document}

\compound{cmpd1,cmpd2}

\begin{scheme}[htbp]
  \centering
  \caption{First example}
  \schemeref[TMP1]{cmpd1}
  \schemeref[TMP2]{cmpd2}
  \includegraphics{scheme-tmp.ps}
\end{scheme}

\renewcommand*{\schemerefformat}{\tiny\textsf}
\begin{scheme}[htbp]
  \centering
  \caption{Second example}
  \schemeref[TMP1]{cmpd1}
  \schemeref[TMP2]{cmpd2}
  \includegraphics{scheme-tmp.ps}
\end{scheme}

\renewcommand*{\schemerefformat}{\footnotesize\itshape\sffamily}
\begin{scheme}[htbp]
  \centering
  \caption{Third example}
  \schemeref[TMP1]{cmpd1}
  \schemeref[TMP2]{cmpd2}
  \includegraphics{scheme-tmp.ps}
\end{scheme}

\end{document}

enter image description here

  • Worked like a charm. Any chance to change the font of the labels to Helvetica? (Sorry, supervisor demands...) – Ann.KK Aug 12 '14 at 22:58
  • Only the label font or all sans serif text? – clemens Aug 13 '14 at 6:29
  • Only the label font. I'd like to keep the rest of the text in regular Computer Modern. – Ann.KK Aug 13 '14 at 9:03
  • Of course, but there might be other places where you have sans serif, e.g., headings... – clemens Aug 13 '14 at 9:06
  • 1
    Then \usepackage{helvet} should suffice – clemens Aug 13 '14 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.