Re: [NTG-context] \setupheadertexts not working when text contains \subject

2022-01-13 Thread Hans Hagen via ntg-context

On 1/14/2022 12:05 AM, Bruce Horrocks via ntg-context wrote:

I've found an unexpected interaction between \setupheadertexts and the \subject 
command, and I'm hoping that someone can tell me what I'm doing wrong.

Version:  current version: 2022.01.10 08:36

I'm trying to set a book whereby
- chapter title pages have no headers
- left hand (even) pages have the chapter title in the left header and the book 
title in the right header
- right hand (odd) pages have the book title in the left header and the 
author's name in the right header

The following MWE does this perfectly provided the \subject line is 
commented-out. When the \subject line is included then the author name 
disappears - there's just a blank space in the header.

MWE:
\setuppagenumbering
   [ alternative=doublesided,
 location={footer},
   ]
\definefont [stylePageHeader] [Serif at 10pt]
   
\startsetups ChapterSetup

   \setupheadertexts
 [{\stylePageHeader {My Book}}]  
[{\stylePageHeader{\structureuservariable{author}}}]
 [{\stylePageHeader{\getmarking[Chapter]}}]  [{\stylePageHeader {My 
Book}}] 
   \setupheader[state=empty]
\stopsetups


Ponder this:

  [{\stylePageHeader{\structureuservariable{author}}}]

versus this:

  [{\stylePageHeader{\namedstructureuservariable{chapter}{author}}}]

and you can guess what happens.


\definehead [Chapter] [chapter]
\setuphead[Chapter]
   [ page=right,
 number=no,
 before={\setups{ChapterSetup}},
   ]
   
\starttext

\startChapter[title={The Strange Case of the Missing Header}] [author={Bruce}]

\dorecurse{10}{
%\subject{A heading}
\input Knuth
\par
}

\stopChapter
\stoptext


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



--

-
  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] \setupheadertexts not working when text contains \subject

2022-01-13 Thread Bruce Horrocks via ntg-context
I've found an unexpected interaction between \setupheadertexts and the \subject 
command, and I'm hoping that someone can tell me what I'm doing wrong.

Version:  current version: 2022.01.10 08:36

I'm trying to set a book whereby
- chapter title pages have no headers
- left hand (even) pages have the chapter title in the left header and the book 
title in the right header
- right hand (odd) pages have the book title in the left header and the 
author's name in the right header

The following MWE does this perfectly provided the \subject line is 
commented-out. When the \subject line is included then the author name 
disappears - there's just a blank space in the header.

MWE:
\setuppagenumbering
  [ alternative=doublesided,
location={footer},
  ]
\definefont [stylePageHeader] [Serif at 10pt]
  
\startsetups ChapterSetup
  \setupheadertexts
[{\stylePageHeader {My Book}}]  
[{\stylePageHeader{\structureuservariable{author}}}]
[{\stylePageHeader{\getmarking[Chapter]}}]  [{\stylePageHeader {My 
Book}}]  
  \setupheader[state=empty]
\stopsetups

\definehead [Chapter] [chapter]
\setuphead[Chapter]
  [ page=right,
number=no,
before={\setups{ChapterSetup}},
  ]
  
\starttext
\startChapter[title={The Strange Case of the Missing Header}] [author={Bruce}]

\dorecurse{10}{
%\subject{A heading}
\input Knuth
\par
}

\stopChapter
\stoptext


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


[NTG-context] MetaFun: textext.origin, thelabel.origin not positioned on baseline

2022-01-13 Thread Gavin via ntg-context
Hello again List,

Now I’m making diagrams using MetaFun. The MetaFun manual describes an “origin” 
option for positioning textext’s and label’s on the baseline. However, this 
dose not appear to be happening with the code in the manual (below). In fact, 
the diagram in the manual dose not show the textext’s and label’s on the 
baseline. This is on page 144 of metafun-p.pdf.

Maybe I misunderstand what is supposed to be happening here.

Thanks!
Gavin


