[XeTeX] line spacing

Ross Moore ross at ics.mq.edu.au
Wed Mar 9 03:30:35 CET 2005


On 08/03/2005, at 10:06 AM, Jonathan Kew wrote:

> On 7 Mar 2005, at 9:59 pm, Ross Moore wrote:
>
>> That should result in a fully backwards-compatible
>> definition of ^^^^00a0 that will do the right thing
>> for auxiliary files, TofCs, indexes, etc.
>> (It also will ensure that ~ has this latter property too!)
>
> I don't see any compelling reason to map either ~ or ^^^^00a0 to 
> \char32; it would be simpler, and just as effective, to let both of 
> these be active characters that expand to {\penalty10000\ } or 
> equivalent.

The original poster wanted to specifically insert \char32 into the PDF
when ^^^^00A0 is encountered.

You are right that TeX normally does not include space characters.
Perhaps the intention is to be able to make some phrases
findable in the PDF using the "Find" command.
This may be achievable with the right definitions of a non-breaking 
space,
using only font characters.


> That's the TeX way to do a non-breaking space.
>
> So (noting that ^^a0 is a perfectly good short form for ^^^^00a0), how 
> about simply:
> 	\catcode`\^^a0=\active
> 	\let^^a0=~
> (Maybe that's not enough to fit in properly with The LaTeX Way, but 
> you get the idea.)

Sure; this is enough to make the two characters work equivalently,
unless packages alter the definition of ~ in certain contexts.
For example, in URLs the ~ becomes \textasciitilde .

Normally in LaTeX one has:
   ~  -->  \nobreakspace

which is a robust command expanding to {\leavevmode\nobreak\ }.
Here's a tracing:

~->\nobreakspace {}

\nobreakspace ->\protect \nobreakspace
{\relax}

\nobreakspace  ->\leavevmode \nobreak \

\leavevmode ->\unhbox \voidb at x
{\unhbox}
{horizontal mode: \unhbox}

\nobreak ->\penalty \@M
{\penalty}
{\ }


This expansion is independent of font-encoding.
That's what I think should be changed.
When XeTeX uses a 'U'-encoded font, then the \char32
can be inserted instead, or perhaps even the ^^a0
character itself.

I'm not sure how this would affect the TeX processing.
Is the \nobreak (or \penalty -10000) still needed
to inhibit breaking and/or hyphenation at this place ?

Ultimately TeX uses {\ } to get the width of a space.
But that's a primitive command which doesn't actually
insert a space at all, right?

I don't want to hack at '\ ' as this might break a lot
of things. It *is* legitimate to hack at \nobreakspace
to give different expansions according to font-encoding.

But maybe that's not advisable either; in which case
^^a0 needs a separate expansion, which defaults to be
the same as ~ when the font-encoding is not 'U'.


>
> (Yes, there are some circumstances where the end result would be 
> different; but they're obscure enough that I think you could ignore 
> them. People who really care about them had better know what they're 
> doing, and can make their own definitions!)

I'm not convinced that it is so obscure.
I've heard complaints that PDFs from LaTeX are not properly
searchable (due to the prevalence of \kern s and glue ?).

Such a mechanism using non-breaking spaces could help,
at least for particular important word groups.



I'd appreciate further comments on this issue, before
trying to implement something that may be useless or
even destructive.


Cheers,

	Ross




>
> Just my thoughts on it .... JK
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>
------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------



More information about the XeTeX mailing list