arnog / mathlive

A web component for easy math input
https://cortexjs.io/mathlive
MIT License
1.26k stars 260 forks source link

\class command not giving special equation spacing like \textcolor #2391

Open andrew-murdza opened 3 weeks ago

andrew-murdza commented 3 weeks ago

My html code

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Change FontShape of MathField</title>
  <script defer src="https://unpkg.com/mathlive"></script>
</head>
<body>
<h1>MathField FontShape Example</h1>
<math-field id='mf'>\begin{aligned}1=\class{test}{1}\end{aligned}</math-field>
<br>
<math-field id='mf'>\begin{aligned}1=\textcolor{red}{1}\end{aligned}</math-field>
</body>
</html>

Description

Using \class doesn't give custom equation spacing like \textcolor does

Steps to Reproduce

(Required) Provide steps that are specific and repeatable

Run the attached html code

Actual Behavior

The second equation with \textcolor has extra spacing before the 1 but the first equation with \class does not

Expected Behavior

first equation with \class has extra spacing before the 1 due to the = sign just like the second line with textcolor.

Windows Chrome