\startMPcode
  picture p ; p :=  \MPbetex {1}  ;
  picture q ; q :=  textext.origin( \MPstring{2}) ;
  picture r ; r := thelabel.origin("\MPtext  {3}",origin) ;
  for i=p, boundingbox p : draw i withcolor .625red; endfor ;
  for i=q, boundingbox q : draw i withcolor .625yellow ; endfor ;
  for i=r, boundingbox r : draw i withcolor .625white  ; endfor ;
  currentpicture := currentpicture scaled 2 ;
  draw origin
withpen pencircle scaled 5.0mm withcolor white ;
  draw origin
withpen pencircle scaled 2.5mm withcolor black ;
  draw boundingbox currentpicture
withpen pencircle scaled .1mm
dashed evenly ;
\stopMPcode

___
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] Spacing issue in itemize

2022-01-13 Thread Gavin via ntg-context
Thank you again, Aditya!

I changed my documents so I use three levels of question, which solved the 
problem.

My code might be more readable if the different levels had different names 
(question, part, subpart), rather than nested questions in questions. This was 
my original intention. I was certainly surprised by the result.

Now I’m moving on to the problem set's diagrams with MetaFun.

Gavin


> On Jan 13, 2022, at 10:15 AM, Aditya Mahajan via ntg-context 
>  wrote:
> 
> On Thu, 13 Jan 2022, Gavin via ntg-context wrote:
> 
>> Hi list,
>> 
>> When I define an items group, it seems to mess up the spacing for a nested 
>> item group. See example below. Any ideas?
>> 
>> I’m typesetting with
>> 
>>  > ConTeXt  ver: 2022.01.06 19:51 LMTX  fmt: 2022.1.9  int: 
>> english/english
>> 
>> on an M1 Mac.
>> 
>> Thanks!
>> Gavin
>> 
>> 
>> \usemodule[visual]
>> 
>> \defineitemgroup[questions]
>> \setupquestions [each] [n]
>> 
>> \starttext
>> This numbered list uses my item group \quotation{questions.} The itemize 
>> inside is missing space above item (a).
>> \startquestions
>>  \item \fakewords{15}{20}
>>\startitemize[a][left=(,stopper=,right=)]
>>  \item \fakewords{10}{15}
>>  \item \fakewords{10}{15}
>>\stopitemize
>>  \item \fakewords{10}{15}
>> \stopquestions
>> 
>> This numbered list uses itemize. The itemize inside has the expected space 
>> above item (a).
>> \startitemize[n]
>>  \item \fakewords{15}{20}
>>\startitemize[a][left=(,stopper=,right=)]
>>  \item \fakewords{10}{15}
>>  \item \fakewords{10}{15}
>>\stopitemize
>>  \item \fakewords{10}{15}
>> \stopitemize
>> 
>> \stoptext
> 
> This is by design. This is what is happening:
> 
> \usemodule[visual]
> 
> \defineitemgroup[questions]
> 
> \starttext
> This numbered list uses my item group \quotation{questions.} The itemize 
> inside is missing space above item (a).
> \startquestions[n][inbetween={AAA}]
>  \item \fakewords{15}{20}
>\startitemize[a][left=(,stopper=,right=),before={BBB}]
>  \item \fakewords{10}{15}
>  \item \fakewords{10}{15}
>\stopitemize
>  \item \fakewords{10}{15}
> \stopquestions
> 
> This numbered list uses itemize. The itemize inside has the expected space 
> above item (a).
> \startitemize[n][inbetween={AAA}]
>  \item \fakewords{15}{20}
>\startitemize[a][left=(,stopper=,right=),before={BBB}]
>  \item \fakewords{10}{15}
>  \item \fakewords{10}{15}
>\stopitemize
>  \item \fakewords{10}{15}
> \stopitemize
> 
> \stoptext
> 
> Note that in the first case, the inbetween does not get inserted at the start 
> of the nested itemization (because, ConTeXt doesn't think that they are 
> nested as the names are different). But the before key of the nested 
> itemization doesn't get inserted in both cases because ConTeXt thinks that 
> the itemization is nested!
> 
> You can change this behavior by using:
> 
> \unprotect
> \c_strc_itemgroups_spacing_mode\plusone
> \protect
> 
> in which case both outputs are similar. 
> 
> @Hans: Does it make sense to add a setups key to \setupitemize to keep such 
> changes local?
> 
> 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] Placement of floats

