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

hyphenrules and \hyphenation #122

Closed
u-fischer opened this issue Mar 15, 2021 · 6 comments
Closed

hyphenrules and \hyphenation #122

u-fischer opened this issue Mar 15, 2021 · 6 comments
Labels
has workaround ⚙️ under study Exact behavior to be decided

Comments

@u-fischer
Copy link
Member

The documentation of the experimental german patterns, dehyph-exptl, recommend to use \babelprovide{hyphenrules...} to activate the patterns. This works but disables the \hyphenation command, unless one explicitly reset the language:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[main=ngerman]{babel}
%\babelprovide[hyphenrules=ngerman-x-latest]{ngerman}
% \selectlanguage{ngerman}
\hyphenation{Steg-lei-tung}
\begin{document}
\showhyphens{Abendstern}
\showhyphens{Stegleitung}
\end{document}

Result as is:

\T1/cmr/m/n/10 Abends-tern     % old, wrong
\T1/cmr/m/n/10 Steg-lei-tung    % correct

Result with \babelprovide line

 \T1/cmr/m/n/10 Abend-stern  %new, correct
 \T1/cmr/m/n/10 Ste-glei-tung % wrong

Result with additional \selectlanguage

\T1/cmr/m/n/10 Abend-stern   %new, correct
\T1/cmr/m/n/10 Steg-lei-tung  %correct
@jbezos
Copy link
Contributor

jbezos commented Mar 16, 2021

I'm not sure if \babelprovide should apply the patterns in addition to setting them. Note \hyphenation is not expected to always work (and this is the very reason \babelhyphenation was added):

\documentclass{article}
\usepackage[italian]{babel}

% \hyphenation{l’a-qui-la}  % Fails when not commented out

\begin{document}
\showhyphens{l’aquila}
\end{document}

But I will think about it.

@lemzwerg
Copy link

I have no opinion on that. However, it should be documented in case the current behaviour is desired.

@jbezos
Copy link
Contributor

jbezos commented Mar 18, 2021

It's not desired in the sense ideally \hyphenation should always work. But it doesn't and it's one of the reasons the manual states “To set hyphenation exceptions, use \babelhyphenation”.

@lemzwerg
Copy link

I suggest to extend this sentence to

“To set hyphenation exceptions, use \babelhyphenation instead of \hyphenation.”

@jbezos
Copy link
Contributor

jbezos commented Mar 18, 2021

@lemzwerg 👌 And I'll promote it to a note or even a warning.

@jbezos jbezos added the ⚙️ under study Exact behavior to be decided label Apr 15, 2021
jbezos pushed a commit that referenced this issue Mar 19, 2023
@jbezos
Copy link
Contributor

jbezos commented Mar 19, 2023

After two issues in the same direction, even if I'm not quite convinced, the hyphenation rules are selected and applied. This seems to be the expected behaviour.

@jbezos jbezos closed this as completed Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has workaround ⚙️ under study Exact behavior to be decided
Projects
None yet
Development

No branches or pull requests

3 participants