2

I'm new user and really need your help. I want to fix the size and position of a "math symbol". For example, I want to scale and adjust vertical position of symbol "+". According to information on internet, I try this way and it worked.

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

\def\plus{\raisebox{0.13\height}{\scalebox{0.95}{$\mspace{4mu}+\mspace{4mu}$}}}

\begin{document}
\noindent
$1+2+3\\
1\plus 2\plus 3$
\end{document}

*enter image description here*

However, I wonder that how I can re-define the symbol "+" directly in the system without using syntax <\plus>.

I try to find more information, it leads me to "catcode". But I cannot apply it because of no knowledge about the syntax and structure.

2

1 Answer 1

3

You could do as follows, making + math active.

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

\makeatletter
\mathchardef\standardplus=\mathcode`+
\DeclareRobustCommand{\tauyecoplus}{%
  \mathbin{\mathpalette\tauyeco@plus\relax}%
}
\newcommand{\tauyeco@plus}[2]{%
  \raisebox{0.13\height}{\scalebox{0.95}{$\m@th#1\standardplus$}}%
}
\begingroup\lccode`~=`+ \lowercase{\endgroup\let~}\tauyecoplus
\AtBeginDocument{\mathcode`+="8000 }
\makeatother

\begin{document}

$1+2+3_{a+b}$ (modified)

$1\standardplus 2\standardplus 3_{a\standardplus b}$ (original)

\end{document}

enter image description here

4
  • Thank you so so much!
    – Nuec Tah
    Jan 5, 2020 at 17:54
  • excuse me, but how we can deal with other operator, like \times, etc. I cannot use similar syntax : \mathchardef\standardplus=\mathcode`\times
    – Nuec Tah
    Jan 5, 2020 at 20:24
  • 1
    @Tauyeco You should first think deeply about modifying that way standard symbols: there are several reasons why they're shaped and positioned the way they are.
    – egreg
    Jan 5, 2020 at 20:36
  • .@egreg: I know about the standard. But because of changing of math font, sometimes there are some symbols which don't have correct view. I just want to fix some small issues like above without changing so much. It's better if I can understand deeply, but currently I just have a little bit time. Another question is, how I can know the list of all mathcode of symbol?
    – Nuec Tah
    Jan 5, 2020 at 20:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .