我想将字母附加到旋转后的符号上,然后将其缩小。但是,当我这样做时,间距与对原始符号执行完全相同的操作时有很大不同。有没有办法纠正并使旋转后的符号看起来像原始符号?
\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}
答案1
不确定scalerel
,但采用不同的实施方式,尺寸似乎不错。
首先,我以不同的比例加载字体,而不是缩小符号。然后使用一些\mathpalette
方框技巧,使其\Oplus
具有与相同的尺寸\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}