style transform origin incorrect in svg mode
Open
Nobody has claimed this yet.
Code Example
Expected Behavior
- Dominant language
- JavaScript
- Stars
- 10.9k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Issue Summary
Making a reversed D character:
\(\style{transform: scaleX(-1);}{\mathrm{D}}\)
gives correct result in chtml but with svg it is displaced to the left.
Steps to Reproduce:
- using the example on jsbin, paste in
given \(\style{transform: scaleX(-1);}{\mathrm{D}}\) by a relation
This works correctly.
- change the src to tex-svg
The character is displaced to the left.
Technical details:
- MathJax Version: latest
- Client OS: Linux
- Browser: Firefox
I am using the following MathJax configuration from the jsbin page:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>MathJax example</title>
<script id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-svg.js">
</script>
</head>
<body>
<p>
given \(\style{transform: scaleX(-1);}{\mathrm{D}}\) by a relation
</p>
</body>
</html>
Supporting information:
Screenshot below
good chtml
bad svg:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied reproduction using MathJax's tex-svg.js configuration, comparing the reversed D in SVG mode with the working CHTML output. Trace the SVG rendering of the style transform and verify that the character is no longer displaced to the left while preserving the correct CHTML result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100