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

Pandoc 3.2.1 update on LaTeX writer #571

Open
cderv opened this issue Jun 25, 2024 · 0 comments
Open

Pandoc 3.2.1 update on LaTeX writer #571

cderv opened this issue Jun 25, 2024 · 0 comments
Labels
next to consider for next release pandoc concerns upstream pandoc

Comments

@cderv
Copy link
Collaborator

cderv commented Jun 25, 2024

It seems Pandoc 3.2.1 has big change on Writer

See https://github.com/jgm/pandoc/releases/tag/3.2.1

New method for ensuring images don’t overflow (jgm/pandoc#9660). Previously we relied on graphicx internals and made global changes to Gin to force images to be resized if they exceed textwidth. This approach is brittle and caused problems with \includesvg (see jgm/pandoc#9660). The new approach uses a new macro \pandocbounded that is now defined in the LaTeX template. (Thanks here to Falk Hanisch in mrpiggi/svg#60.) The LaTeX writer has been changed to enclose \includegraphics and \includesvg commands in this macro when they don’t explicitly specify a width or height. In addition, the writer now adds keepaspectratio to the \includegraphics or \includesvg options if height is specified without width, or vice versa. Previously, this was set in the preamble as a global option. Users should attend to the following compatibility issues:
If custom templates are used with the new LaTeX writer, they will have to be updated to include the new \pandocbounded macro, or an error will be raised because of the undefined macro.
Documents that specify explicit dimensions for an image may render differently, if the dimensions are greater than the line width or page height. Previously pandoc would shrink these images to fit, but the new behavior takes the specified dimensions literally. In addition, pandoc previously always enforced keepaspectratio, even when width and height were both specified, so images with width and height specified that do not conform to their intrinsic aspect ratio will appear differently.

Especially :

If custom templates are used with the new LaTeX writer, they will have to be updated to include the new \pandocbounded macro, or an error will be raised because of the undefined macro.

So we may need to include it when Pandoc 3.2.1 is used.

I'll run CI to see if we already detect problems: https://github.com/rstudio/rticles/actions/runs/9659732696

@cderv cderv added pandoc concerns upstream pandoc next to consider for next release labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next to consider for next release pandoc concerns upstream pandoc
Projects
Status: To discuss / To plan
Development

No branches or pull requests

1 participant