ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* lmtx update: two experimental features
@ 2021-04-18 17:16 Hans Hagen
  0 siblings, 0 replies; only message in thread
From: Hans Hagen @ 2021-04-18 17:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I uploaded a new version. There are two new features that are 
experimental. This time we attempt to deal with the more tricky things 
and artifacts of the otherwise nice tex machinery we need to get rid of. 
One can rightfully argue that they are not really issues as one can work 
around them (and so they are never brought to attention) but why not 
make things better (cleaner) if we can.


(1) Languages: hyphenation normally uses a hyphen and the engine has 
some messy work-around-border-cases in the hyphenator. So, I wondered if 
we could improve that.

First of all, there can now be more than one hyphen character so here is 
the way to deal with it (the hyphenchar code is like the other 'codes'):

\hccode"002D = "002D
\hccode"2010 = "2010
\hccode"2013 = "2013
\hccode"2014 = "2014

This makes all these four into (kind of) compound word seperators:

\startTEXpage \hsize3mm
     firstpart\char"002D secondpart\blank
     firstpart\char"2010 secondpart\blank
     firstpart\char"2013 secondpart\blank
     firstpart\char"2014 secondpart
\stopTEXpage

will work ok. There are provisions for those characters being at the 
left and right edges. All is under low level (engine) option controls 
(compatibility and such) but currently I enable all. With a bit of 
definitions one can for the 002D and 2010 cases deal with pre/post 
variants .. the question is do we need that for more, if so, then I need 
to add some more code (doable).

This feature relates to Denis collection of German compound words and 
ligature prevention data. Dutch has the same issue. (Denis: we can ditch 
the compound word entries now, the ones with -.)

Also, this kind of automatism (keep in mind that normally tex won't 
hyphenate the first word in such a compound) is especially handy in 
cases where there is no control over the input as with xml (when we do 
have control you can use || as compound word marker).

(I'm wondering if we should deal with the typical somewhat archaic tex 
-- and --- in a different manner, but I'll come back to that.)


(2) Math: what is added is not so much an issue in traditional tex math 
usage which is for journals but as context is used for educational 
purposes and thereby has quite some tricks built in. Some of these jump 
through ugly hoops to get it done. Here I stick to color as example.

Just try this (notice the spacing):

\startTEXpage[offset=10pt]
     \showmakeup[mathglue]%
     \enableexperiments[simplegroups]%
     $ a = b \color[red]{=} c \startcolor[blue]=\stopcolor d $\par
     $ \sin \color[green]{(x)} = \sin {(x)} $\par
     \disableexperiments[simplegroups]%
     $ a = b \color[red]{=} c \startcolor[blue]=\stopcolor d $\par
     $ \sin \color[green]{(x)} = \sin {(x)}$\par
\stopTEXpage

The 'simplegroups' experiment enables a more hybrid grouping model but 
we (read: Wolfgang, Aditya and I, but input is welcome) need to check 
for side effects carefully.

The 'mathglue' tracker is also new, and it exposes what actually goes 
on. It has to do with the fact that something grouped with { } creates a 
math list which enforces different spacing but in the case of color that 
is a side effect we don't want (of course it relates to how context 
implements the \color macro and one could work around it, but the 
problem is of a more general nature.


Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-18 17:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-18 17:16 lmtx update: two experimental features Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).