I am trying to control the size of math operators and at the same time the spacing between operators and operands using the following code.


\node[font=\sffamily\fontsize{11}{10},below=-0.5mm,pos=0.85,sloped]   {$\mathbf{p} \scalebox{0.75}[1.0]{\(-\)} o \scalebox{0.75}[1.0]{=} \scalebox{0.75}[1.0]{\(-\)}2$};

Space skipping is working fine if there is no scalebox in the equation. But the skippers doesn't work in presence of scalebox.

  • Could you elaborate a bit what you are trying to do here? Please make your code compilable and show one working and one not-working (the one above) node. Right now, I have difficulty to see the issue here as you are tweaking around a lot with the standard math. – LaRiFaRi Jul 9 '15 at 14:38
  • \scalebox{0.75}[1.0]{${}-{}$} will give you back your spacing. Or \mathbin{\scalebox{0.75}[1.0]{$-$}}. – LaRiFaRi Jul 9 '15 at 14:42
  • Why did you tag latex3? Are you into expl3 development? – LaRiFaRi Jul 9 '15 at 15:10
  • @LaRiFaRi That tag is often wrongly applied I think, there is nothing related to latex3 that I can see here. – Torbjørn T. Jul 9 '15 at 17:46

Just take a look on the different versions below. You will have to choose. In my eyes, the last version should be what you are trying to do.

% arara: lualatex

    \setlength{\thickmuskip}{10mu} #1}}

% original version
$\mathbf{p} - o = -2$
\spaceskipping{$\mathbf{p} - o = -2$}

% your version
$\mathbf{p} \scalebox{0.75}[1.0]{\(-\)} o \scalebox{0.75}[1.0]{=} \scalebox{0.75}[1.0]{\(-\)}2$
\spaceskipping{$\mathbf{p} \scalebox{0.75}[1.0]{\(-\)} o \scalebox{0.75}[1.0]{=} \scalebox{0.75}[1.0]{\(-\)}2$}

% version by resetting the spacing of operators with surrounding {}
$\mathbf{p} \scalebox{0.75}[1.0]{${}-{}$} o \scalebox{0.75}[1.0]{${}={}$} \scalebox{0.75}[1.0]{${}-{}$}2$
\spaceskipping{$\mathbf{p} \scalebox{0.75}[1.0]{${}-{}$} o \scalebox{0.75}[1.0]{${}={}$} \scalebox{0.75}[1.0]{${}-{}$}2$}

% version by resetting the spacing of operators by \mathrel resp. \mathbin
$\mathbf{p} \mathbin{\scalebox{0.75}[1.0]{$-$}} o \mathrel{\scalebox{0.75}[1.0]{$=$}} \mathbin{\scalebox{0.75}[1.0]{$-$}}2$
\spaceskipping{$\mathbf{p} \mathbin{\scalebox{0.75}[1.0]{$-$}} o \mathrel{\scalebox{0.75}[1.0]{$=$}} \mathbin{\scalebox{0.75}[1.0]{$-$}}2$}

enter image description here

The problem you were seeing is that you surrounded the binary or relational operators by some group/command/environment. Therefore, the equation does not know any more, what type of symbol it has to handle here and therefore sets it as ordinary symbol \mathord without any spacing.

The third version resets the spacing for the operators, but scales them together with the rest. I guess, that's not what you want.

  • Thanks a lot for such a detailed explanation. Although, your comment was more than sufficient. Thanks again. – Shahzad Jul 9 '15 at 15:35
  • @Shahzad You are very welcome. – LaRiFaRi Jul 9 '15 at 15:37

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.