2022-01-13 Thread Willi Egger via ntg-context
Hi all, 

here follows the compilation of the example-file, this time I replaced the 
dummy-figure with a simple \framedtext in order to comply with the 100kB rule 
of the mailing-list.

I added a black line at the bottom with “Preview” on Mac OSX

test-placefigures.pdf
Description: Adobe PDF document
, so the problem is visible immediately.

Kind regards

Willi___
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] Placement of figures

2022-01-13 Thread Willi Egger via ntg-context
Hi all,

I have a project with my brother in which 5 foto’s are placed with the XY 
arrangement in a row. Now we see, that the floats are not placed all on the 
correct position. I tried all kind of things, but I am not able to fix them in 
the desired position. — When using the key location=top, all figures are placed 
correctly. This does not work with location=center.

I attach the sources in this mai and will send the compiled file in a next mail.

stops.dat
Description: Binary data


test-placefigures.tex
Description: Binary data


May be somebody can give me a hint how to solve this.

Willi___
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] Spacing issue in itemize

2022-01-13 Thread Aditya Mahajan via ntg-context
On Thu, 13 Jan 2022, Gavin via ntg-context wrote:

> Hi list,
> 
> When I define an items group, it seems to mess up the spacing for a nested 
> item group. See example below. Any ideas?
> 
> I’m typesetting with
> 
>   > ConTeXt  ver: 2022.01.06 19:51 LMTX  fmt: 2022.1.9  int: 
> english/english
> 
> on an M1 Mac.
> 
> Thanks!
> Gavin
> 
> 
> \usemodule[visual]
> 
> \defineitemgroup[questions]
> \setupquestions [each] [n]
> 
> \starttext
> This numbered list uses my item group \quotation{questions.} The itemize 
> inside is missing space above item (a).
> \startquestions
>   \item \fakewords{15}{20}
> \startitemize[a][left=(,stopper=,right=)]
>   \item \fakewords{10}{15}
>   \item \fakewords{10}{15}
> \stopitemize
>   \item \fakewords{10}{15}
> \stopquestions
> 
> This numbered list uses itemize. The itemize inside has the expected space 
> above item (a).
> \startitemize[n]
>   \item \fakewords{15}{20}
> \startitemize[a][left=(,stopper=,right=)]
>   \item \fakewords{10}{15}
>   \item \fakewords{10}{15}
> \stopitemize
>   \item \fakewords{10}{15}
> \stopitemize
> 
> \stoptext

This is by design. This is what is happening:

\usemodule[visual]

\defineitemgroup[questions]

\starttext
This numbered list uses my item group \quotation{questions.} The itemize inside 
is missing space above item (a).
\startquestions[n][inbetween={AAA}]
  \item \fakewords{15}{20}
\startitemize[a][left=(,stopper=,right=),before={BBB}]
  \item \fakewords{10}{15}
  \item \fakewords{10}{15}
\stopitemize
  \item \fakewords{10}{15}
\stopquestions

This numbered list uses itemize. The itemize inside has the expected space 
above item (a).
\startitemize[n][inbetween={AAA}]
  \item \fakewords{15}{20}
\startitemize[a][left=(,stopper=,right=),before={BBB}]
  \item \fakewords{10}{15}
  \item \fakewords{10}{15}
\stopitemize
  \item \fakewords{10}{15}
\stopitemize

\stoptext

Note that in the first case, the inbetween does not get inserted at the start 
of the nested itemization (because, ConTeXt doesn't think that they are nested 
as the names are different). But the before key of the nested itemization 
doesn't get inserted in both cases because ConTeXt thinks that the itemization 
is nested!

You can change this behavior by using:

\unprotect
\c_strc_itemgroups_spacing_mode\plusone
\protect

in which case both outputs are similar. 

@Hans: Does it make sense to add a setups key to \setupitemize to keep such 
changes local?

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
___


[NTG-context] Spacing issue in itemize

2022-01-13 Thread Gavin via ntg-context
Hi list,

When I define an items group, it seems to mess up the spacing for a nested item 
group. See example below. Any ideas?

I’m typesetting with

