2

I'd like to attach letters to my rotated symbol and then shrink it down. However, when I do this, the spacing is very much different than when I do the same exact thing to the original symbol. Is there some way to correct and have the rotated symbol look like the original symbol?

\documentclass{article}

\usepackage{graphicx}
\usepackage{scalerel}

\DeclareFontEncoding{LS2}{}{\noaccents@}
\DeclareFontSubstitution{LS2}{stix}{m}{n}
\DeclareSymbolFont{arrows3}       {LS2}{stixtt}   {m} {n}
\DeclareMathSymbol{\Otimes}{\mathbin}{arrows3}{"A8}

\newcommand{\Oplus}{\rotatebox[origin=c]{45}{$\Otimes$}}

\newcommand{\Stimes}{\mathbin{\scalerel*{\Otimes_R}{\otimes}}}
\newcommand{\Splus}{\mathbin{\scalerel*{\Oplus_R}{\oplus}}}


\begin{document}

$M_i \Stimes M_j$ vs $M_i \Splus M_j$.

\end{document}

Imgur

2
  • Welcome to the site. Thanks for using my scalerel package, but I think that egreg's solution is much nicer in this case. Mar 29 '16 at 23:00
  • Thank you! And yes, I love his solution! And aside from the problem I presented above, your scalerel package has served me wonderfully in accomplishing what I've needed.
    – Ivan G.
    Mar 29 '16 at 23:11
2

Not sure about scalerel, but with a different implementation, the size seems good.

First of all, I load the font at a different scale, instead of scaling down the symbol. Then some \mathpalette and box trickery allows to make \Oplus into having the same dimensions as \Otimes.

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

\makeatletter
\DeclareFontEncoding{LS2}{}{\noaccents@}
\makeatother
\DeclareFontSubstitution{LS2}{stix}{m}{n}
\DeclareFontFamily{LS2}{stixtt}{\skewchar\font127 }
\DeclareFontShape{LS2}{stixtt}{m}{n} {<-> s*[.7] stix-mathtt}{}
\DeclareSymbolFont{arrows3}{LS2}{stixtt}{m}{n}
\DeclareMathSymbol{\Otimesop}{\mathbin}{arrows3}{"A8}

\makeatletter
\DeclareRobustCommand{\Otimes}{%
  \mathbin{\mathpalette\O@times\relax}%
}
\newcommand{\O@times}[2]{%
  \vcenter{\hbox{$\m@th#1\Otimesop$}}%
}
\DeclareRobustCommand{\Oplus}{%
  \mathbin{\mathpalette\O@plus\relax}%
}
\newcommand{\O@plus}[2]{%
  \sbox\z@{$\m@th#1\Otimes$}%
  \sbox\tw@{\rotatebox[origin=c]{45}{$\m@th#1\Otimes$}}%
  \dp\tw@=\dp\z@ \ht\tw@=\ht\z@
  \vcenter{\hbox{%
    \makebox[\wd\z@]{\box\tw@}%
  }}%
}
\makeatother

\newcommand{\Stimes}{\Otimes_R}
\newcommand{\Splus}{\Oplus_R}


\begin{document}

$\Otimes\Oplus$ {\fboxsep=0pt\fbox{$\Otimes$}\fbox{$\Oplus$}}

$M_i \Stimes M_j$ vs $M_i \Splus M_j$.

$M_i \Splus M_j$

\end{document}

enter image description here

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.