[luatex] a question about the names \Umathcharnumdef etc
jfbu
jfbu at free.fr
Fri Oct 16 08:42:18 CEST 2015
Le 15 oct. 2015 à 22:05, Joseph Wright <joseph.wright at morningstar2.co.uk> a écrit :
> On 15/10/2015 19:20, jfbu wrote:
>>
>> Le 15 oct. 2015 à 19:58, jfbu <jfbu at free.fr> a écrit :
>>
>>>
>>> Le 15 oct. 2015 à 19:43, jfbu <jfbu at free.fr> a écrit :
>>>
>>>>
>>>> Le 15 oct. 2015 à 19:37, David Carlisle <d.p.carlisle at gmail.com> a écrit :
>>>>
>>>>> On 15 October 2015 at 18:35, jfbu <jfbu at free.fr> wrote:
>>>>>> Hi Joseph
>>>>>>
>>>>>> Le 15 oct. 2015 à 19:29, Joseph Wright <joseph.wright at morningstar2.co.uk> a écrit :
>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> Hello Jean-François,
>>>>>>>
>>>>>>> The 'real' names of the primitives have always been just \Umath... For
>>>>>>> some time they've been enabled with the "luatex" prefix.. The LaTeX team
>>>>>>> have recently taken a more 'active' interest in directly supporting
>>>>>>> LuaTeX (and XeTeX) by modifying latex.ltx to 'know' about these engines.
>>>>>>> As part of that process, we've revised the approach to the newer
>>>>>>> primitives and dropped the prefix 'out of the box'.
>>>>>>>
>>>>>>> For code that needs to work both with older (pre 2015/10/01) and newer
>>>>>>> (2015/10/01 onward) kernel releases, adding
>>>>>>>
>>>>>>> \directlua{
>>>>>>> tex.enableprimitives("luatex", tex.extraprimitives("Umath"))
>>>>>>> }
>>>>>>>
>>>>>>> (for just the Umath set) will do the job. Alternatively, if the code in
>>>>>>> your package gets modified to drop the prefix then
>>>>>>>
>>>>>>> \directlua{
>>>>>>> tex.enableprimitives("", tex.extraprimitives("Umath"))
>>>>>>> }
>>>>>>>
>>>>>>> will ensure that the 'natural' names are available with older kernel
>>>>>>> releases.
>>>>>>
>>>>>>
>>>>>> OK, let's see if I get you right: I remove from mathastext.sty
>>>>>> all "luatex" prefixes, but also I need to add
>>>>>>
>>>>>> \directlua{
>>>>>> tex.enableprimitives("", tex.extraprimitives("Umath"))
>>>>>> }
>>>>>>
>>>>>> to mathastext.sty if it detects luatex,
>>>>>>
>>>>>> so as to be sure the new version of the package will work also
>>>>>> with older LaTeX releases ?
>>>>>>
>>>>>> is that right ?
>>>>>>
>>>>>> best,
>>>>>>
>>>>>> Jean-François
>>>>>
>>>>>
>>>>> That works in general for primitives that were previously prefixed
>>>>> \luatex... but the \Umath... names are special in that they were
>>>>> previously available both prefixed and not prefixed, so you can just
>>>>> use the unprefixed ones.
>>>>>
>>>>
>>>> Hi David,
>>>>
>>>> ok, this is very clear, thanks, sorry if I have one last question does
>>>> "previously available" mean "all the way back to 2011" ?
>>>>
>>>> I can't test it on my laptop which only has TeXLive 2012 and later,
>>>> and I would like not to break installations as far back as 2011,
>>>>
>>>> best
>>>>
>>>> Jean-François
>>>
>>> Hi David/Joseph,
>>>
>>> [ I apologize to the list, perhaps I should move this discussion to
>>> a LaTeX list ]
>>>
>>> sorry again, but texdoc ltnews did not give me the following info:
>>>
>>> should I also remove the "xetex" prefixes and use "\Umathchardef"
>>> also under XeLaTeX ? from texdoc xetex, the primitives are there
>>> only with "U" prefix.
>>>
>>> best,
>>>
>>> Jean-François
>>>
>>
>> Hi all,
>>
>> sorry for all the fuss. I will do
>>
>> \let\mst at Umathcharnumdef\Umathcharnumdef
>> \let\mst at Umathcodenum\Umathcodenum
>> \let\mst at Umathcode\Umathcode
>> \let\mst at Umathchardef\Umathchardef
>>
>> then test if \mst at Umathcode is \undefined
>> and in the latter case use either "luatexU" or "XeTeX"
>> prefix depending on the engine,
>>
>> besides I am sorry about the TL2011 thing, because
>> regarding LuaLaTeX the doc of mathastext says
>> already TL2013 or later is needed.
>>
>> mathastext.sty will be leaner as I can not
>> treat identically both unicode engines
>>
>> best wishes
>>
>> Jean-François
> From TL2013 both XeTeX and LuaTeX have \Umath...
>
> Joseph
>
Hi Joseph,
thanks for this extra info. It is only
for LuaTex that I needed not farther back than 2013,
for XeLaTeX I needed more, in fact 2010, because
mathastext first appeared in 2011 at the time of TL2010.
the current XeTeX manual explains the adoption
of the U names starting with revision number 9999
and David and your explanations gave me the
explanations for the LaTeX interface to LuaTeX.
I chose to define by default aliases via \let
to the "U" named primitives, check after that
if \Umathcharnumdef is undefined
and in that case re \let the aliases to either the
"luatexU" or "XeTeX" primitives. The former should
never happen from David explanations and yours,
but that's ok to have a bit of superfluous code
in mathastext, anyhow it has other dubious portions, when
I coded its first version I barely knew what a (La)TeX macro
was, I was imitating pieces of codes I saw in other packages
(and wasn't even aware something like source2e.pdf existed),
and as performance is not a relevant issue at this level,
I am only looking for code that works.
best regards
Jean-François
More information about the luatex
mailing list