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

Space and id normalization for included graphics #402

Open
mgkurtz opened this issue Nov 22, 2024 · 0 comments
Open

Space and id normalization for included graphics #402

mgkurtz opened this issue Nov 22, 2024 · 0 comments

Comments

@mgkurtz
Copy link

mgkurtz commented Nov 22, 2024

For testing pdfjam’s pdfpages integration, I ran into a few inconsistencies regarding whitespace in output such as

[2

 <./source-1.pdf> <./source-1.pdf> <./source-1.pdf> <./source-1.pdf> <./source-1.pdf> <./source-1.pdf>] (a.aux)

Whether or not there is a space between the file names as well as whether there are line breaks varies depending on the tex engine and its version. Additionally the ids varied in output such as

<source-1.pdf, id=7, 597.508pt x 845.047pt>

These variations were quite nasty for ci/cd workflows running on a GitHub machine with an older texlive version than mine. By now, I fixed this by adding some own normalization machinery (just remove all whitespace after [1 until the ]) but thought that maybe I should bring this to your attention and ask whether you are interested in integrating any of this sort in l3build directly.

For reference: my normalization via `awk` and `sed`
<"$dir/a.log" awk 'BEGIN{s=0}
/^ *\[[0-9]/{ORS=""}
/]$/{ORS="\n"}
/] *\(/&&ORS=""{s=1}
/\)/&&s=1{s=0;ORS="\n"}
{print}
' | sed '/^ *\[[0-9]\+/s/ //g;/\.pdf,/s/id=[0-9]*/id=00/' >"$job.log"

If you are interested, I can rewrite this logic into Lua and create a PR.

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

1 participant