I like mathdesign package, but spacing between some letters looks pretty awful, for example, look at the letter A:
I've found the solution here: Make Characters Active via Macro in Math Mode. So, with this code
\makeatletter
\newcommand{\DeclareMathActive}[2]{%
% #1 is the character, #2 is the definition
\expandafter\edef\csname keep@#1@code\endcsname{\mathchar\the\mathcode`#1 }
\begingroup\lccode`~=`#1\relax
\lowercase{\endgroup\def~}{#2}%
\AtBeginDocument{\mathcode`#1="8000}%
}
\newcommand{\std}[1]{\csname keep@#1@code\endcsname}
\makeatother
\DeclareMathActive{A}{\mkern+1.5mu\std{A}\mkern+1.5mu}
the spacing became much better:
But I still have some questions regarding this code:
Is there a way to keep original subscript/superscript spacing for this letter? It would be logical if superscript was a bit more to the left than subscript.
Since I wasn't sure about the answer to the previous question, I've decided to find the way how to define this spacing myself, and here is the answer: Kerning super- and subscripts "semantically". But sometimes I need to use this character as sub/superscript itself, and I want to be able to write this:
X_A. Right now I can just add a pair of brackets in the definition:\DeclareMathActive{A}{{\mkern+1.5mu\std{A}\mkern+1.5mu}}. Butfutureletwon't work after that.Is there any other drawback in making characters active in math mode?
- Does exist any other way to adjust spacing for a character in math mode?


\mkern. For instance, for a superscript which needs to be adjusted, you can useA^{\! n}$(\!is a negative kerning equal to-3 mu(mathematical unit equal ti 1/18 em), or, slightly more adjustedA^{\mkern -5mu n}$– Bernard Mar 07 '20 at 19:27