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

(PDF) Breaking words in table cells through word-wrap when width is insufficient #154

Open
ReesePlews opened this issue Jan 22, 2025 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@ReesePlews
Copy link

i think MS-Word has a special switch for handling these type of situations (shown in the image below) with non-dbcs strings.

Image

when this happens in non-autogenerated tables i think it may be possible to hyphenate them manually (with a hyphen and carriage return), but i have never tried this. i do not know how this could be handled in an autogenerated table, perhaps a similar operation would work.

@ronaldtse can you of the other developers confirm or recommend a successful workaround for these situations? thank you.

@ReesePlews ReesePlews added the question Further information is requested label Jan 22, 2025
@ronaldtse ronaldtse transferred this issue from metanorma/mn-samples-plateau Jan 22, 2025
@ronaldtse ronaldtse changed the title question: wrapping of words in table columns (PDF) Breaking words in table cells through word-wrap when width is insufficient Jan 22, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma Jan 22, 2025
@ronaldtse ronaldtse moved this from 🆕 New to 🌋 Urgent in Metanorma Jan 22, 2025
@ronaldtse
Copy link
Contributor

@ReesePlews Thanks for raising this.

@Intelligent2013 Can we automatically insert hyphenated word wraps in this case? A word extending beyond a table cell cannot be right...

@Intelligent2013 Intelligent2013 moved this from 🌋 Urgent to 🏗 In progress in Metanorma Jan 22, 2025
@Intelligent2013
Copy link
Contributor

Apache FOP supports hyphenation via the 'Objects For Formatting Objects' project (https://xmlgraphics.apache.org/fop/2.10/hyphenation.html).
I've tried it with the table 4-2 and the PDF looks ok:
Image

I'll integrate hyphenation into the mn2pdf.

@Intelligent2013
Copy link
Contributor

Hyphenation support added in mn2pdf v2.14 (https://github.com/metanorma/mn2pdf/releases/tag/v2.14) and in Plateau XSLT.

To use it, need add these lines into Gemfile:

gem "metanorma-plateau", git: "https://github.com/metanorma/metanorma-plateau", branch: "main"
gem "mn2pdf"

and execute bundle update.

@Intelligent2013 Intelligent2013 moved this from 🏗 In progress to ✅ Done in Metanorma Jan 22, 2025
@ReesePlews
Copy link
Author

hello @Intelligent2013 thank you for the modifications, that looks very nice! i will try a local build, with the updated Gemfile as you have shown above, later this week. i will report back here. thank you!

@ReesePlews
Copy link
Author

hello @Intelligent2013 i was able to successfully build a local version of the document using the modifications to the gemfile you have listed above. in addition to this issue, the changes you made for the terminology clause:

were also correctly shown.

i think both of the issues are correctly fixed.

however i have one observation. normally when i do a local build it takes about 40 minutes or so. this time it it felt like it took more than 1.5 hours.

when will these revisions be updated to the main branch?

@Intelligent2013
Copy link
Contributor

however i have one observation. normally when i do a local build it takes about 40 minutes or so. this time it it felt like it took more than 1.5 hours.

ping @opoudjis

when will these revisions be updated to the main branch?

@ReesePlews these revisions updated in the main branch already (repositories mn2pdf and metanorma-plateau). But they will be available in the docker container in the next release. I don't know the exact date, may be next week.

@ReesePlews
Copy link
Author

hi @Intelligent2013 thank you for that update and the clarifications. i had created a list of fixed issues for Nick, but this information is helpful. thank you again for working on this fix, the output looks much better.

i will check a build with the main branch today and if everything is ok, i will close this and any related issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Status: Done
Development

No branches or pull requests

3 participants