I sent this query to the tex-hyphen list a little while ago, but there's been no solution so far. I wonder if anyone here can suggest what is going on?<br><br>Thanks,<br>Dominik<br>
<br><div class="gmail_quote">---------- <br><br>I'm sorry not to have a minimal example for this query. <br><br>I'm getting different hyphenation results depending on the order of language/font invocation. I find this unexpected.<br>
<br>
<br>
Thus, if I say <br>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\usepackage{polyglossia}</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\usepackage{xltxtra}</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\defaultfontfeatures{Mapping=tex-text,Numbers=OldStyle}</p><div style="margin-left: 40px;">\setmainfont{TeX Gyre Pagella}</div>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\setdefaultlanguage[variant=british]{english}</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\setotherlanguage{sanskrit} % for transliterated Sanskrit</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\newfontfamily\sanskritfont %[Script=Devanagari]</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">{TeX Gyre Pagella} </p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">%</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">% Define \sansk{} which is the same as \emph{}, except that it causes appropriate <br>% hyphenation for Sanskrit words. <br></p><p style="margin: 0px 0px 0px 40px; text-indent: 0px;">
% Use \sansk{} for Sanskrit and \emph{} for English.</p>
<div style="margin-left: 40px;">\newcommand{\sansk}[1]{\emph{#1}}</div>
<div style="margin-left: 40px;"><br></div>then I get some very wrong hyphenations in the English text. For example, s-moothly, and other cases with one letter at the end of the line. This means lefthyphenmin is being seen as 1 in the English text, where it shouldn't be. lefthyphenmin is indeed 1 for the Sanskrit. <br>
<br>
If I set up the Sanskrit first, and say,<br> <br>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\usepackage{polyglossia}</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\usepackage{xltxtra}</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\defaultfontfeatures{Mapping=tex-text,Numbers=OldStyle}</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\setotherlanguage{sanskrit} % for transliterated Sanskrit</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\newfontfamily\sanskritfont %[Script=Devanagari]</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">{TeX Gyre Pagella} </p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">%</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\setmainfont{TeX Gyre Pagella}</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">\setdefaultlanguage[variant=british]{english}</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">% Define \sansk{} which is the same as \emph{}, except that it causes appropriate</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">% hyphenation</p>
<p style="margin: 0px 0px 0px 40px; text-indent: 0px;">% for Sanskrit words. Use \sansk{} for Sanskrit and \emph{} for English.</p>
<div style="margin-left: 40px;">\newcommand{\sansk}[1]{\emph{#1}}</div>
<div style="margin-left: 40px;"><br>
</div>
<div style="margin-left: 40px;"><br></div>
Things are okay. Well, the English is okay. The Sanskrit has lefthyphenmins of 2, but that suits me.<br><br>TeXbook 455: "Each whatsit records the current \lefthyphenmin and \righthyphenmin." So these settings should change with each \language change. They're not global.<br>
<br>Best,<br><font color="#888888">Dominik</font><div><div></div><div class="h5"><br>PS I'm not using Devanagari, but Roman-script transliteration. I'd quite like to be able to
say [Script=Latin] (or Roman), to be explicit about this, but it's
disallowed. Anyhow, that's a different topic.<br>
<br><br><div class="gmail_quote">On 4 January 2011 16:25, Dominik Wujastyk <span dir="ltr"><<a href="mailto:wujastyk@gmail.com" target="_blank">wujastyk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<font size="1">Yup, works perfectly with xltxtra. Sorry for these elementary questions!<br><br>Thanks,<br><font color="#888888">Dominik<br></font></font><div><div></div><div><font size="1"><a href="https://www.dropbox.com/referrals/NTIzNzI2MTY5" target="_blank"></a></font><br>
<br><br><div class="gmail_quote">On 4 January 2011 14:19, Jonathan Kew <span dir="ltr"><<a href="mailto:jfkthame@googlemail.com" target="_blank">jfkthame@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>On 4 Jan 2011, at 12:44, Dominik Wujastyk wrote:<br>
<br>
> Minimal example, run with xelatex and TeXlive 2010:<br>
><br>
> \documentclass{article}<br>
> \usepackage{polyglossia}<br>
> \begin{document}<br>
> \showhyphens{helicopter}<br>
> \end{document}<br>
><br>
><br>
> Why does my log file show<br>
><br>
> Underfull \hbox (badness 10000) in paragraph at lines 4--4<br>
> [] \EU1/lmr/m/n/10 helicopter<br>
><br>
> instead of<br>
><br>
> Underfull \hbox (badness 10000) in paragraph at lines 4--4<br>
> [] \OT1/cmr/m/n/10 he-li-copter<br>
><br>
<br>
</div>Because the default LaTeX \showhyphens doesn't work with "native" fonts (i.e. those loaded without TFMs, etc) in xetex, and polyglossia loads fontspec which sets the default font to LM loaded as a "native" unicode font.<br>
<br>
If you try actually using "helicopter" in text, you'll find that it still hyphenates fine.<br>
<br>
To fix \showhyphens, try loading the xltxtra package.<br>
<br>
(There's discussion of this somewhere in the list archives, IIRC.)<br>
<font color="#888888"><br>
JK<br>
<br>
<br>
</font></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></div><br>