dragonfly-science / mpi-latex-templates

Latex templates for the New Zealand Ministry for Primary Industries fisheries reports
MIT License
0 stars 2 forks source link

splitting of words across lines #25

Closed katrin-berkenbusch closed 2 years ago

katrin-berkenbusch commented 4 years ago

the current set up allows words to be split incorrectly across lines; e.g., dens-ity instead of den-sity or densi-ty.

Would it be possible to prevent this type of splitting?

katrin-berkenbusch commented 4 years ago

or does it require going through the final report document and using \mbox{} on the offending words?

yvanrichard commented 4 years ago

I would have thought LaTeX would get this right. What are the rules? I would have thought dens-ity is the right one.

katrin-berkenbusch commented 4 years ago

For density, the correct splitting would be den-sity. I have a number of other incorrect splits in the FAR for AKI, and also correct ones. I guess the options are to go through the final document and fix the words via \mbox or to set up the template to not split words across lines?

katrin-berkenbusch commented 4 years ago

This issue also applies to the references, e.g., I have a split of "Zealand" as "New Zeal- and" - the correct split would be "Zea-land".

yvanrichard commented 4 years ago

While dealing with the NEFD report which doesn't do word splits, I discovered that one can prevent any word split with

\usepackage[none]{hyphenat}
katrin-berkenbusch commented 4 years ago

Yes, I saw that online, but does it allow justified text?

On 27/10/2020, at 2:58 PM, Yvan Richard notifications@github.com wrote:

While dealing with the NEFD report which doesn't do word splits, I discovered that one can prevent any word split with

\usepackage[none]{hyphenat}

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

katrin-berkenbusch commented 4 years ago

Thanks to @yvanrichard for sending the link for this approach, it did the trick -

\tolerance=1 \emergencystretch=\maxdimen \hyphenpenalty=10000 \hbadness=10000

katrin-berkenbusch commented 4 years ago

interesting enough, it solved other justification problems at the same time.

dmiddleton commented 3 years ago

I've been using this solution (https://github.com/dragonfly-science/mpi-latex-templates/issues/25#issuecomment-717566745) for a while: is it worth adding to the template so it becomes a default?

dmiddleton commented 3 years ago

@yvanrichard 's solution is now part of the template (from v1.28)

katrin-berkenbusch commented 2 years ago

It seems that this solution does not help with splits in captions. Any thoughts?

yvanrichard commented 2 years ago

Bummer. Do you have an easy example to play with locally, @katrin-berkenbusch?

katrin-berkenbusch commented 2 years ago

Yes, looks at dragonfly-science/PAU2019-01-PAU2-ASSMT:

In īnputs.Rnw' there is a figure caption ({fig:catchcircle}, Figure 5 in the PDF) that has word getting split over a line in a bad way: "....same time period (right-hand side). Stat- istical reporting areas...".

katrin-berkenbusch commented 2 years ago

Using the`\mbox{}' approach in the meantime. ; )

yvanrichard commented 2 years ago

It appears that the image docker.dragonfly.co.nz/dragonverse-18.04 that you're using in that report is using an old latex template (v1.25) so there's plenty of word breaking happening, not just in the caption. I added the fix for now to assessment_report.tex and it seems to be working.

katrin-berkenbusch commented 2 years ago

Thanks heaps @yvanrichard I am sorry, I didn't even think to check that.