0

I can't figure out how to do this properly, and I'd hate to go through all my files and adding a zillion \-s. Here is my MWE:

\documentclass[12pt]{memoir}
\usepackage{polyglossia}
\setdefaultlanguage{danish} % set language for polyglossia

\usepackage{hyphenat}
\hyphenation{cham-pag-ne}

\usepackage{microtype}

\begin{document}
\fbox{%
\begin{minipage}{1cm}
champagne 
\end{minipage}
}
\end{document}

And here's what it looks like (pardon the potato quality):

enter image description here

What is the proper way of doing this? I'd love to have a global file, but I need the basics sorted out first ...

4

It hyphenates as you have it in luatex, but xetex, like classic tex, doesn't hyphenate the first word of a paragraph, so you need a 0pt width space. Also because of some polyglossia timing? I needed to do the hyphenation exception after begin document.

enter image description here

\documentclass[12pt]{memoir}
\usepackage{polyglossia}
\setdefaultlanguage{danish} % set language for polyglossia

\usepackage{hyphenat}


\usepackage{microtype}


\begin{document}
\hyphenation{cham-pag-ne}
\fbox{%
\begin{minipage}{1cm}
\hspace*{0pt}champagne 
\end{minipage}
}
\end{document}
8
  • This is better for sure, but I see that some of my rules are ignored. Can I remedy this somehow? – Kristian Nordestgaard Jul 21 '16 at 15:22
  • 1
    @KristianNordestgaard example? – David Carlisle Jul 21 '16 at 15:24
  • \documentclass[12pt]{article} \usepackage{polyglossia} \setdefaultlanguage{danish} % set language for polyglossia \usepackage{hyphenat} \usepackage{microtype} \begin{document}\hyphenation{cham-pag-ne hav-de} \fbox{% \begin{minipage*{0pt}age}{.5cm} \hspace*{0pt}champagne champagne havde havde \end{minipage} } \end{document} Edit: Tried to make a code block, but seems it is impossible! – Kristian Nordestgaard Jul 21 '16 at 15:28
  • @KristianNordestgaard that's too narrow even for your extra breakpoints I added an image above – David Carlisle Jul 21 '16 at 15:40
  • 1
    @KristianNordestgaard at the end of my answer – David Carlisle Jul 21 '16 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.