On 2/19/2011 12:13 AM, I wrote:
In a grammar we're writing, the transcription of a word "xowunʣāy" gets
hyphenated immediately after the 'x'. I thought I could prevent this by
adding the command
\hyphenation{xowunʣāy}
near the beginning of the file (before the \begin{document} command).
However, this has no effect; the word still gets hyphenated.

The paragraph of text in the input is
Applies to nouns (including verbal nouns) and
adjectives. \pusArabicScript{ښوون(ه)} /xowun(a)/ \emph{teaching};
\pusArabicScript{ښوونځای} /xowunʣāy/ \emph{schoolhouse}.
where \pusArabicScript is our command to switch into Arabic script.

Any idea why the \hyphenation{} command is ineffective?

After a great deal of pulling of hair, I think I've found what's happening. I'm recording it here in case it helps anyone (and because one aspect of it seems a bit odd, possibly buggy--although it's beyond my competence to decide that).

The quick answer is that, given certain packages I was loading, the slashes (used in the above as linguistic markers of the phonemic status of the transcriptions) are treated as word-forming characters, meaning that the \hyphenation{} command needs to include the slashes.

I'm attaching a minimal example after my signature. The word that erroneously hyphenates in the first paragraph despite the \hyphenate{xowun} command is "/xowun/". The second paragraph in the minimal example is preceded by \hyphenate{/xowun/} (*with* the slashes), and in this paragraph /xowun/ correctly does not hyphenate. (You can ignore the rest of the text in the paragraphs, it's nonsensical and used only to force /xowun/ into a position where LaTeX wants to hyphenate it.)

What seems odd to me about this (and possibly indicative of a bug) is that the \hyphenate{/xowun/} command only seems to need the slashes around "xowun" if I load the 'listings' package; indeed, without the 'listings' package the command \hyphenate{/xowun/} results in an error msg ("Not a letter", referring to the slash). Why should the 'listings' package affect how the "/" character is treated by the \hyphenate command?

As I say, I'm unsure whether this constitutes a bug, and if so, where it should be reported. Furthermore, this is happening with the TexLive 2009 distro; for various reasons, I don't have the 2010 distro loaded, and I don't know whether it would happen there. I'm open to advice.

I'm also unsure why the 'bibtopic' package needs to be loaded (without the 'bibtopic', I get a "Missing \begin{document}" error msg). This package was apparently auto-generated using docstrip, and at least to this human it's not humanly readable.
--
        Mike Maxwell
        maxw...@umiacs.umd.edu

----------Minimal example follows-----------------
\documentclass[11pt,letterpaper]{report}
\usepackage{fontspec}
\setmainfont{Charis SIL}

%omitting the 'bibtopic' pkg results in "Missing \begin{document}" msg:
\usepackage{bibtopic}
\usepackage{listings}

\begin{document}
%------------Hyphenation:
%List of words not to hyphenate (or to allow hyphens at particular places);
% see http://en.wikibooks.org/wiki/LaTeX/Formatting#Hyphenation for documentation.

\hyphenation{xowun}
%First para: /xowun/ is erroneously hyphenated:
A suffix: Now is time for good suffixes to come
Applies to nouns.  /xowun/

\hyphenation{/xowun/}
%Second para: /xowun/ is correctly not hyphenated:
A suffix: Now is time for good suffixes to come
Applies to nouns.  /xowun/

\end{document}


--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
 http://tug.org/mailman/listinfo/xetex

Reply via email to