0

Just noticed that adding \scriptstyle{\oplus} or \scriptsize{\oplus} doesn't actually change anything. I'm not sure if I have been using the command wrong (I'm trying to decrease the size of the \oplus), since I've included it in a lot of my other mechanisms. Thanks in advance for any suggestions on this.

Edit: Clarified the effect I expected to see Edit 2: Changed incorrect charge on N from - to +

\documentclass{article}
\usepackage{graphicx}
\usepackage{chemfig}
\usepackage{geometry}
\usepackage{tabu}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{chemmacros}
\usetikzlibrary{arrows}

\title{}
\author{}
\date{}

\begin{document}

\maketitle

\chemfig{-[:30]-[:-30]N^{\scriptstyle{\oplus}}H_3}
\chemfig{-[:30]-[:-30]N^{\scriptsize{\oplus}}H_3}

\chemfig{-[:30]-[:-30]N^{\oplus}H_3}

\end{document}
6
  • 1
    neither \scriptstyle nor \scriptsize take an argument so the following {..} are wrong. Superscripts are already in \scriptstyle so that would not be expected to do anything in a superscript, size commands like \scriptsize are not allowed in math mode. You have not said what effect you expected to see? Nov 15, 2021 at 21:03
  • 1
    LaTeX Font Warning: Command \scriptsize invalid in math mode on input line 21. Nov 15, 2021 at 21:05
  • My bad, I thought it would decrease the size of the \ominus as I previously used it to decrease the size of a delta+ symbol Nov 15, 2021 at 21:06
  • 1
    as I say \scritptsize is an error and \scriptstyle selects the math style used in superscripts, If it reduced the size of a delta it was presumably not in a superscript. but \scriptstyle{\delta} abc makes all of \delta a b and c superscript sized. Nov 15, 2021 at 21:08
  • could I ask how I could scale the \ominus then? or could I just use scalebox{} Nov 15, 2021 at 21:10

2 Answers 2

1

enter image description here

\scriptsize is invalid in math mode (and the syntax is \scriptsize abc not \scriptsize{a}bc) You get the warning

LaTeX Font Warning: Command \scriptsize invalid in math mode on input line 21.

\scriptstyle also does not take an argument but selects the size used in superscripts, so does nothing here. You can select scriptscriptstyle which is the smallest of the three math styles.

\documentclass{article}
\usepackage{graphicx}
\usepackage{chemfig}
\usepackage{geometry}
\usepackage{tabu}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{chemmacros}
\usetikzlibrary{arrows}

\title{}
\author{}
\date{}

\begin{document}

\maketitle

\chemfig{-[:30]-[:-30]N^{\scriptscriptstyle \ominus}H_3}


\chemfig{-[:30]-[:-30]N^{\ominus}H_3}

\end{document}
2
  • Thanks so much for this! Nov 15, 2021 at 21:13
  • 3
    @GenericAccount unrelated by tabu is broken in current latex and unmaintained. Nov 15, 2021 at 21:14
1

No problem for me (TexLive 2021 and chemfig 1.6a). I suggest using the \chemabove command for a better result.

\chemfig{-[:30]-[:-30]\chemabove{N}{\scriptstyle{\oplus}}H_3}
    
    \chemfig{-[:30]-[:-30]\chemabove{N}{\scriptsize{\oplus}}H_3}
    
    \chemfig{-[:30]-[:-30]\chemabove{N}{\oplus}H_3} 

enter image description here

6
  • You're still making several of the mistakes that OP is making: \scriptsize is invalid in math mode, the {} are useless in \scriptstyle{\oplus}, and the only reason that \scriptstyle is working for you but not OP is because you've moved things from an exponent to \chemabove.
    – Teepeemm
    Nov 16, 2021 at 1:56
  • \chemabove isn't just a better result, it's the correct one according to IUPAC recommendations (doi.org/10.1351/pac200880020277).
    – andselisk
    Nov 16, 2021 at 11:40
  • @Teepeemm - I kept the same commands used by "generic account" to show that this did not result in an error on my system.
    – CrocoDuck
    Nov 16, 2021 at 14:55
  • @andselisk what about for mechanisms? Nov 16, 2021 at 16:22
  • 1
    @andselisk ah okay, I misread what you wrote above. Thanks for the explanation Nov 16, 2021 at 16:43

You must log in to answer this question.

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