rrthomas / hpmor

PDF, ePUB and Mobi versions of “Harry Potter and the Methods of Rationality”, from LaTeX source
http://hpmor.com/
296 stars 56 forks source link

Hyphenation of "McGonagall" #24

Open b-jonas0 opened 4 years ago

b-jonas0 commented 4 years ago

In chapter 86, page 1420 of the PDF, Professor McGonagall's name is hyphenated as "McG-onagall". I don't know what the correct hyphenation is, but that looks wrong.

jmichael2497 commented 4 years ago

looking at the hp-header.tex file that was most recently updated, i noticed the hyphenation section, and see that it could be alphabetized, but also some items should be broken up a bit differently, based on syllables, and so actually:

Mc-Gon-agall Mc-Gon-a-gall (similarly to Her-mi-o-ne)

and for common words like "analyse" there is http://www.syllablecount.com/syllables/analyse and compare it to https://www.dictionary.com/browse/analyse

an-aly-se an-a-lyse

an-aly-sis a-nal-y-sis (unless the goal is to avoid dangling "anal-" then maybe analy-sis)

remem-ber re-mem-ber

re-pli-cat-ed rep-li-ca-ted

thanks for keeping this all updated @rrthomas :)

rrthomas commented 4 years ago

Most common words should already be correctly hyphenated by LaTeX, but if you have any evidence to the contrary (specifically about hyphenation, not syllable count) for particular words then I'd be happy to have extra patterns.

I think Mc-Gon-a-gall is a good call; please could you submit a pull request to fix that?

jmichael2497 commented 4 years ago

oh i don't need credit for the change, and git seems to make things overly complicated (i'm more of a wiki fan), so feel free to go ahead on that as you've already got the setup for it.

meanwhile on LaTeX hyphenation, maybe the common words could just be removed at this point, leaving only fictional names, as the situation should have improved in the years since this 2014 quick search result i came across?

https://tex.stackexchange.com/a/182597 talking about microtype to avoid excessive hyphenation or small dangly pieces (which i notice is already being done), and comparing 2 American English vs British English libraries (which i don't see one specified but maybe its a default mentioned elsewhere).

being accustomed to reflowable text though, i find the whole hyphenation thing a bit antiquated of a concept, but at least it is automated nowadays.

rrthomas commented 4 years ago

I'm asking because I'd prefer you to do it as well as take the credit! On GitHub it's not necessary to use a single git command in this instance, just fork the project, edit the file (in your browser) and then submit a pull request.

I doubt that the LaTeX hyphenations have changed much, if at all, since 2014. Either way, I'd rather have evidence before removing hyphenations.

Hyphenation and reflowable text are orthogonal. If it's not feasible to get sufficiently tight whitespace on some lines for a given page size and line length, hyphenation is one of the few ways you can fix that (other than rewriting the text, which of course doesn't work with reflowable text!).

jmichael2497 commented 4 years ago

i ended up curious to see if there was a way to highlight all instances of hyphenation in the output file and ended up just coming across how to test where a word gets hyphenated instead.

https://blog.hartwork.org/posts/hypthenation-in-latex-why-it-kills-how-to-survive section on debugging has example and cites https://latex.org/forum/viewtopic.php?f=44&t=12694#p48326

looks like the common words could just be retested with the showhyphens command, then they can be compared to the manual overrides, to see if they are still needed based on log output with something like:

\documentclass{article} \usepackage{hyphenat} \begin{document} \showhyphens{analyse analysis brushes random remember replicated somewhere statistical whichever} Dummy \end{document}

for comparison, looks like the other folks just focused on names to either block hyphenation or keep them in larger chunks like Malfoy, Potter, Her-mione which is another way to look at it:

https://github.com/xenohedron/hpmor-xetex/blob/master/hp-header.tex#L272

rrthomas commented 4 years ago

Thanks for the pointers, @jmichael2497.