3

I'm using polyglossia package in my document and have some parts where I don't want to have hyphynation so I'm using \disablehyphenation command as documented. Now when I'm having very long words in a line I would expect the second long word to go to the next line (see section 1 in the image below). But when the first word gets shorter the second one does no longer go to the second line.

enter image description here

Here is my MWE:

\documentclass{scrartcl}

\usepackage{polyglossia}

\begin{document}
    \fontsize{30}{30}\selectfont
    \disablehyphenation
    \section{expected}
    Aquickbrownfoxjumpsoverthelazydog Aquickbrownfoxjumpsoverthelazydog
    \section{unexpected}
    Aquickbrownfoxjumpsoverthelazy Aquickbrownfoxjumpsoverthelazydog
\end{document}

Any ideas how to force the second word to be on the next line? (manual Newline is no option - its generated content)

Thanks in advance!

1 Answer 1

5

Desperate times, desperate measures.. Use \sloppy

\documentclass{scrartcl}

\usepackage{polyglossia}

\begin{document}
    \fontsize{30}{30}\selectfont
    \disablehyphenation
    \sloppy
    \section{expected}
    Aquickbrownfoxjumpsoverthelazydog Aquickbrownfoxjumpsoverthelazydog
    \section{unexpected}
    Aquickbrownfoxjumpsoverthelazy Aquickbrownfoxjumpsoverthelazydog
\end{document}

enter image description here

If you want this effect locally, use sloppypar environment like

\begin{sloppypar}
content
\end{sloppypar}

On the other hand, you can also use \raggedright (thanks to R. Schumacher for reminding).

7

You must log in to answer this question.

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