# [XeTeX] Discretionary hyphens don't work in paragraphed footnotes

David Carlisle d.p.carlisle at gmail.com
Thu Oct 8 10:41:12 CEST 2015

On 8 October 2015 at 09:25, Philip Taylor <P.Taylor at rhul.ac.uk> wrote:
>
>
> Zdenek Wagner wrote:
>
>> I have no time to look deep into it but does anybody know what is the
>> definition of \- if these packages is used? Isn't is possible that it is
>> a fragile macro? I remember one thing from Phil Taylor's tutorial held
>> on EuroTeX'92 in Prague. He said that the most frequent error is wrong
>> timing of expansion. Is it possible that \- is redefined in such a way
>> that it disappears somewhere during expansion of \footnote before t is
>> typeset?
>
> More than possible :-(  Why /does/ LaTeX have to meddle so ?!

To make the format suitable for typesetting document, probably.

>
> \-::macro:->\x at protect \-\protect \-
>
> Try :
>
> % !TeX Program=XeLaTeX
> \documentclass[a4paper]{article}
> \usepackage{fontspec}
> \usepackage[para]{footmisc}
> \begin{document}
> \def \-{\discretionary {}{}{}}
> \footnote{XXXXXXXXXXXXXX just a few normal words to fill up the line
>   up to my x x x hy\-phe\-n\nobreak a\-te\-me }
> \end{document}
>
> ** Phil.
>

You'll see that example is another instance of the bug, as that is you
get a hyphen
after hy-  which you should not as you have defined \- to have three
empty hlists,
you get the same if you remove the definition.

It seems to be there just that the \nobreak is making the first part
not be th elast word in the paragraph.

so your example is makes exactly the same output as

% !TeX Program=XeLaTeX
\documentclass[a4paper]{article}
\usepackage{fontspec}
\usepackage[para]{footmisc}
\begin{document}
%\def \-{\discretionary {}{}{}}
\footnote{XXXXXXXXXXXXXX just a few normal words to fill up the line
up to my x x x hyphen\nobreak ateme }
\end{document}

actually  the trailing space is enough to make it not the last word,
as you noted originally.

David