Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
XeLaTeX/math/characters over 255 in OpenType font
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Newton  
View profile  
 More options Jul 12 2008, 8:37 pm
Newsgroups: comp.text.tex
From: Chris Newton <use...@firstname-surname.co.uk>
Date: Sun, 13 Jul 2008 01:37:07 +0100
Local: Sat, Jul 12 2008 8:37 pm
Subject: XeLaTeX/math/characters over 255 in OpenType font
Hi all,

A while back, I asked about getting maths fonts to match the text fonts
specified by fontspec when using XeLaTeX, so at least for simple
mathematics where the symbols are all available there would be a perfect
match between text and inline equations.

Will Robertson helpfully replied with this suggestion:

If Will or anyone else reading this could elaborate on that last comment,
I'd be grateful, as a few key symbols such as the minus sign are indeed
past 255 in the font I'm using. It seems that adding
   \DeclareMathSymbol{-}{\mathbin}{MRM}{"2212}
or any likely variation doesn't work in the latest versions of all the
software I'm using. Does this come from the general limitation in XeTeX
that \char can take 16-bit characters, but \mathchar only 8-bit?

If it's not currently possible to get this to work directly, is it at least
possible to define a \minussign macro or similar that can do the same
thing, perhaps by escaping to text mode where it does seem to be possible
to use 16-bit characters? This is a rare enough problem with my current
documents that such a workaround would be viable, though obviously I'd
prefer to just type '-' if there is a way it can be made to work.

Thanks,
Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Will Robertson  
View profile  
 More options Jul 13 2008, 6:30 pm
Newsgroups: comp.text.tex
From: Will Robertson <wsp...@gmail.com>
Date: Mon, 14 Jul 2008 08:00:51 +0930
Local: Sun, Jul 13 2008 6:30 pm
Subject: Re: XeLaTeX/math/characters over 255 in OpenType font
On 2008-07-13 10:07:07 +0930, Chris Newton
<use...@firstname-surname.co.uk> said:

>> Note that it looks like the spaces between symbols needs to be reduced
>> for this font. Also, this technique only works for glyphs in the first
>> 256 slots of the font, so you need to ask me for more code if you want
>> to get this working for Greek symbols as well :)

> If Will or anyone else reading this could elaborate on that last
> comment, I'd be grateful, as a few key symbols such as the minus sign
> are indeed past 255 in the font I'm using. It seems that adding
>    \DeclareMathSymbol{-}{\mathbin}{MRM}{"2212}
> or any likely variation doesn't work in the latest versions of all the
> software I'm using. Does this come from the general limitation in XeTeX
> that \char can take 16-bit characters, but \mathchar only 8-bit?

Yes and no; the processing in LaTeX's \DeclareMathSymbol does not allow
character slots greater than 256. XeTeX provides \XeTeXmathcode and so
on to access the full range of unicode character slots (see
CTAN:info/xetexref for a bit more information about XeTeX math
settings).

> If it's not currently possible to get this to work directly, is it at
> least possible to define a \minussign macro or similar that can do the
> same thing, perhaps by escaping to text mode where it does seem to be
> possible to use 16-bit characters?

Here's the "proper" way to do it:

\documentclass[12pt]{article}
\makeatletter
\usepackage[no-math]{fontspec}
\setmainfont{Charis SIL}
\DeclareSymbolFont{MRM}{EU1}{\zf@family}{m}{n}
\begin{document}
\XeTeXmathcode`\-="2 \symMRM "2212 % minus sign
$A-B$
\end{document}

One of these days I really have to finish off unicode-math so this
stuff just works. You're not expected to have to set this stuff up
manually. The first number ("2) refers to the mathtype of the symbol,
see fntguide.pdf for a full listing. \symMRM is obviously the
SymbolFont defined earlier, and "2212 is the unicode slot of the
mathematical minus sign.

(You can use this XeTeXmathcode method exclusively instead of the
\DeclareMathSymbol method I showed earlier, actually.)

Hope this helps,
Will


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Will Robertson  
View profile  
 More options Jul 13 2008, 6:33 pm
Newsgroups: comp.text.tex
From: Will Robertson <wsp...@gmail.com>
Date: Mon, 14 Jul 2008 08:03:01 +0930
Local: Sun, Jul 13 2008 6:33 pm
Subject: Re: XeLaTeX/math/characters over 255 in OpenType font
On 2008-07-13 10:07:07 +0930, Chris Newton
<use...@firstname-surname.co.uk> said:

>> Note that it looks like the spaces between symbols needs to be reduced
>> for this font. Also, this technique only works for glyphs in the first
>> 256 slots of the font, so you need to ask me for more code if you want
>> to get this working for Greek symbols as well :)

> If Will or anyone else reading this could elaborate on that last
> comment, I'd be grateful, as a few key symbols such as the minus sign
> are indeed past 255 in the font I'm using. It seems that adding
>    \DeclareMathSymbol{-}{\mathbin}{MRM}{"2212}
> or any likely variation doesn't work in the latest versions of all the
> software I'm using. Does this come from the general limitation in XeTeX
> that \char can take 16-bit characters, but \mathchar only 8-bit?

Yes and no; the processing in LaTeX's \DeclareMathSymbol does not allow
character slots greater than 256. XeTeX provides \XeTeXmathcode and so
on to access the full range of unicode character slots (see
CTAN:info/xetexref for a bit more information about XeTeX math
settings).

> If it's not currently possible to get this to work directly, is it at
> least possible to define a \minussign macro or similar that can do the
> same thing, perhaps by escaping to text mode where it does seem to be
> possible to use 16-bit characters?

Here's the "proper" way to do it:

\documentclass[12pt]{article}
\makeatletter
\usepackage[no-math]{fontspec}
\setmainfont{Charis SIL}
\DeclareSymbolFont{MRM}{EU1}{\zf@family}{m}{n}
\begin{document}
\XeTeXmathcode`\-="2 \symMRM "2212 % minus sign
$A-B$
\end{document}

One of these days I really have to finish off unicode-math so this
stuff just works. You're not expected to have to set this stuff up
manually. The first number ("2) refers to the mathtype of the symbol,
see fntguide.pdf for a full listing. \symMRM is obviously the
SymbolFont defined earlier, and "2212 is the unicode slot of the
mathematical minus sign.

(You can use this XeTeXmathcode method exclusively instead of the
\DeclareMathSymbol method I showed earlier, actually.)

Hope this helps,
Will


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »