4

I would like to define an operator \rsum which has all the same functionality of \sum with the only difference being that \rsum displays a mirrored image of the sigma glyph.

I have found the following questions which each address a part of what I want:

How are big operators defined?

Reversed letters in a mathematical formula

However, I'm having difficulty in marrying the two accepted answers into a single solution. How would I go about accomplishing this? (An answer to this question doesn't necessarily have to use the approaches in the other questions.)

I don't anticipate using custom fonts for this purpose, but the capability to do so wouldn't be unappreciated (if not by me by someone in the future, I'm sure).

1 Answers1

4

Well, it's almost automatic. ;-)

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}

\makeatletter
\newcommand{\rsum}{\DOTSB\rsum@\slimits@}
\newcommand{\rsum@}{\mathop{\mathpalette\rsum@@\relax}}
\newcommand{\rsum@@}[2]{\reflectbox{$\m@th#1\sum@$}}
\makeatother

\begin{document}

\[
\sum_{i=1}^n\rsum_{i=1}^n
\qquad
\textstyle
\sum_{i=1}^n\rsum_{i=1}^n
\]

\end{document}

enter image description here

The main idea is to reflect the symbol in the appropriate math style; some bells and whistles for amsmath have been added.

Should you need also rotated versions, here they are:

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}

\makeatletter
\newcommand{\rsum}{\DOTSB\rsum@\slimits@}
\newcommand{\rsum@}{\mathop{\mathpalette\rsum@@\relax}}
\newcommand{\rsum@@}[2]{\reflectbox{$\m@th#1\sum@$}}

\newcommand{\usum}{\DOTSB\usum@\slimits@}
\newcommand{\usum@}{\mathop{\mathpalette\udsum@@{90}}}
\newcommand{\dsum}{\DOTSB\dsum@\slimits@}
\newcommand{\dsum@}{\mathop{\mathpalette\udsum@@{-90}}}
\newcommand{\udsum@@}[2]{%
  \vcenter{%
    \sbox\z@{$\m@th#1\sum@$}%
    \hbox to \wd\z@{%
      \hss
      \resizebox{\ifx\displaystyle#1\else0.9\fi\wd\z@}{\dimexpr\ht\z@}{%
        \rotatebox[origin=c]{#2}{$\m@th#1\sum@$}%
      }%
      \hss
    }%
  }%
}
\makeatother

\begin{document}

\[
\sum_{i=1}^n\rsum_{i=1}^n
\qquad
\textstyle
\sum_{i=1}^n\rsum_{i=1}^n
\]

\[
\sum_{i=1}^n\usum_{i=1}^n
\qquad
\textstyle
\sum_{i=1}^n\usum_{i=1}^n
\]

\[
\sum_{i=1}^n\dsum_{i=1}^n
\qquad
\textstyle
\sum_{i=1}^n\dsum_{i=1}^n
\]

\end{document}

enter image description here

egreg
  • 1,121,712
  • Can't imagine a sleeker approach showing up. But I'll hold my breath to accept this just yet. Thanks! –  Oct 18 '18 at 22:10
  • May be in r version \rotatebox{180} instead of \reflectbox because of the width of different lines? And similar, in the u and d versions, may be those should be a rotation of a reflectbox (or a reflectbox of your rotation)? – Manuel Oct 18 '18 at 23:02
  • @Manuel I tried the 180 degree rotation, but it's unsatisfying because of the different thickness of the horizontal strokes. All variations are possible, but the 90 degree rotated symbols are just a joke. – egreg Oct 18 '18 at 23:04
  • It might look stupid for Sigma, but someone might find it useful for a different symbol. I can usually alter a few lines of code from this site to tailor it for my needs. So, extra generality never hurts. –  Oct 19 '18 at 00:21