Re: [NTG-context] Size of root symbol

2021-08-18 Thread Hans Hagen via ntg-context

On 8/18/2021 6:06 PM, Aditya Mahajan via ntg-context wrote:

On Wed, 18 Aug 2021, Bruce Horrocks via ntg-context wrote:


Is there a simple way to get both root signs in this MWE to be the same size?

\starttext
\startformula
\sqrt[3]{4n} \ne \sqrt[3] {n}
\stopformula
\stoptext


Make the quantities whose roots are being taken to be of the same size.

\starttext

% The simplest solution:
\startformula
\sqrt[3]{4n} \ne \sqrt[3] {\vphantom{4} n}
\stopformula

% More general
% \strut = \vphantom{(}, which is too big
\startformula
\sqrt[3]{\strut 4n} \ne \sqrt[3] {\strut n}
\stopformula

% We can define our own phantom sizes. You can play around with the numbers.
\define\filler{\vrule width 0pt height 2ex depth 0.3ex \relax}
\startformula
\sqrt[3]{\filler 4n} \ne \sqrt[3] {\filler n}
\stopformula

\stoptext

This is for Aditya to think about

\starttext

\unprotect

\defcsname\??mathradicalalternative Mine\endcsname#1%
  {\csname\??mathradicalalternative\v!normal\endcsname
 {\synchronizestrut{\mathradicalparameter\c!strut}\strut#1}}

% \defcsname\??mathradicalalternative Mine\endcsname#1%
%   {\rootradical
%  {\currentmathradicaldegree}
%  {\synchronizestrut{\mathradicalparameter\c!strut}\strut#1}}

\protect

\definemathradical[MyRoot] [strut=cap,alternative=Mine]
\definemathradical[MyRootX][strut=yes,alternative=Mine]

\startformula
\sqrt[3]{4n} \ne \sqrt[3] {\vphantom{4} n}
\stopformula

\startformula
\MyRoot[3]{4n} \ne \MyRoot[3] {n}
\stopformula

\startformula
\MyRootX[3]{4n} \ne \MyRootX[3] {n}
\stopformula

\startformula
\sqrt[3]{\strut 4n} \ne \sqrt[3] {\strut n}
\stopformula

\stoptext

we can have strut but also think of enforcing ht / dp

(or we can have minima but that i'd rather add some options to the 
engine - we already have some but i never came to apply them yet)


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
___


Re: [NTG-context] Size of root symbol

2021-08-18 Thread Aditya Mahajan via ntg-context
On Wed, 18 Aug 2021, Bruce Horrocks via ntg-context wrote:

> Is there a simple way to get both root signs in this MWE to be the same size?
> 
> \starttext
> \startformula
> \sqrt[3]{4n} \ne \sqrt[3] {n}
> \stopformula
> \stoptext

Make the quantities whose roots are being taken to be of the same size.

\starttext

% The simplest solution:
\startformula
\sqrt[3]{4n} \ne \sqrt[3] {\vphantom{4} n}
\stopformula

% More general
% \strut = \vphantom{(}, which is too big
\startformula
\sqrt[3]{\strut 4n} \ne \sqrt[3] {\strut n}
\stopformula

% We can define our own phantom sizes. You can play around with the numbers.
\define\filler{\vrule width 0pt height 2ex depth 0.3ex \relax}
\startformula
\sqrt[3]{\filler 4n} \ne \sqrt[3] {\filler n}
\stopformula

\stoptext

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
___


Re: [NTG-context] Different footers for frontmatter and bodymatter

2021-08-18 Thread Rik Kabel via ntg-context


On 8/18/2021 05:32, noib3 via ntg-context wrote:
I'd like to have two different footer setups: one for the frontmatter 
(titlepage and table of contents) where the page number in roman 
numerals is reported as a single centered footer. Another for the 
bodymatter where the chapter is on the left footer and the pagenumber 
is on the right.


I can switch between roman numerals and numbers with

```
\defineconversionset
  [frontpart:pagenumber]
  []
  [romannumerals]

\defineconversionset
  [bodypart:pagenumber]
  []
  [numbers]
```

but I can't figure out how to have two different footer setups. Right 
now I have


```
\setupfootertexts
  [chapter]
  [pagenumber]
```


There are a few ways to do this.

 * You can explicitly change the footer settings in the body of the
   document (after \starttext) at any time. If placed within a group,
   the command is local to that group and reverts after the group is
   closed. If not, it applies to the remainder of the document unless
   otherwise overridden. This can be useful for a special page.
 * You can set it in the preamble within
   \startsectionblockenvironment[partname]..\stopsectionblockenvironment
   (where you can also define the number conversion. This is probably
   the easiest way to do it for documents differently-styled blocks.
 * You can forgo the \setupfootertexts commands completely and place
   the desired text in a separate layer. This may allow more precise
   control of the placement and formatting.

No doubt there are other mechanisms as well.

--
Rik
___
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] Size of root symbol

2021-08-18 Thread Bruce Horrocks via ntg-context
Is there a simple way to get both root signs in this MWE to be the same size?

\starttext
\startformula
\sqrt[3]{4n} \ne \sqrt[3] {n}
\stopformula
\stoptext

Thanks.
—
Bruce Horrocks
Hampshire, UK

___
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] paper dimensions for TEXpage

2021-08-18 Thread Hans Hagen via ntg-context

On 8/17/2021 4:01 PM, Pablo Rodriguez via ntg-context wrote:

On 8/17/21 9:30 AM, Hans Hagen via ntg-context wrote:

On 8/17/2021 5:56 AM, Pablo Rodriguez via ntg-context wrote:

[...]
I don’t get the layer in the TEXpage.

How could I get it with the TEXpage dimensions?

only by first boxing (using framed or so) and then taking those dimensions


Many thanks for your reply, Hans.

I’m afraid I don’t know how to make the commands work:

   \setupexternalfigures[location=default]
   \definelayer[hi]
[x=.5\dimexpr\framedwidth\relax, y=.5\dimexpr\framedheight\relax]
   \setupbackgrounds[page][background={foreground, hi}]
   \starttext
   \startTEXpage
   \framed[frame=off, offset=none]
   {\setlayer[hi]{\color[red]{hi}}
   \externalfigure[cow-brown]\framedheight}
   \stopTEXpage
   \stoptext

In this case, \getfiguredimensions would work, but I don’t know how to
deal with a pure text box.

BTW, is there a way to have TEXpages numbered? "pagestate=start" seems
not to work here.

for the wiki ...

\starttext

  \definelayer[hi]

  \startTEXpage[background=hi]
\setbox\scratchbox\hbox\framed
  [frame=off,offset=none,align=middle]
  {\input{tufte}}%
\setuplayer
  [hi]
  [width=\wd\scratchbox,height=\htdp\scratchbox]
\setlayer
  [hi][preset=middle]
  {\color[green]{there}}
\box\scratchbox
  \stopTEXpage

  \defineoverlay[hi]

  \startTEXpage[background=hi]
\defineoverlay
  [hi]
  [{\framed

[frame=off,offset=overlay,width=\overlaywidth,height=\overlayheight]
  {\color[red]{there}}}]
\framed
  [frame=off,offset=none,align=middle,background=hi]
  {\input{tufte}}%
  \stopTEXpage

\stoptext


-
  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
___


Re: [NTG-context] Unicode normalization and Hebrew in ConTeXt

2021-08-18 Thread Hans Hagen via ntg-context

On 8/17/2021 9:46 PM, Joey McCollum wrote:
Thankfully, it looks like this was just a problem with my implementation 
of the OpenType feature and not with ConTeXt's handling of it! (I 
worried that it might be ConTeXt when I saw that XeLaTeX was handing the 
feature correctly.) Hans graciously helped me identify the problem, and 
everything looks good now!
Just for the record: one can best try to make a font as robust as 
possible and not rely on side effects (ambiguous cases). When Idris and 
I tested some shapers we found that there can be inconsistent results 
(fwiw, in a rather complex font context agreed more often with uniscribe 
than xetex, but in the end on ehas to make the font okay for all i guess).


When we started with opentype (luatex showed up in 2005) we took 
uniscribe as reference so that is our benchmark. And lack of specs made 
us figure out things stepwise. Now, if something works in one shaper and 
not in another it can of course be due to bugs but it can also be that 
the spec is simply fuzzy and choices have been made. There is then the 
danger that eventually bugs become features (I assume the amount of 
leverage matters here, and tex has zero) which then settles it (kind of) 
but that doesn't man that one should gamble on it.


The same is true for fontnames: don't rely too much on the heuristics 
hard coded in programs (e.g. fontforge has some for font names, 
properties, glyph names, and although that is nice for recovery, it also 
makes other usage hard because fighting fuzzy heuristics is hard once 
information is lost).


Btw, a side effect of your 'issue' is that I found a way to save some 
memory for some fonts (for now only in lmtx) at the cost of hopefully 
little extra runtime.


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
___


[NTG-context] Different footers for frontmatter and bodymatter

2021-08-18 Thread noib3 via ntg-context
I'd like to have two different footer setups: one for the frontmatter
(titlepage and table of contents) where the page number in roman numerals
is reported as a single centered footer. Another for the bodymatter where
the chapter is on the left footer and the pagenumber is on the right.

I can switch between roman numerals and numbers with

```
\defineconversionset
  [frontpart:pagenumber]
  []
  [romannumerals]

\defineconversionset
  [bodypart:pagenumber]
  []
  [numbers]
```

but I can't figure out how to have two different footer setups. Right now I
have

```
\setupfootertexts
  [chapter]
  [pagenumber]
```
___
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
___