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

Better \kern in svg #2533

Merged
merged 3 commits into from
Mar 20, 2025
Merged

Better \kern in svg #2533

merged 3 commits into from
Mar 20, 2025

Conversation

brucemiller
Copy link
Owner

Currently a \kern in svg adds the shift to the containing svg:g, but if there already were children, they get shifted as well. We really want to create a new svg:g in that case. Alas, there was clumsiness in other places dealing with svg:g, namely \hbox would wrap it's content in svg:g, but didn't actually close the correct container when done, so that got simplified as well. And finally, a few svg:g that got created by the driver, behind the scenes, needed to be marked as autoclose, so that they could be properly closed.

Thanks, @xworld21 for the excellent debugging, but I think this ends up being simpler, in the long run, than #2502.
check if this does what you expect.

Closes #2502

@brucemiller brucemiller requested a review from dginev March 18, 2025 19:17
@dginev
Copy link
Collaborator

dginev commented Mar 18, 2025

Since reviewing _autoclose effects is nearly impossible without context, should we add a test exercising this? Maybe in t/tikz which runs only with the "extra" test target.

…ut, make \hbox close to the appropriate svg:g; And make auto opened svg:g able to auto close
@brucemiller
Copy link
Owner Author

It should show up in the xy test, but that doesn't seem to be there. There should be a simple version of it, though

@brucemiller brucemiller reopened this Mar 18, 2025
@dginev
Copy link
Collaborator

dginev commented Mar 18, 2025

The reason we have them in the "extra" tests is that we can't reproduce the exact same XML markup across texlives (as the internal tex attribute values change with the changes to pgf). So t/graphics isn't quite doable.

Edit: Ah, but that was true of pgf, not xy, fair.

Copy link
Collaborator

@dginev dginev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the test - it makes the difference nicely visible. Good to merge!

New PR version on the left, master on the right, using ar5iv.css

Screenshot from 2025-03-18 19-44-57

@brucemiller
Copy link
Owner Author

Yeah, xy is certainly more stable, and small tests are fast enough to include in the main tests (although the exhaustive test going around is too big & slow). So, now we've got a place to add other small xy tests, if we need.

@brucemiller brucemiller merged commit 0cb41c2 into master Mar 20, 2025
26 checks passed
@brucemiller brucemiller deleted the better-kern-in-svg branch March 20, 2025 19:57
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

Successfully merging this pull request may close these issues.

2 participants