8

I know that it is possible to prevent the hyphenation of a word by setting \hyphenation{ }. However, this does not seem to work in some cases. Here is an example, where the word is the acronym "IRES".

\documentclass[12pt,a4paper]{article}

\usepackage[italian]{babel}

\hyphenation{IRES} \begin{document}

\begin{minipage}{7.6cm} Un Ente non residente può svolgere un'attività commerciale in Italia partecipando a una società di capitali italiana o attraverso una stabile organizzazione. In entrambi i casi sul reddito d'impresa si applicherà l'IRES. La stabile organizzazione dovrà determinare il reddito d'impresa prodotto nel territorio dello Stato applicando le stesse regole applicabili alle società di capitali italiane come se si trattasse di un'entità separata e indipendente dall'ente estero. \end{minipage} \end{document}

Which results in

enter image description here


with XeLaTeX

\documentclass[12pt,a4paper]{article}

\usepackage[italian]{babel}

\begin{document}

\begin{minipage}{7.6cm}

aaaaaaaaaaaaaaa bbbbbbbbbb cccccccccc aiii sul reddito d'impresa applicherà l'IRES. La stabile organizzazione applicabili alle società di capitali italiane come se si trattasse di un'entità separata e indipendente dall'ente estero.

\end{minipage} \end{document}

enter image description here

David Carlisle
  • 757,742
Massimo
  • 717
  • 4
  • 13

2 Answers2

7

Italian makes ' take part in hyphenation so you need l'IRES

enter image description here

\documentclass[12pt,a4paper]{article}

\usepackage[italian]{babel}

{\lccode'=' \hyphenation{l'IRES} }

\begin{document}

\begin{minipage}{7.6cm} Un Ente non residente può svolgere un'attività commerciale in Italia partecipando a una società di capitali italiana o attraverso una stabile organizzazione. In entrambi i casi sul reddito d'impresa si applicherà l'IRES. La stabile organizzazione dovrà determinare il reddito d'impresa prodotto nel territorio dello Stato applicando le stesse regole applicabili alle società di capitali italiane come se si trattasse di un'entità separata e indipendente dall'ente estero. \end{minipage} \end{document}

But hyphenation will be poor with OT1, you should always use T1 if using pdflatex.


Lualatex shows the same breakpoint as xelatex on the xelatex example, and the same solution as above removes the hyphenation resulting in

enter image description here

But for reasons not documented (but probably related to implementation details of interacting with harfbuzz) the code doesn't work (and nor does anything else I tried) using xelatex.

See egreg's answer, you can use rather than ' in \hyphenation for xelatex.

David Carlisle
  • 757,742
7

For XeLaTeX you need to avoid hyphenation of “l’IRES” (with U+2019), because ' is replaced with at typesetting time, but not when \hyphenation is used.

\documentclass[12pt,a4paper]{article}
\usepackage[italian]{babel}

{\lccode’=’ \hyphenation{l’IRES} }

\begin{document}

\parbox{0pt}{\hspace{0pt}l'IRES}

\end{document}

enter image description here

Probably you also need all’IRES and dell’IRES.

If you have troubles with inputting , then

{\lccode"2019="2019
\hyphenation{l^^^^2019IRES}
}

will do as well.

egreg
  • 1,121,712