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

100% width latex-images in naked images are not 100% width in PDF #2412

Open
Alex-Jordan opened this issue Feb 6, 2025 · 5 comments
Open

Comments

@Alex-Jordan
Copy link
Contributor

This is a subtle spacing issue with naked latex-images in PDF. (It may also be an issue with non-naked images, and not-latex-images, but I haven't investigated.)

A naked image using latex-image in a division will typically be authored in a way that ends like:

            ...
        \end{tikzimage}
    </latex-image>
</image>

This ends up in PTX-generated LaTeX as:

    ...
\end{tikzpicture}
}%
\end{image}%

There is a new line there at the end of \end{tikzpicture}. This newline is responsible for a small amount of horizontal space to the right of the picture. So if the picture is 100% width, it actually will not quite be flush with the right edge of the surrounding text body. Here you can see this with a naked image/tikz-image I put into the minimal article:

Image

If I manually alter the tex, adding a % so we have:

    ...
\end{tikzpicture}%
}%
\end{image}%

then the image comes out at 100%.

I had trouble coming up with an automated way to get a % sign in there like that. The author's actual content has a text node like ...\end{tikzimage}&#xa; , so it's a question how you would insert that % there. And you wouldn't want to insert it before other newlines in the author's code. And counting the last line break is not reliable either since they may have additional line breaks at the end.

Maybe it's an unfortunate "author education" situation where they should author the % signs?

@rbeezer
Copy link
Collaborator

rbeezer commented Feb 6, 2025 via email

@rbeezer
Copy link
Collaborator

rbeezer commented Feb 6, 2025 via email

@Alex-Jordan
Copy link
Contributor Author

Is that sort of stripping something to do in -assembly?

@rbeezer
Copy link
Collaborator

rbeezer commented Feb 6, 2025 via email

@Alex-Jordan
Copy link
Contributor Author

Ah, I was already doing something in assembly and didn't see this first. Check out #2413 and let me know what you think.

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

2 participants