Skip to content

Option Title: with title containing tex #19474

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

Merged
merged 2 commits into from
Aug 4, 2025
Merged

Conversation

couet
Copy link
Member

@couet couet commented Jul 29, 2025

With pdf output it is possible to define a table of content of a multi-pages file. Each page has its name specified using the option "Title:" followed by the title of the page. If the title contains a string matching a possible file extension like, for instance, "tex" or "png", then the pdf generation went wrong and might crash. This PR fixes the problem.

Fixes #19390

Copy link

github-actions bot commented Jul 29, 2025

Test Results

    21 files      21 suites   3d 7h 29m 8s ⏱️
 3 224 tests  3 224 ✅ 0 💤 0 ❌
65 981 runs  65 981 ✅ 0 💤 0 ❌

Results for commit 560c046.

♻️ This comment has been updated with latest results.

@dpiparo
Copy link
Member

dpiparo commented Jul 30, 2025

could this be backported and merged to 6.36 when merged?

@ferdymercury
Copy link
Collaborator

Thanks for this nice fix Olivier!
I would suggest adding the following Unit Test:

   TCanvas c;
   c.Print("outputJIRA7087.pdf[");
   c.Print("outputJIRA7087.pdf", "Title:Vertex");
   c.Print("outputJIRA7087.pdf]");
   gSystem->Unlink("outputJIRA7087.pdf");

@couet couet requested a review from bellenot July 30, 2025 13:27
Copy link
Member

@bellenot bellenot left a comment

Choose a reason for hiding this comment

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

LGTM, but can you add a Unit Test, as suggested by @ferdymercury?

@couet
Copy link
Member Author

couet commented Jul 31, 2025

Note the proper syntax is:

   c.Print("outputJIRA7087.pdf(");
...
   c.Print("outputJIRA7087.pdf)");

With parenthesis... not square brakets.

@ferdymercury
Copy link
Collaborator

With parenthesis... not square brackets.

Both options are supported, see e06e246

@couet
Copy link
Member Author

couet commented Jul 31, 2025

This is not equivalent. Try your test with [ and see the doc of TPad::Print

@ferdymercury

This comment was marked as outdated.

Copy link
Collaborator

@ferdymercury ferdymercury left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@couet couet merged commit a3ca886 into root-project:master Aug 4, 2025
46 of 48 checks passed
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.

c.Print when Title contains tex (old ROOT-7087 bug)
4 participants