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

add viewBox to inline SVGs #2376

Open
xworld21 opened this issue Jul 6, 2024 · 1 comment · May be fixed by #2396 or #2397
Open

add viewBox to inline SVGs #2376

xworld21 opened this issue Jul 6, 2024 · 1 comment · May be fixed by #2396 or #2397
Assignees
Milestone

Comments

@xworld21
Copy link
Contributor

xworld21 commented Jul 6, 2024

Inline SVGs generated by LaTeXML do not have a @viewBox attribute, which makes it virtually impossible to resize them from CSS (e.g. setting max-width: 100% to ensure that the image fits cannot work without @viewBox).

@dginev dginev added this to the LaTeXML-0.9 milestone Jul 7, 2024
@xworld21
Copy link
Contributor Author

After some digging, @viewBox was intentionally removed in #1657, although I do not understand why.

For instance here

#### viewBox => "$props{minx} $props{miny} $props{pxwidth} $props{pxheight}",

uncommenting the line seems ok (in fact, minx and miny are always 0, so many of those calculations are superfluous).

I might send a PR restoring some viewBox here and there. The one for xypic is more challenging, as it looks like you are using the SVG transform to mimic vertical-align (badly, because you still get the wrong CSS box), so it's not entirely obvious what the correct viewBox should be.

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

Successfully merging a pull request may close this issue.

3 participants