> ConTeXt  ver: 2022.01.06 19:51 LMTX  fmt: 2022.1.9  int: 
english/english

on an M1 Mac.

Thanks!
Gavin


\usemodule[visual]

\defineitemgroup[questions]
\setupquestions [each] [n]

\starttext
This numbered list uses my item group \quotation{questions.} The itemize inside 
is missing space above item (a).
\startquestions
  \item \fakewords{15}{20}
\startitemize[a][left=(,stopper=,right=)]
  \item \fakewords{10}{15}
  \item \fakewords{10}{15}
\stopitemize
  \item \fakewords{10}{15}
\stopquestions

This numbered list uses itemize. The itemize inside has the expected space 
above item (a).
\startitemize[n]
  \item \fakewords{15}{20}
\startitemize[a][left=(,stopper=,right=)]
  \item \fakewords{10}{15}
  \item \fakewords{10}{15}
\stopitemize
  \item \fakewords{10}{15}
\stopitemize

\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] \sub conflict with my def

2022-01-13 Thread Gavin via ntg-context
Thanks, Hans! Appending to \everymathematics is a powerful trick, which I will 
not overuse.

-Gavin

> On Jan 12, 2022, at 12:14 PM, Hans Hagen  wrote:
> 
> On 1/12/2022 7:34 PM, Gavin via ntg-context wrote:
>> Hi List,
>> I am converting problem sets from LaTeX to ConTeXt and ran into a puzzling 
>> problem. I define \sub to produce subscript text in math mode. (See 
>> definition below.) This worked for my ConTeXt book, but fails in the problem 
>> sets because in ConTeXt \sub is a special item command, and I use itemize to 
>> number problems.
>> Obviously, I can rename my \sub command, but it is already used in hundreds 
>> of problems and solutions that I am converting. Is there a way to get my 
>> \sub to work in an itemize? I only need it in math mode. I will never use 
>> \sub for its ConTeXt itemizing purpose.
> 
> \appendtoks
>\define[1]\sub{_{\text{\rm\tf#1}}}%
> \to \everymathematics
> 
> or nicer:
> 
> \define[1]\MyMathSub{_{\text{\rm\tf#1}}}
> 
> \appendtoks
>\let\sub\MyMathSub
> \to \everymathematics
> 
> 
>> Thanks!
>> Gavin
>> \define[1]\sub{_{\text{\rm\tf#1}}}
>> \starttext
>> $E\sub{final}$ is the final energy, but not in an itemize:
>> \startitemize
>> \item $E_{\text{\rm final}}$ is the final energy.
>> \item $E\sub{final}$ is a mess.
>> \stopitemize
>> \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
>> ___
> 
> 
> -- 
> 
> -
>  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] Wiki: new commands not automatically available for autogenerated syntax (was LTR footnotes from RTL paragraph)

2022-01-13 Thread Hans Hagen via ntg-context

On 1/13/2022 6:22 AM, denis.ma...@unibe.ch wrote:

Hi, I wanted to wikify a new command, but I don't fully understand what to do...


-Ursprüngliche Nachricht-
Von: Hans Hagen 
Gesendet: Donnerstag, 13. Januar 2022 00:25
An: Maier, Denis Christian (UB) ; ntg-
cont...@ntg.nl
Cc: oi...@gmx.es
Betreff: Re: AW: [NTG-context] LTR footnotes from RTL paragraph


[...]


i'll add this (only a few line addition with no performance hit):

 \definealign[MyAlign][r2l,flushleft]

so that you can do

 \setupalign[MyAlign]

and you can also use it as value to the align parameter as well ...
the usual 'context abstraction'

so again something to wikify ...


Wanted to wikify, but is this already implemented?

sure


Ok, so then: Why will creating a page \definealign not create a page with 
autogenerated syntax? And, the new option for \setupalign does not show up in 
the autogenerated syntax overview at 
https://wiki.contextgarden.net/Command/setupalign

I probably don't fully understand how the wiki works in these regards .. can 
anyone clarify?
when there is a new key or option, wolfgang at some point will add it to 
the setups so then it will show up (goes in batches); that is 
indepdendent from examples; so when a new key/value is missing, just 
signal wolfgang


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
___