3

How can I use the \D or \iupac{\D} command from chemmacros package in a \paragraph environment? The result I get is a lower case d instead of the D- for the Fischer stereo descriptor.

\documentclass[a4paper]{scrreprt}  
\usepackage{chemmacros}  

\begin{document}  
\paragraph{\D-Proline}  
\end{document}
  • 1
    Are you sure, that the font you are using does actually have a bold-face+smallCaps letter D. Try loading package libertine and test again. – Johannes_B Mar 9 '14 at 8:46
  • 1
    Welcome to TeX.SX. Please give as a minimal working example which makes it much easier for us to help. Just your documentclass, the paragraph, your macro... – LaRiFaRi Mar 9 '14 at 10:20
  • Ok, thanks, I suppose I am using an inappropriate document class/font to include this type of character in titles/paragraphs... is there a possibility to include the Fischer descriptors anyway or is it best to use another document class or font? – hnina Mar 9 '14 at 11:43
  • 1
    As @Johannes_B says, the issue here isn't \D or chemmacros per se, but the fact that your document class is picking a font which doesn't have sanserif bold small caps. The question then is what you want to change: the font, the use of sanserif, ... – Joseph Wright Mar 9 '14 at 11:53
  • BTW, you do know that \paragraph is (a) a command, not an environment and (b) a sectioning command like \section or \chapter, yes? – Joseph Wright Mar 9 '14 at 11:58
8

As already noted in the comments the “problem” is that you don't use a font with bold sans serif small caps. Indeed, your example produces in the log file

LaTeX Font Warning: Font shape `OT1/cmss/bx/sc' undefined

You have a few choices to circumvent the issue:

  • use a font that has bold face sans serif small caps (such as Linux Biolinum, the accompanying sans serif to Linux Libertine, for example)

    \documentclass[a4paper]{scrreprt}  
    \usepackage[T1]{fontenc}
    \usepackage{libertine} % <<<<
    
    \usepackage{chemmacros}  
    
    \begin{document}  
    \paragraph{\iupac{\D-Proline}}  
    \end{document}
    
  • use standard fonts but change the headings fonts from sans serif to serif

    \documentclass[a4paper]{scrreprt}  
    \usepackage[T1]{fontenc}
    \setkomafont{sectioning}{\bfseries} % <<<<
    
    \usepackage{chemmacros}  
    
    \begin{document}  
    \paragraph{\iupac{\D-Proline}}  
    \end{document}
    
  • change the definitions of \D to \L so they don't use small caps any more, e.g. with the relsize package:

    \documentclass[a4paper]{scrreprt}  
    \usepackage[T1]{fontenc}
    
    \usepackage{relsize} % <<<<
    \usepackage{chemmacros}  
    \RenewChemIUPAC\D{\textsmaller{D}} % <<<<
    \RenewChemIUPAC\L{\textsmaller{L}} % <<<<
    
    \begin{document}  
    \paragraph{\iupac{\D-Proline}}  
    \end{document}
    

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.