
\times
막대 "/"와 유사하지만 빼기 기호(-)가 45도 회전되고 +가 회전하는 것과 같은 방식으로 새로운 나누기 기호를 정의하고 싶습니다 . 다른 산술 기호(+,- 및 \times
)와 동일한 속성, 즉 동일한 간격 등을 갖기를 원합니다 .
내가 시도한 것은 다음과 같습니다.
% Inversa da multiplicação em anéis e grupos
\makeatletter
\providecommand{\newdiv}{%
\mathbin{
\hspace{-1.5pt}\mathpalette\@rotatinganeighth{-}\hspace{-1.5pt}
}
}
\newcommand*{\@rotatinganeighth}[2]{%
\rotatebox[origin=c]{45}{$\m@th#1#2$}%
}
\makeatother
결과는 괜찮아 보이지만 "더 깔끔한" 것을 원하고 특정 공백을 입력한다는 사실이 마음에 들지 않습니다. \hspace{-1.5pt}
단지 이진 연산으로 작동하고 가능하면 단항 연산으로 작동하기를 원했습니다. 그 앞에는 기호가 없습니다(빼기 기호의 작동 방식과 동일).
답변1
나는 \mathpalette
기호가 아래 첨자와 위 첨자에서 적절하게 크기를 조정할 것을 제안합니다.
빼기 기호는 더하기 기호와 높이가 같으므로 이를 부숴서 더하기 기호만큼 넓은 상자에 넣어야 합니다. 수직 팬텀은 정확한 높이와 깊이를 보장합니다.
\documentclass{article}
\usepackage{graphicx}
\makeatletter
\newcommand{\newdiv}{\mathbin{\mathpalette\@newdiv\relax}}
\newcommand{\@newdiv}[2]{%
\begingroup
\sbox\z@{$\m@th#1+$}%
\makebox[\wd\z@]{\smash{\rotatebox[origin=c]{45}{$\m@th#1-$}}}%
\vphantom{\usebox{\z@}}%
\endgroup
}
\makeatother
\setlength{\fboxsep}{0pt}\setlength{\fboxrule}{0.1pt}% just for the example
\begin{document}
$a+b$ \fbox{$a+b$}
$a\newdiv b$ \fbox{$a\newdiv b$}
$\scriptstyle a+b\newdiv c$
\end{document}