0

I would like to have commands \smalloplus and \smallotimes that prints same symbols as oplus and otimes but in a smaller size.

It would look like (but in a more beautiful way and the symbols should be "centered" with respect to the letter) the following

enter image description here

Is there a classical or convenient way to do it?

Colas
  • 6,772
  • 4
  • 46
  • 96
  • Have your tried using a scalebox? See https://tex.stackexchange.com/questions/13460/scalebox-knowing-how-much-it-scales (second answer) – Raven Sep 15 '18 at 13:55

2 Answers2

4

This will do the job, provided you only want these symbols in text and display style, not in scriptstyle og scriptscriptstyle. If you do, then we'd have to work a bit harder:

\documentclass[]{article}
\newcommand\smallmath[2]{#1{\raisebox{\dimexpr \fontdimen 22 \textfont 2
      - \fontdimen 22 \scriptscriptfont 2 \relax}{$\scriptscriptstyle #2$}}}
\newcommand\smalloplus{\smallmath\mathbin\oplus}
\newcommand\smallotimes{\smallmath\mathbin\otimes}
\begin{document}
\noindent
$ a \oplus b \otimes c$\\
$ a \smalloplus b \smallotimes c$
\end{document}

Comparison of normal and small operators

Explanation: The \fontdimen 22 parameters denote the axis height of the math font. As we set the symbol in scriptscriptstyle inside a textstyle setting, we need to raise the symbol by the difference of the two axis heights. Note that \dimexpr requires eTeX; if your LaTeX is not using eTeX, your TeX installation is very old and should be upgraded.

Of course, you may opt for replacing all the \scriptscript… by \script…, if this is too extreme.

4

First version:

\documentclass{article}

\makeatletter
\newcommand{\smalloplus}{\mathbin{\mathpalette\make@small\oplus}}
\newcommand{\smallotimes}{\mathbin{\mathpalette\make@small\otimes}}

\newcommand{\make@small}[2]{%
  \vcenter{\hbox{%
    $\m@th\ifx#1\displaystyle\scriptstyle\else\ifx#1\textstyle\scriptstyle
     \else\scriptscriptstyle\fi\fi#2$%
  }}%
}
\makeatother

\begin{document}

$a\smalloplus b\smallotimes c_{x\smalloplus y\smallotimes z}$

\end{document}

enter image description here

Second version (adjust the scaling factor to suit):

\documentclass{article}
\usepackage{graphicx}

\makeatletter
\newcommand{\smalloplus}{\mathbin{\mathpalette\make@small\oplus}}
\newcommand{\smallotimes}{\mathbin{\mathpalette\make@small\otimes}}

\newcommand{\make@small}[2]{%
  \vcenter{\hbox{%
    \scalebox{0.6}{$\m@th#1#2$}%
  }}%
}
\makeatother

\begin{document}

$a\smalloplus b\smallotimes c_{x\smalloplus y\smallotimes z}$

\end{document}

enter image description here

egreg
  • 1,121,712
  • Please let me know how to get a smaller \bigstar symbol throughout a document. I was trying to use these codes, but it is not working. – Shivani Sengupta Sep 27 '23 at 08:30
  • @ShivaniSengupta If you mean \bigstar from amssymb, then it's fundamentally different from \bigoplus and \bigotimes. Please, open a new question explaining your problem and aim. – egreg Sep 27 '23 at 08:43