Re: [NTG-context] Unicode mathematics in ConTeXt

2019-05-03 Thread Hamid,Idris
Dear gang,

Ok, I've made some progress:

1. tex-gyre etc. *do* support Unicode mathematics, but the version of  
ConTeXt I was using had produced the wrong encoding in the pdf output. For  
example, U+1D4D2 (퓒) in the input was being mapped to U+2D4D2 in the  
output.

Updating to the latest beta appears to have fixed this issue.

2. tex-gyre etc. appears to be missing some superscript characters, e.g.,  
ⁿ (U+207F).

3. New example:

===
\setupbodyfont
   [cambria,12pt]
   % [pagella,12pt]
   % [times,12pt]

% \starttext
\startTEXpage
\def\ANTI{{^{\rm nt}}}
\def\ANTIU{{^{\rm ⁿᵗ}}}

\def\CATCA{$\cal \bf C\ANTI$}
\def\CATCAU{$퓒\ANTIU$}

퓒 \CATCA \CATCAU
\stopTEXpage
% \stoptext
===

\CATCAU and \ANTIU use Unicode characters and superscripts directly,  
instead of the old TeX method.

4. Issues. In the pdf output of \CATCAU:
i)   Why does ConTeXt make the second superscript larger than the first?
ii)  If one copies the text of the pdf output to an editor - even this  
email client - the second superscript moves to a new line:

퓒 ⁿ
t

Why does this happen? Is this a bug?

5. Here is what we want: 퓒 ⁿᵗ

What is the proper or best way to get a character-superscript combination  
in ConTeXt whose output can be copied and pasted to an editor and give the  
correct result? What am I missing?

Thank you in advance.

Best wishes
Idris

On Wed, 01 May 2019 14:58:06 -0600, Hamid,Idris  
 wrote:

> Dear gang,
>
> I need to convert a document from TeX-style to Unicode mathematics. For
> example:
>
> \starttext
> \def\ANTI{{^{\rm nt}}}
> \def\CATCA{$\cal \bf C\ANTI$}
>
> \CATCA
> \stoptext
>
> Issues:
>
> 1. I need calligraphic characters, but the relevant characters in
> latinmodern-math.otf are not encoded in (standard) Unicode. The same goes
> for the tex-gyre-math fonts.
>
> 2. What comprehensive unicode-math fonts do you recommend as an
> alternative?
>
> 3. In the above example, \cal is used.
>
> 4. Other issues may arise, e.g., getting subscripts and superscripts
> correct. How might one rewrite the above with Unicode mathematics in  
> mind?
> Is there a My Way or some other guide to Unicode mathematics in ConTeXt?
>
> This writer has never had to think about this matter before so this is  
> all
> new ground to learn. Thank you in advance for any guidance.
>
> Best wishes
> Idris


-- 
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512

scratch.pdf
Description: scratch.pdf


scratch.tex
Description: scratch.tex
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] XML xmldoif struggle!

2019-05-03 Thread Geert Verhaag

Hi Aditya,

The ConTeXt team did a great job in writing the manual xml-mkiv.pdf, but 
I think it is not meant for a beginner.


Its contents is rather overwhelming when trying it for the first time.

For me, I don't use luatex a lot, so that adds to the difficulty of 
trying it out.


Regards,
Gerard

On 03-05-19 00:51, Aditya Mahajan wrote:

On Thu, 2 May 2019, Geert Verhaag wrote:


Yes, I got it working!

It is somewhat tricky.

Trying to understanding the concepts behind all this isn't easy for 
me, but I'm bashing on.


I also find understanding XML processing rules to be complicated. I 
simply convert the XML to a lua table, and then use all the processing 
in lua using CLD (context lua documents).


Aditya
___ 

If your question is of interest to others as well, please add an entry 
to the Wiki!


maillist : ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___ 




___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Reading XML with lua

2019-05-03 Thread Axel Kielhorn
Hi,

I’ m finally at a point where I can read an XML file look at it and write it 
back.

Right now I have two problems:

1. There are many empty entries in the table.
This makes processing the file a little tedious since I have to filter the real 
entries.

2. Some entries contain leading and trailing whitespace and linkebreaks.
These are the result of formatting the XML file.
Shouldn't
strip_cm_and_dt
take care of them?
Or do I use that incorrectly?

I have included my lua file and an example xml.
You can run it with
mtxrun —script p.lua

Greetings Axel





doclist.xml
Description: XML document


p.lua
Description: Binary data
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] \xmlloadfile not longer defined?

2019-05-03 Thread Axel Kielhorn
Hi,

according to xml-mliv.pdf there is a command

\xmlloadfile

But I get:

tex error   > tex error on line 168 in file 
/Users/axel/Documents/Text/Dokumente_ConTeXt/Prozessbeschreibung/prozess-style-buffer.tex:
 ! Undefined control sequence

l.168 \xmlloadfile
{doclist.xml}{doclist}{}

and grep does not find it.

\xmlload

works.

Greetings Axel
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] tex.month can't be overridden like tex.day and tex.year

2019-05-03 Thread Tristan Stenner
Dear list,

in the following document I can set the date as seen by LuaTeX so the
date functions use a different date:

---
\starttext
\ctxlua{tex.year=1980; tex.month=1; tex.day=15}

% Taken from https://wiki.contextgarden.net/Command/date,
% outputs 15 may 1980
\date[m=1][day,~,{\monthshort\normalmonth},~,year]

% outputs January 15, 1980
\ctxlua{context.date{m=tex.month};}
\stoptext
---

This works for all parts of the date (even the weekday), except the
month. I've looked through the core-con.lua and found nothing that would
explain this (or what I'd need to change), as the tex.month is properly set.

Best regards
Tristan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___