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

v4 svg output does not display \hspace #3178

Closed
hurshore opened this issue Feb 9, 2024 · 1 comment
Closed

v4 svg output does not display \hspace #3178

hurshore opened this issue Feb 9, 2024 · 1 comment
Milestone

Comments

@hurshore
Copy link

hurshore commented Feb 9, 2024

Issue Summary

MathJax SVG output does not display a white space when \hspace is used. I have the following equation:

In the diagram, \(R\hat{P}Q = Q\hat{R}Y, \hspace{1mm} P\hat{Q}R = R\hat{Y}Q, \\ \hspace{1mm}|QP| = 3cm \hspace{1mm}|QY| = 4cm \hspace{1mm}and \hspace{1mm}|RY | = 5cm. \hspace{1mm} Find \hspace{1mm}|QR|\)

This is the output:
IMG_20240209_122217

Expected Output
There should be a white space where \hspace appears.

Technical details:

  • MathJax Version: 4.0.0-beta.4
  • Client OS: iOS 16.4

I am using the following MathJax configuration:

MathJax = {
	options: {
		enableMenu: false
	},
};

and loading MathJax via

<script src="https://cdn.jsdelivr.net/npm/[email protected]/tex-svg.js"></script>

Thanks for this amazing package!

@dpvc
Copy link
Member

dpvc commented Feb 9, 2024

This turns out to be the same issue as in #3166, and is resolved in mathjax/MathJax-src#1043. It will be included in the next release. There is a workaround that you can use until the beta.5 release.

As an aside, your LaTeX could be improved for better output. For, example, units should be rendered in upright letters, so 3\,\textrm{cm} is preferred to 3cm. Similarly, words like "and" and "Find" should be ne in \text{} if they appear in an expression. But in your case, they are part of the surrounding sentence, not the math, so should not be inside the math delimiters at all. It would be better to do

In the diagram, \(R\hat{P}Q = Q\hat{R}Y\), \(P\hat{Q}R = R\hat{Y}Q\),<br>
 \(|QP| = 3\,\textrm{cm}\) \(|QY| = 4\,\textrm{cm|\) and \(|RY | = 5\,\textrm{cm}\).  Find \(|QR|\)

rather than putting everything into a single in-line expression. In general, you want only the math to be inside the math delimiters, and the reset of the sentence outside it.

@dpvc dpvc added the Duplicate label Feb 9, 2024
@dpvc dpvc added this to the v4.0 milestone Feb 9, 2024
@dpvc dpvc closed this as completed Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants