Re: [NTG-context] new upload

2021-06-01 Thread Hans Hagen

On 5/31/2021 9:04 PM, Aditya Mahajan wrote:

On Mon, 31 May 2021, Hans Hagen wrote:


On 5/31/2021 6:50 PM, Aditya Mahajan wrote:

On Mon, 31 May 2021, Hans Hagen wrote:


Hi,

I uploaded a new lmtx version. This time a new mechanism.


This is very interesting...I haven't played around with it, but is it the
case that \markanchor does not do alignment and so can completely replace
the old \hpos{...} class of macros?

This also gives many interesting possibilities for math  drawing "boxes"
in matrices (e.g.,
https://tex.stackexchange.com/questions/333011/draw-a-box-around-matrix-elements)
or even the nath style `\wall` macro (see pg 11 of
https://texdoc.org/serve/nathguide.pdf/0) ... Of course, I mean this in
terms of the visual effect and not the interface.

Like this ... I'll think about taking some size into account (a bit like hpos
does).


Yes! If we can take size of cell into account, it will be perfect.

We can also think of a wrapper so that an explicit \framed is not needed.

new upload with nesxt step

\starttext

\startuseMPgraphic{whatever-5}
fill OverlayBox withcolor "lightgray" ;
draw matrixbox (1, 1) (2, 1) withpen pencircle scaled 1pt withcolor 
"blue" ;
draw matrixbox (2, 2) (4, 4) withpen pencircle scaled 1pt withcolor 
"red" ;
% drawdot anchorxy("matrix", 3, 4) withpen pencircle scaled 4pt 
withcolor "green";

setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

\defineoverlay[whatever-5][\useMPgraphic{whatever-5}]

\framed
  [synchronize=background,
   align=normal,
   frame=off,
   background=whatever-5]
  {\setmathmatrixanchoring[both]% left|right|both|yes
%   {\setmathmatrixanchoring[right]% left|right|both|yes
   \startmathmatrix
  \NC a1 \NC a   \NC b   \NC c\NR
  \NC a2 \NC a   \NC b   \NC c\NR
  \NC a3 \NC a^2 \NC b   \NC c\NR
  \NC a4 \NC a   \NC b_2 \NC c\NR
  \NC a5 \NC a   \NC b   \NC c\NR
  \NC a6 \NC a   \NC b   \NC c\NR
  \stopmathmatrix}

\blank

\startuseMPgraphic{whatever-5}
fill OverlayBox withcolor "darkgray" ;
draw matrixbox (1, 1) (2, 1) enlarged OverlayOffset shifted 
paired(OverlayOffset) withpen pencircle scaled 1pt withcolor "blue" ;
draw matrixbox (2, 2) (4, 4) enlarged OverlayOffset shifted 
paired(OverlayOffset) withpen pencircle scaled 1pt withcolor "red" ;

setbounds currentpicture to OverlayBox ;
\stopuseMPgraphic

\framed
  [synchronize=background,
   align=normal,
   frame=off,
   background=whatever-5,
   backgroundoffset=.5ex,
   foregroundcolor=white]
  {\setmathmatrixanchoring[yes]% left|right|both|yes
   \startmathmatrix
  \NC a1 \NC a   \NC b   \NC c\NR
  \NC a2 \NC a   \NC b   \NC c\NR
  \NC a3 \NC a^2 \NC b   \NC c\NR
  \NC a4 \NC a   \NC b_2 \NC c\NR
  \NC a5 \NC a   \NC b   \NC c\NR
  \NC a6 \NC a   \NC b   \NC c\NR
  \stopmathmatrix}

\stoptext

as a side track / distraction I added italic correction prevention, as 
shown in:


\starttext

\startTEXpage[offset=10pt] \showglyphs
\startcombination[nx=3,ny=1]
\startcontent \framed[strut=no,align=normal,offset=1ex]\bgroup 
\showmakeup[math,kern]%

$a = b + c$\par
$b = c + d$\par
$c = e + f$\par
\egroup \stopcontent
\startcaption
italic correction
\stopcaption
\startcontent \framed[strut=no,align=normal,offset=1ex]\bgroup 
\showmakeup[math,kern]%

\noitaliccorrection
$a = b + c$\par
$b = c + d$\par
$c = e + f$\par
\egroup \stopcontent
\startcaption
no italic correction
\stopcaption
\startcontent \framed[strut=no,align=normal,offset=1ex]\bgroup 
\showmakeup[math,kern]%

$a = b + c$\par
$\noitaliccorrection b = c + d$\par
$c = e + f$\par
\egroup \stopcontent
\startcaption
selected correction
\stopcaption
\stopcombination
\stopTEXpage

\stoptext

but of course different width are still a reason why this doesn't align

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] Understanding penalties for orphans and widows

2021-06-01 Thread denis.maier
Hi,

I've read in the wiki 
(https://wiki.contextgarden.net/Widows_and_orphans_control) that this setting 
can be used to keep at least two lines together:

\startsetups[grid][mypenalties]
\setdefaultpenalties
\setpenalties\widowpenalties{2}{1}
\setpenalties\clubpenalties {2}{1}
\stopsetups

After experimenting with the first argument (see below) it looks to me as if 
the wording on the wiki should be changed a bit, from  to  
(penalties1 gives me one full line and a second line that is almost full ; 
penalties2 results in two full lines with a third line that is almost full.).

Is my interpretation correct?

Denis

\setuppapersize[A6]
\setuplayout[lines=20]
\setupalign[line]

\showframe

\startsetups[penalties1]
\setdefaultpenalties
\setpenalties\widowpenalties{1}{1}
\stopsetups

\startsetups[penalties2]
\setdefaultpenalties
\setpenalties\widowpenalties{2}{1}
\stopsetups

\starttext

\setuplayout[setups=penalties1]

\samplefile{tufte}\par
Here we are writing some more words to see the effect.
Here we are writing some more words to see the effect.
Here we are writing some more words to see the effect.

\page
\setuplayout[setups=penalties2]

\samplefile{tufte}\par
Here we are writing some more words to see the effect.
Here we are writing some more words to see the effect.
Here we are writing some more words to see the effect.

\stoptext
___
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] itemize margins,

2021-06-01 Thread denis.maier
Von: ntg-context  Im Auftrag von Wolfgang Schuster
Gesendet: Dienstag, 1. Juni 2021 11:05
An: mailing list for ConTeXt users 
Betreff: Re: [NTG-context] itemize margins,

denis.ma...@ub.unibe.ch schrieb am 01.06.2021 
um 10:46:

Hi,

in the following example the second line of the quote is not lined up with the 
first line.

=
\starttext

\startitemize[n]
[
%right=),
%stopper=,
%width=2em,
%alternative=fit,
%alternative=left,
%alternative=intext,
%distance=1em,
%leftmargin=1em,
%itemalign=flushleft,
]

\startitem
\setupindenting[no]
\input knuth
\stopitem
\stoptext
==

I've played with different options, but I couldn't get the indents and margins 
right. What am I missing ? Any hints ?

You are adding a extra space in the first line at the end of the 
\setupindenting line.
Ah, of course. Thanks!


To get rid of the space add % after the setup (i.e. \setupindenting[no]%) or 
even better use the indenting key with \startitemize or \setupitemize (i.e. 
\startitemize[indneting=no]).


\startitemize[indenting=no] works perfectly.

Denis

___
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] itemize margins,

2021-06-01 Thread Wolfgang Schuster

denis.ma...@ub.unibe.ch schrieb am 01.06.2021 um 10:46:


Hi,

in the following example the second line of the quote is not lined up 
with the first line.


=

\starttext

\startitemize[n]

[

%right=),

%stopper=,

%width=2em,

%alternative=fit,

%alternative=left,

%alternative=intext,

%distance=1em,

%leftmargin=1em,

%itemalign=flushleft,

]

\startitem

\setupindenting[no]

\input knuth

\stopitem

\stoptext

==

I’ve played with different options, but I couldn’t get the indents and 
margins right. What am I missing ? Any hints ?




You are adding a extra space in the first line at the end of the 
\setupindenting line.


To get rid of the space add % after the setup (i.e. 
\setupindenting[no]%) or even better use the indenting key with 
\startitemize or \setupitemize (i.e. \startitemize[indneting=no]).


Wolfgang

___
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] itemize margins,

2021-06-01 Thread denis.maier
Hi,

in the following example the second line of the quote is not lined up with the 
first line.

=
\starttext

\startitemize[n]
[
%right=),
%stopper=,
%width=2em,
%alternative=fit,
%alternative=left,
%alternative=intext,
%distance=1em,
%leftmargin=1em,
%itemalign=flushleft,
]

\startitem
\setupindenting[no]
\input knuth
\stopitem
\stoptext
==

I've played with different options, but I couldn't get the indents and margins 
right. What am I missing ? Any hints ?

Thanks for you help,
Denis
___
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
___