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

0

2 Answers 2

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.

1
  • 2
    ah of course. That's really unfortunate, I'll have to upvote you:( Mar 7 at 17:20
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.

10
  • Unfortunately, it doesn't work in my actual book. I use OT1 in the MWE, but for the book I am using XeLaTeX. Could it be the reason?
    – Massimo
    Mar 7 at 14:18
  • 1
    @Massimo oh hyphenation is "different" in Unicode TeXs, you should have said:-) Let me see.... Mar 7 at 14:22
  • @Massimo I updated your question and my answer Mar 7 at 14:53
  • Thank you! Too bad it doesn't work with XeLaTeX/LuaLaTeX
    – Massimo
    Mar 7 at 15:36
  • 1
    @Massimo it does work with lualatex, just xetex seems out Mar 7 at 15:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .