4

i googled the problem and found that apparently nobody had issues with this before... I want to use compound names set up with the \iupac command of chemmacros in titles.

\documentclass{scrbook}

\usepackage{chemmacros}
\usechemmodule{all}

\begin{document}
 \chapter{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
  \section{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
   \subsection{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
    \subsubsection{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
     \paragraph{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
      \subparagraph{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
       \iupac{\trans-\N,\N'-\a-testo-weirdamide}
\end{document}

leaves me with this:

output \iupac in titles

Any way to activate the formatting in the title or do I have to let go of the \iupac command? I need the "trans" and the "N"s in italics.

1
  • 2
    \usepackage[T1]{fontenc} probably (assuming that you still want them in sans serif). Nov 4, 2020 at 16:31

1 Answer 1

6

You get a warning, namely

LaTeX Font Warning: Font shape `OT1/cmss/bx/it' undefined
(Font)              using `OT1/cmss/bx/n' instead on input line 7.

which means that sans serif boldface italic is not available with Computer Modern Sans.

You can switch to Latin Modern with \usepackage{lmodern} or to T1 encoding with \usepackage[T1]{fontenc}.

You may also want to load textgreek.

\documentclass{scrbook}
\usepackage[T1]{fontenc}

\usepackage{chemmacros}
\usepackage{textgreek}
\usechemmodule{all}
\chemsetup{greek=textgreek}

\begin{document}
 \chapter{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
  \section{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
   \subsection{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
    \subsubsection{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
     \paragraph{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
      \subparagraph{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
       \iupac{\trans-\N,\N'-\a-testo-weirdamide}
\end{document}

enter image description here

For Times, you can adjust textgreek to use Tempora, but don't use mathptmx, which is basically a big kludge.

\documentclass{scrbook}
\usepackage[T1]{fontenc}
\usepackage{newtxtext,newtxmath}

\usepackage{chemmacros}
\usepackage{textgreek}
\usechemmodule{all}
\chemsetup{greek=textgreek}

\renewcommand*{\textgreekfontmap}{
   {qhv/b/*}{LGR/cmss/bx/*}
   {qhv/*/*}{LGR/cmss/*/*}
   {*/*/*}{LGR/Tempora-TLF/*/*}}


\begin{document}
 \chapter{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
  \section{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
   \subsection{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
    \subsubsection{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
     \paragraph{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
      \subparagraph{\iupac{\trans-\N,\N'-\a-testo-weirdamide}}
       \iupac{\trans-\N,\N'-\a-testo-weirdamide}
\end{document}

enter image description here

3
  • Sorry, I overlooked that warning. I am using "mathptmx", which I omitted in the MWE. But the problem stays the same. Seems like I have to switch to the "boring" lmodern. Thank you for the swift answer!
    – bfalk
    Nov 4, 2020 at 17:29
  • 1
    @bfalk I added how to get a Times-like font.
    – egreg
    Nov 4, 2020 at 17:52
  • Thank you very much for the addition. I will check it out when I have more time. For the first try in my large document, I suddenly get the error that "\nhex" is already defined. Which is a command that I defined as a shortcut for myself, could it be added by those packages?
    – bfalk
    Nov 4, 2020 at 18:14

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.