Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

& not working as expected in custom macros #2390

Open
andrew-murdza opened this issue Jun 7, 2024 · 0 comments
Open

& not working as expected in custom macros #2390

andrew-murdza opened this issue Jun 7, 2024 · 0 comments

Comments

@andrew-murdza
Copy link

andrew-murdza commented Jun 7, 2024

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}\bu11\\\bu2\end{aligned}</math-field>
<script>
  customElements.whenDefined("math-field").then(() => {
    document.body.classList.add("ready");
    mf=document.getElementById('mf');
    mf.macros={...mf.macros,bu:'&\\bullet~~'}
  });
</script>
</body>
</html>

Description

When & is used inside of a macro, it is treated as the letter & and not the latex character &

Steps to Reproduce

Run the attached html code

Actual Behavior

The bullets are not lined up and there is a letter &

Expected Behavior

The bullets are lined up (because there are &'s an an aligned environment) and there is no "&" letter present in the output.

Environment

Windows Chrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant