# How to change fontsize of \cmpdref

I was using chemstyle package, but for some utilities I moved to chemnum. With chemstyle I used

\renewcommand*{\schemerefformat}{\fontsize{8pt}{8pt}\textbf{}}


in order to reduce the font size of numbers in schemes. I couldn't find this option or equal in chemnum which use \cmpdref{key} to label a molecule.

Is there a way reduce the font size in \cmpdref?

-
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces or enclose words in backticks , they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). – Joseph Wright Jul 24 '12 at 20:42
I'll do it next time, Thanks. – Thomas C Jul 24 '12 at 20:44
Can you add an example of usage? With a \documentclass command and the necessary packages. – egreg Jul 24 '12 at 20:58

For versions prior to version 1.0

In the chemnum package the format is controlled by three options: cmpd-style and ref-style which control the standard form and the form placed with \cmpdref and cmpd-weight which sets the labels bold or normal for both. All of them can be set with \cmpdsetup:

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[runs=2]{auto-pst-pdf}
\usepackage{chemnum}
\usepackage{relsize}

\cmpdsetup{
cmpd-style=\textsmaller,
ref-style=\sffamily\textsmaller,
cmpd-weight=normal}

\begin{document}

Text \cmpd{blah} Text

\cmpdref{test}
\cmpdref{blub}
\includegraphics{./scheme-tmp.ps}

\end{document}


For version 1.0

With version 1.0 (released 2014/03/12) there have been a number of changes both to commands and options. Here is a solution for version 1.0:

% arara: pdflatex: { shell: on }
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[runs=2]{auto-pst-pdf}
\usepackage{chemnum}
\usepackage{relsize}

\setchemnum{
format = \smaller ,
replace-style = \sffamily , % this acts /additionally/ to format!
}

\begin{document}

Text \cmpd{blah} Text

\replacecmpd{test}
\replacecmpd{blub}
\includegraphics{./scheme-tmp.ps}

\end{document}
`
-
It works fine, thanks – Thomas C Jul 24 '12 at 21:51