[NTG-context] how to prevent item appearing in List of Figures

2024-05-29 Thread Charles Doherty via ntg-context
Hi Mikael,

> I notice that you addressed Wolfgang, but you also sent to the list.
> One way could be to condition on being on a chapter page:
> 
> \setupheadertexts
>  [\doifelsefirstsectionpage{chapter}{\userpagenumber}{}]
> 
> \setupheadertexts
>  [\doifelsefirstsectionpage{chapter}{}{\getmarking[chapter]}]
>  [\doifelsefirstsectionpage{chapter}{}{\userpagenumber}]

Thank you for your suggestion. Along with your suggestion and that of  Wolfgang 
I get what I need. I thought I was sending to the list but I copied and pasted 
from an email and didn’t realise that Wolfgang was included. I have only ever 
written to the list many years ago.

I haven’t typeset a book before and various things are a challenge. The most 
recent is the following.

I have \placelistoffigures some of which are logos (for the publisher and two 
granting bodies) that I have placed with:

   \setupcaptions[number=no]
\starttplacefigure[
 location={middle,high,low},
 reference=fig:logo,
 title=]
{\externalfigure[FCLogo][width=0.045\textwidth]}
\stopplacefigure 

These are not part of the text and I don’t want them to appear in the list.

The caption for the logo doesn’t appear in the List of Figures but the page 
number does. How can I prevent these particular graphics from being listed in 
the List of figures.

Thanks,
Charlie





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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: lua error in `strc-lev.lua`

2024-05-29 Thread Sylvain Hubert
I rerun `install.sh` after replacing `strc-lev.lua` and the error goes
away. Thanks Hans!

On Tue, 28 May 2024 at 20:20, Hans Hagen  wrote:

> On 5/28/2024 10:48 AM, Sylvain Hubert wrote:
> > ConTeXt LMTX version: 2024.05.27 18:16
> >
> > Reproducible example:
> >
> > \definesectionlevels
> > [default]
> > [section, subsection, subsubsection, subsubsubsection,
> subsubsubsubsection]
> >
> > \starttext
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stoptext
> >
> > lua error   > lua error on line 19 in file ./input.tex:
> >
> > registered function call [969]:
> > ...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75: attempt
> > to index a nil value (field '?')
> > stack traceback:
> >  ...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75:
> > in function
> <...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:66>
> >  (...tail calls...)
> can you test with the attached ... (remake the format)
>
> \starttext
> \startsectionlevel[title=level 1]
>  \startsectionlevel[title=level 2 ]
>  \startsectionlevel[title=level 3]
>  \startsectionlevel[title=level 4]
>  \startsectionlevel[title=level 5]
>  \startsectionlevel[title=level 6]
>  \startsectionlevel[title=level 7]
>  \startsectionlevel[title=level 8]
>  \startsectionlevel[title=level 9]
>  \startsectionlevel[title=level 10 ]
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: lua error in `strc-lev.lua`

2024-05-29 Thread Sylvain Hubert
I replaced `strc-lev.lua` and rerun `context` but the error message stays
the same. `context` command doesn't seem to recognize the change of
`strc-lev.lua`. Should I run `mtxrun` or something before?

On Tue, 28 May 2024 at 20:20, Hans Hagen  wrote:

> On 5/28/2024 10:48 AM, Sylvain Hubert wrote:
> > ConTeXt LMTX version: 2024.05.27 18:16
> >
> > Reproducible example:
> >
> > \definesectionlevels
> > [default]
> > [section, subsection, subsubsection, subsubsubsection,
> subsubsubsubsection]
> >
> > \starttext
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stoptext
> >
> > lua error   > lua error on line 19 in file ./input.tex:
> >
> > registered function call [969]:
> > ...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75: attempt
> > to index a nil value (field '?')
> > stack traceback:
> >  ...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75:
> > in function
> <...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:66>
> >  (...tail calls...)
> can you test with the attached ... (remake the format)
>
> \starttext
> \startsectionlevel[title=level 1]
>  \startsectionlevel[title=level 2 ]
>  \startsectionlevel[title=level 3]
>  \startsectionlevel[title=level 4]
>  \startsectionlevel[title=level 5]
>  \startsectionlevel[title=level 6]
>  \startsectionlevel[title=level 7]
>  \startsectionlevel[title=level 8]
>  \startsectionlevel[title=level 9]
>  \startsectionlevel[title=level 10 ]
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: BibTeX choking on comments in database

2024-05-28 Thread Aditya Mahajan
On Tue, 28 May 2024, Kip Warner wrote:

> On Tue, 2024-05-28 at 08:05 +0200, Henning Hraban Ramm wrote:
> > According to the documentation, everything outside of entries is 
> > considered a comment. Inside of entries, there can’t be comments.
> 
> But in this case, is it not warning about text outside of an entry that
> should be treated as a comment?

Hard to say without looking at the bib file, but % is not a comment character 
in bibtex. So, if your file starts with

% @article{key,
% title = {...},
% }

you will get an error from the bib parser.

If you want to comment out an entry, the simplest way is to remove the @. So,

article{key,
  title={...},
}

is a comment (since it is outside the entry). 

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: page number

2024-05-26 Thread Wolfgang Schuster

Charles Doherty via ntg-context schrieb am 26.05.2024 um 11:27:

Dear Wolfgang,

I have a book in preparation with running heads.


Pagenumber  marking   |marking  Pagenumber

The chapter title page has empty headings.

The publisher would like the page number centered on the Chapter title page. I 
manage to put it there but I don’t want it to run on the following pages. I 
have made various attempts but can’t manage it.

I have

\setuplayout[location=doublesided]
\setuppagenumbering[location=,alternative=doublesided]

\setupheadertexts[chapter][][pagenumber]
\setupheadertexts[{\getmarking[chapter]}][pagenumber]


Please send a complete working example next time.


Can anyone show me code to achieve this?


1. You use \setupheadertexts to set the header for all pages.

2. You use \definetext to create a custom header for the chapter page 
and apply it with the header-key in \setuphead.


 begin example
\setuppagenumbering
  [location=,
   alternative=doublesided]

\setupheadertexts
  [chapter] [pagenumber]
  [pagenumber] [chapter]

\definetext
  [chapterheader]
  [header]
  [pagenumber]

\setuphead
  [chapter]
  [header=chapterheader]

\starttext
\dorecurse{10}
  {\startchapter[title=Chapter \convertnumber{Word}{#1}]
   \dorecurse{10}{\samplefile{lorem}}
   \stopchapter}

\stoptext
 end example

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: page number

2024-05-26 Thread Mikael Sundqvist
Hi Charles,

On Sun, May 26, 2024 at 11:39 AM Charles Doherty via ntg-context
 wrote:
>
> Dear Wolfgang,
>
> I have a book in preparation with running heads.
>
>
> Pagenumber  marking   |marking  Pagenumber
>
> The chapter title page has empty headings.
>
> The publisher would like the page number centered on the Chapter title page. 
> I manage to put it there but I don’t want it to run on the following pages. I 
> have made various attempts but can’t manage it.
>
> I have
>
> \setuplayout[location=doublesided]
> \setuppagenumbering[location=,alternative=doublesided]
>
> \setupheadertexts[chapter][][pagenumber]
> \setupheadertexts[{\getmarking[chapter]}][pagenumber]
>
> Can anyone show me code to achieve this?
>
> Thanks,
> Charlie

I notice that you addressed Wolfgang, but you also sent to the list.
One way could be to condition on being on a chapter page:

\setupheadertexts
  [\doifelsefirstsectionpage{chapter}{\userpagenumber}{}]

\setupheadertexts
  [\doifelsefirstsectionpage{chapter}{}{\getmarking[chapter]}]
  [\doifelsefirstsectionpage{chapter}{}{\userpagenumber}]

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] page number

2024-05-26 Thread Charles Doherty via ntg-context
Dear Wolfgang,

I have a book in preparation with running heads.


Pagenumber  marking   |marking  Pagenumber

The chapter title page has empty headings. 

The publisher would like the page number centered on the Chapter title page. I 
manage to put it there but I don’t want it to run on the following pages. I 
have made various attempts but can’t manage it.

I have

\setuplayout[location=doublesided]
\setuppagenumbering[location=,alternative=doublesided]

\setupheadertexts[chapter][][pagenumber]
\setupheadertexts[{\getmarking[chapter]}][pagenumber]

Can anyone show me code to achieve this?

Thanks,
Charlie 



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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How to Define a New Language

2024-05-24 Thread Wolfgang Schuster

ai2472206...@yeah.net schrieb am 24.05.2024 um 14:05:

Hello, everyone.

As the title describes, I want to define a new language: Chinese Traditional.
Based on what I could find on the Internet, I made these settings.
But I couldn't get the results I wanted.

%%%start example
\usetypescriptfile[osx]
\setupbodyfont   [stfangsong]
\unprotect
\installlanguage[cnt] [default=cn,patterns=cn,factor=yes]
\setuplanguage  [cnt] [spacing=packed,default=cn,patterns=cn,factor=yes]
\setuplabeltext [cnt] [appendix={附錄}]
\protect
\mainlanguage[cnt]
\currentmainlanguage
\labeltext{appendix}
%%% stopexample

I think I'm going to get the two kanji [附錄]. But the truth is, he has nothing.
But when I converted to Chinese Simplified, he magically appeared.

%%%start example
\usetypescriptfile[osx]
\setupbodyfont   [stfangsong]
\unprotect
\setuplabeltext [cn] [appendix={附錄}] %%% here switch to Chinese-Simplified
\protect
\currentmainlanguage
\labeltext{appendix}
%%% stopexample

So, what should I do to get it. Of course, my original assumption was that
when I changed the language, these labels, fonts, indentations, line spacing, 
etc.,
would change. But for now, I'm stuck at defining a new language.

  If anyone can give advice, appreciate it


1. It is better to add new languages to Context itself and not just in 
your document.


2. Chinese doesn't use hyphenation pattern but has rules where to break 
which is enabled with the \setscript command.


3. We should use agree upon a name which is used for traditional and 
simplified chinese (at the moment we have only chinese without 
distinction). Is it even enough to just separate between both or do we 
need separate setting china, singapore, taiwan, hong kong and macau?


Wolfgang

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How to Define a New Language

2024-05-24 Thread Jean-Pierre Delange

Hi Muyik !

The first thing to check, even if it seems stupid, is to make sure that 
the Traditional Chinese fonts are installed in the 
/context/context-mf/fonts/ etc. folder and test this installation with 
the following command:
mtxrun --script fonts --list --pattern="Chinese Font" --all (indicate 
actual font name)


Don't forget the following commands to purge the font cache and restore 
the database:


1. mtxrun --script cache --erase && mtxrun --generate

2. mtxrun --script fonts --reload
Then : 3. mtxrun --script fonts --list --pattern="Chinese Font" --all

Normally, the system should support the desired font after these checks. 
For my part, I have no problem with Traditional Chinese or Simplified 
Chinese fonts, but I haven't checked with OSX ...


I hope these few suggestions will help.

JP

Le 24/05/2024 à 14:05, ai2472206...@yeah.net a écrit :

Hello, everyone.

As the title describes, I want to define a new language: Chinese Traditional.
Based on what I could find on the Internet, I made these settings.
But I couldn't get the results I wanted.

%%%start example
\usetypescriptfile[osx]
\setupbodyfont   [stfangsong]
\unprotect
\installlanguage[cnt] [default=cn,patterns=cn,factor=yes]
\setuplanguage  [cnt] [spacing=packed,default=cn,patterns=cn,factor=yes]
\setuplabeltext [cnt] [appendix={附錄}]
\protect
\mainlanguage[cnt]
\currentmainlanguage
\labeltext{appendix}
%%% stopexample

I think I'm going to get the two kanji [附錄]. But the truth is, he has nothing.
But when I converted to Chinese Simplified, he magically appeared.

%%%start example
\usetypescriptfile[osx]
\setupbodyfont   [stfangsong]
\unprotect
\setuplabeltext [cn] [appendix={附錄}] %%% here switch to Chinese-Simplified
\protect
\currentmainlanguage
\labeltext{appendix}
%%% stopexample

So, what should I do to get it. Of course, my original assumption was that
when I changed the language, these labels, fonts, indentations, line spacing, 
etc.,
would change. But for now, I'm stuck at defining a new language.

  If anyone can give advice, appreciate it

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] How to Define a New Language

2024-05-24 Thread ai2472206007
Hello, everyone. 

As the title describes, I want to define a new language: Chinese Traditional. 
Based on what I could find on the Internet, I made these settings. 
But I couldn't get the results I wanted.

%%%start example 
\usetypescriptfile[osx]
\setupbodyfont   [stfangsong]
\unprotect
\installlanguage[cnt] [default=cn,patterns=cn,factor=yes]
\setuplanguage  [cnt] [spacing=packed,default=cn,patterns=cn,factor=yes]
\setuplabeltext [cnt] [appendix={附錄}]
\protect
\mainlanguage[cnt]
\currentmainlanguage
\labeltext{appendix}
%%% stopexample

I think I'm going to get the two kanji [附錄]. But the truth is, he has nothing. 
But when I converted to Chinese Simplified, he magically appeared. 

%%%start example 
\usetypescriptfile[osx]
\setupbodyfont   [stfangsong]
\unprotect
\setuplabeltext [cn] [appendix={附錄}] %%% here switch to Chinese-Simplified
\protect
\currentmainlanguage
\labeltext{appendix}
%%% stopexample

So, what should I do to get it. Of course, my original assumption was that 
when I changed the language, these labels, fonts, indentations, line spacing, 
etc., 
would change. But for now, I'm stuck at defining a new language.

 If anyone can give advice, appreciate it

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: build_parshape and \getshapetext - need for a deeper understanding

2024-05-19 Thread Hans Hagen via ntg-context

On 5/19/2024 2:29 PM, garu...@azules.eu wrote:

I still get some difficulties with build_parshape, \getshapetex and sectionning.

I though I find a solution by removing \blank with
   \setuphead  [subsection]  [before=,  after=, style=, 
command=\MySubSectionCommand, alternative=text ]

But actually it's not enough : when I add text before the first section, new 
issues appear.

I tried to build a MVE by refactoring and tidying as much as I could.
It build 3 comparative pages (i) basic issue, (ii) solution, (iii) remaining 
issue.

Your guidance are most welcome :-)


you have to fight several issues:

- parshapes being reset at the end paragraph (handled here by luametatex 
context)
- parshapes operate on lines, not dimension (i might add an aletnative 
one day)

- you use a bit old mechanism (checkout the luametafun-paragraphs chapter)

Now, is there a solution? It really depends on the circumstances, so 
here is one.


\setupbodyfont[11pt]

\definemeasure [mywidth]  [7cm]
\definemeasure [mywidtha] [5cm]
\definemeasure [myheight] 
[{\the\dimexpr\baselineskip*37+\lineskip\relax}]
\definemeasure [myheighta] 
[{\the\dimexpr\baselineskip*18+\lineskip*1\relax}]
\definemeasure [myheightb] 
[{\the\dimexpr\baselineskip*25-\lineskip*1\relax}]


\startuseMPgraphic{shape:1}
  path p ;
  numeric mywidth   ; mywidth   := \measure{mywidth};
  numeric mywidtha  ; mywidtha  := \measure{mywidtha};
  numeric myheight  ; myheight  := \measure{myheight};
  numeric myheighta ; myheighta := \measure{myheighta};
  numeric myheightb ; myheightb := \measure{myheightb};
  p := (0,0)-- (mywidth,0) --
   (mywidth,myheighta)  -- (mywidtha,myheighta) --
   (mywidtha,myheightb) -- (mywidth,myheightb) --
   (mywidth,myheight)   -- (0cm,myheight) -- cycle;

build_parshape(p,0,0,0,\baselinedistance,\strutheight,\strutdepth,\topskip) 
;

  path SavedShape ; SavedShape := p ;
\stopuseMPgraphic

\startuseMPgraphic{shape:2}
  SavedShape := SavedShape shifted (0,-ypart urcorner OverlayBox) ;
  SavedShape := SavedShape shifted (0,positiony("test")) ;
  fill SavedShape withcolor red;
 setbounds currentpicture to OverlayBox;
\stopuseMPgraphic

\showframe

\defineoverlay[myoverlay][\useMPgraphic{shape:2}]

\setupbackgrounds[text][text][background=myoverlay]

\startsection[title={test}]

\startshapedparagraph[mp=shape:1]%
\setupalign[verytolerant,stretch]%
\hpos{test}{!}\samplefile{tufte}
\samplefile{tufte}
\stopshapedparagraph

\stopsection

The "test" position is hard coded but should be namespaced, the ! can be 
a \strut instead.


So, more thinking from the end of the text flow.

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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] build_parshape and \getshapetext - need for a deeper understanding

2024-05-19 Thread garulfo
I still get some difficulties with build_parshape, \getshapetex and sectionning.

I though I find a solution by removing \blank with
  \setuphead  [subsection]  [before=,  after=, style=, 
command=\MySubSectionCommand, alternative=text ]

But actually it's not enough : when I add text before the first section, new 
issues appear.

I tried to build a MVE by refactoring and tidying as much as I could.
It build 3 comparative pages (i) basic issue, (ii) solution, (iii) remaining 
issue.

Your guidance are most welcome :-)


\setupbodyfont[11pt]

%--

\usecolors[svg]

\definemeasure [mywidth]  [7cm]
\definemeasure [mywidtha] [5cm]
\definemeasure [myheight] [{\the\dimexpr\baselineskip*37+\lineskip\relax}]
\definemeasure [myheighta][{\the\dimexpr\baselineskip*18+\lineskip*1\relax}]
\definemeasure [myheightb][{\the\dimexpr\baselineskip*25-\lineskip*1\relax}]

\startuseMPgraphic{mymetafunpath}
  path p ;
  numeric mywidth   ; mywidth   := \measure{mywidth};
  numeric mywidtha  ; mywidtha  := \measure{mywidtha};
  numeric myheight  ; myheight  := \measure{myheight};
  numeric myheighta ; myheighta := \measure{myheighta};
  numeric myheightb ; myheightb := \measure{myheightb};
  p := (0,0)-- (mywidth,0) --
   (mywidth,myheighta)  -- (mywidtha,myheighta) --
   (mywidtha,myheightb) -- (mywidth,myheightb) --
   (mywidth,myheight)   -- (0cm,myheight) -- cycle;
  build_parshape(p,0,0,0,\baselinedistance,\strutheight,\strutdepth,\topskip) ;
  fill p withcolor \MPcolor{tan};
\stopuseMPgraphic

\defineoverlay[myoverlay][\useMPgraphic{mymetafunpath}]

%--

\define[2]\MySubSectionCommand{\leftaligned{#2}}

%--

\define[2]\MyPageBuilder{%
\page
\setupbackgrounds[page][background=testA]
\definelayer[testA] [x=0mm, y=0mm,width=\paperwidth, height=\paperheight]
~

\startshapetext[mymetafunpath, mymetafunpath]   % <=== WITHOUT \startsubsection
#2
%\startsubsection[title={Title for section  #1}]
\MySubSectionCommand{1}{Title for section #1}
\input knuth \endgraf \input ward
%\stopsubsection
\stopshapetext

\setlayer
  [testA]
  [hoffset={\the\dimexpr\backspace\relax},
   voffset={\the\dimexpr\topspace+\headerheight+\headerdistance\relax},]
  {\framed[background=myoverlay,frame=off]{\strut\getshapetext}}

\startshapetext[mymetafunpath, mymetafunpath]   % <=  WITH \startsubsection
#2
\startsubsection[title={Title for section  #1}]
%\MySubSectionCommand{1}{Title for section #1}
\input knuth \endgraf \input ward
\stopsubsection
\stopshapetext

\setlayer
  [testA]
  [hoffset={\the\dimexpr\backspace+\measure{mywidth}+5mm\relax},
   voffset={\the\dimexpr\topspace+\headerheight+\headerdistance\relax},]
  {\framed[background=myoverlay,frame=off]{\strut\getshapetext}}
}

%==

%\showboxes

\starttext

\MyPageBuilder{A}{}

\setuphead
  [subsection]
  [
   before=,
   after=,
   style=,
   command=\MySubSectionCommand,
   alternative=text,
   ]

\MyPageBuilder{B}{}

\MyPageBuilder{C}{\strut Hi from here. \endgraf}

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Why is only the first frame protruding into the margin?

2024-05-17 Thread Pablo Rodriguez via ntg-context
On 5/17/24 11:02, madiazm.eo...@gmail.com wrote:
> thanks Wolfgang for your advice and sorry for being so verbose, but
> since the margins are "included" in the problem I decided to put my
> layout there too.
>
> I made your suggested changes and unfortunately it doesnt work, but
> being a bit surprised by the margins I printed a copy of the page
> and still worse...
Hi Miguel,

this should work (also in the sense of a minimal sample):

  \showframe\showgrid
  \defineframedtext[FunnyText]
[frame=on, align=flushright,location=right]

  \def\FrameTitle#1%
  {\setMPtext{FunnyFrame}
{\hbox spread 1em{\hss\strut \color[blue]{\tfx Apartado #1}\hss}}}

  \define[2]\firstHeadings{%
\dontleavehmode \switchtobodyfont[miCorm]%
\FrameTitle#1%

\startFunnyText
  {\switchtobodyfont[miCorm,20.7pt] #2}
\stopFunnyText}

  \setuphead [section] [command=\firstHeadings, indentnext=no]

  \starttext
  \startsection[title=a]
  b
  \stopsection
  \startsection[title=a]
  b
  \stopsection
  \startsection[title=a]
  b
  \stopsection
  \stoptext

BTW, you inadvertely introduce the space here:

  \define[2]\firstHeadings{%
\dontleavehmode \switchtobodyfont[miCorm]%
\FrameTitle#1%

Unless you comment the space after the right bracket, it will be
included in your definition of first headings.

As for external downloads, better avoid unless required.

In any case, the minimal code should be part of your message.

Just in case it helps,

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Why is only the first frame protruding into the margin?

2024-05-17 Thread Wolfgang Schuster

madiazm.eo...@gmail.com schrieb am 17.05.2024 um 00:05:

Hi,
I used some code from the meta-fun manual to recreate a labelled frame around 
my sections. But the first framedtext protrudes a couple of mm into the margin. 
Only the first one in the page. I intentionaly added other sections and the 
frames aline to the margin ok.
I tried to put something before the first frame (noindentation, dontleavehmode) 
because I sometimes read it solves problems, but not the case here.
so Why is the first frame protruding and only the first?


[...]



Include only setups in your examples which are necessary to show the 
problem, the custom layout isn't necessary and can be left out.




\startuseMPgraphic{FunnyFrame}
picture p ; numeric w, h, o ;
p := textext.rt(\MPstring{FunnyFrame}) ;
w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ;
p := p shifted (2o,h-ypart center p) ; draw p ;
drawoptions (withpen pencircle scaled .25pt withcolor blue) ;
draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ;
%draw boundingbox p ; %%%quitamos el frame pequeño
setbounds currentpicture to unitsquare xyscaled(w,h) ;
\stopuseMPgraphic

\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][width=.85\textwidth, height=20mm, frame=off,  
background=FunnyFrame, align=flushright,location=right, 
after={\blank[2*big]}]%foregroundsytel amplía la palabra Apartado

\def\FrameTitle#1%
{\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut \color[blue]{\tfx Apartado 
#1}\hss}}}

\setMPtext{FunnyFrame}{} % initialize the text variable



\define[2]\firstHeadings{%
\dontleavehmode \switchtobodyfont[miCorm]
\FrameTitle#1%

\dontleavehmode \startFunnyText  {\switchtobodyfont[miCorm,20.7pt] #2} 
\stopFunnyText
}

\setuphead [section] [color=blue, command=\firstHeadings, indentnext=no]



Get rid of \dontleavehmode in your custom section layout, avoid blank 
lines in definitions and move the font changes to \setuphead.



\define[2]\firstHeadings
  {\FrameTitle{#1}%
   \startFunnyText
 #2%
   \stopFunnyText}

\setuphead
  [section]
  [color=blue,
   style={\switchtobodyfont[miCorm]},
   textstyle={\switchtobodyfont[20.7pt]},
   command=\firstHeadings,
   indentnext=no]



\startsection[title=Aspectos generales]
Esta guía contiene toda la documentación necesaria para administrar la prueba 
unificada de certificación que ha diseñado la comisión de alemán. Se ruega al 
profesorado\footnote{Todas las alusiones a la forma del masculino genérico que 
se recogen en este documento deberán entenderse referidas a la condición 
masculina o femenina de cada persona según corresponda.} que se familiarice con 
las secciones del documento a través del índice y acuda a ellas según vaya 
siendo necesario, de manera que se pueda administrar y corregir la prueba de la 
manera más satisfactoria posible.
\stopsection



Use dummy text when it possible to keep the example short and clean.

\startsection[title=Aspectos generales]
\samplefile{lorem}
\stopsection


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Why is only the first frame protruding into the margin?

2024-05-16 Thread madiazm . eoicc
Hi,
I used some code from the meta-fun manual to recreate a labelled frame around 
my sections. But the first framedtext protrudes a couple of mm into the margin. 
Only the first one in the page. I intentionaly added other sections and the 
frames aline to the margin ok.
I tried to put something before the first frame (noindentation, dontleavehmode) 
because I sometimes read it solves problems, but not the case here.
so Why is the first frame protruding and only the first?


\definepapersize[vertical][A4, portrait]
\definepapersize[horizontal][A4, landscape] 
\setuppapersize[vertical]


\setuplayout[location=middle,
 marking=off,
 topspace=1cm,
 topdistance=0cm,
 backspace=2.5cm,   
 height=fit,
 width=fit,
 rightedge=5mm,
 rightedgedistance=0cm,
 rightmargin=20mm,
 rightmargindistance=7mm,
 leftmargin=1.5cm,
 header=1cm,
 headerdistance=.5cm,
 bottomspace=.5cm,
 bottomdistance=0mm,
 footer=.8cm,
 footerdistance=.2cm,
 setup=strict,]



\startuseMPgraphic{FunnyFrame}
picture p ; numeric w, h, o ;
p := textext.rt(\MPstring{FunnyFrame}) ;
w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ;
p := p shifted (2o,h-ypart center p) ; draw p ;
drawoptions (withpen pencircle scaled .25pt withcolor blue) ;
draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ;
%draw boundingbox p ; %%%quitamos el frame pequeño
setbounds currentpicture to unitsquare xyscaled(w,h) ;
\stopuseMPgraphic

\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][width=.85\textwidth, height=20mm, frame=off,  
background=FunnyFrame, align=flushright,location=right, 
after={\blank[2*big]}]%foregroundsytel amplía la palabra Apartado

\def\FrameTitle#1%
{\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut \color[blue]{\tfx Apartado 
#1}\hss}}}

\setMPtext{FunnyFrame}{} % initialize the text variable



\define[2]\firstHeadings{%
\dontleavehmode \switchtobodyfont[miCorm] 
\FrameTitle#1%

\dontleavehmode \startFunnyText  {\switchtobodyfont[miCorm,20.7pt] #2} 
\stopFunnyText
}

\setuphead [section] [color=blue, command=\firstHeadings, indentnext=no]


\starttext
\noindentation 
\dontleavehmode 

\startsection[title=Aspectos generales]


Esta guía contiene toda la documentación necesaria para administrar la prueba 
unificada de certificación que ha diseñado la comisión de alemán. Se ruega al 
profesorado\footnote{Todas las alusiones a la forma del masculino genérico que 
se recogen en este documento deberán entenderse referidas a la condición 
masculina o femenina de cada persona según corresponda.} que se familiarice con 
las secciones del documento a través del índice y acuda a ellas según vaya 
siendo necesario, de manera que se pueda administrar y corregir la prueba de la 
manera más satisfactoria posible.
\stopsection


\startsection[title=another section]
Las carpetas con las pruebas aparecen nombradas por idioma, nivel y set de 
pruebas, no apareciendo ninguna referencia a convocatorias anuales ni tampoco 
fechas. Sí aparece la referencia a la convocatoria en cada una de las guías de 
administración para los diferentes niveles.
 \stopsection
\startsection[title=another section]
La carpeta correspondiente a cada nivel contiene las distintas actividades de 
lengua, los audios para CTO y el audio/vídeo base para la mediación escrita. 
Además contiene esta guía con la información necesaria para tener una visión 
global de la prueba: los solucionarios, transcripciones, tablas de corrección, 
tablas de conversión y la rúbrica para la mediación escrita. Igualmente se 
incorporarán o enlazarán subcarpetas con los archivos necesarios para las 
pruebas orales: monólogos, diálogos y mediaciones orales.
 \stopsection

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: compatibility between \startshapetext and \startsection ?

2024-05-15 Thread Garulfo

Thanks you Wolfgang.

If it's not possible to use \blank, it appears that using for example 
\strut\par\strut\par is OK (but \par\par is not, )


\dorecurse{5}{
\strut\par\strut\par
\leftaligned{Title for section{\recurselevel}}
\strut\par\strut\par
\darkred\input knuth \par
\darkblue\input ward}

Please, what would be a \setuphead that removes the introduction of 
these "uncompatible" verticals skips ?


I've tried several, but even this one isn't compatible.

\setuphead
  [section]
  [before={}, % also tried \blank[nowhite] and \blank[back]
   inbetween={},
   after={},
   beforesection={},
   aftersection={},
   alternative=text,
   style=\tf]


Le 15/05/2024 à 13:09, Wolfgang Schuster a écrit :

garu...@azules.eu schrieb am 14.05.2024 um 23:13:

Hi all,

\startshapetext works pretty well, but when I use \startsection 
\stopsection, shapes are not respected  anymore.
I use layers, to be able to place the content anywhere, but the issue 
remains without layers.


Any clues ?
(\placeinitial seems also to break the shaping)


Example : 2 pages without sectioning, and after 2 pages by 
uncommenting the \startsection and \stopsection commands.



[...]
\dorecurse{5}{
\startsection[title={Title for section{\recurselevel}}]
\darkred\input knuth \par
\darkblue\input ward
\stopsection
}



The problem aren't the section command but the vertical skips added 
before and after each section, you can reproduce the effect when you add 
\blank to your example.


\dorecurse{5}{
\blank
\leftaligned{Title for section{\recurselevel}}
\blank
\darkred\input knuth \par
\darkblue\input ward
}

Wolfgang

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] what am I missing in the typescript?

2024-05-15 Thread madiazm . eoicc
Hi all,
I'm trying to configure my document to use Libertinus font for the general text 
and Cormorant for the headings, but I can't get the cormorant-font applied 
(neither in the text self). The Libertinus fonts get loaded without problems 
but for cormorant I don't get even a message in log, as if it was invisible.
What am I missing? here my script:


 
\definefontfeature[Libertinusfeatures][
  mode=node,
  ccmp=yes, % character composition
  liga=yes, tlig=yes, % ligatures
  tnum=yes,
  cpsp=yes, % capital spacing
  kern=yes,
  language=dflt,
  protrusion=quality,
  expansion=quality,
]

\definefontfeature[smallcaps][% use with \addff
  smcp=yes, % smallcaps
  % c2sc=yes, % caps to smallcaps
]


\starttypescript[serif][libertinus]
\definefontsynonym[LibertinusSerif-Regular]   
[file:/fonts/LibertinusSerif-Regular.otf]
\definefontsynonym[LibertinusSerif-Italic]
[file:/fonts/LibertinusSerif-Italic.otf]
\definefontsynonym[LibertinusSerif-Bold]  
[file:/fonts/LibertinusSerif-Semibold.otf]
\definefontsynonym[LibertinusSerif-BoldItalic]
[file:/fonts/LibertinusSerif-SemiboldItalic.otf]
\definefontsynonym[LibertinusSerif-Slanted]   
[file:/fonts/LibertinusSerif-Italic.otf]
\stoptypescript

\starttypescript[serif][libertinus][name]

\definefontsynonym [Serif] [LibertinusSerif-Regular]
[features=Libertinusfeatures]
\definefontsynonym [SerifRegular]  [LibertinusSerif-Regular]
[features=Libertinusfeatures]
\definefontsynonym [SerifItalic]   [LibertinusSerif-Italic] 
[features=Libertinusfeatures]
\definefontsynonym [SerifSlanted]  [LibertinusSerif-Italic]   
[features=Libertinusfeatures]
\definefontsynonym [SerifCaps] [LibertinusSerif-Regular]
[features={Libertinusfeatures,smallcaps}]
\definefontsynonym [SerifBold] [LibertinusSerif-Bold]   
[features=Libertinusfeatures]
\definefontsynonym [SerifBoldItalic]   [LibertinusSerif-BoldItalic]   
[features=Libertinusfeatures]
\definefontsynonym [SerifBoldSlanted]  [LibertinusSerif-BoldItalic] 
[features=Libertinusfeatures]

\stoptypescript



% SANS

\starttypescript[sans][libertinussans]
\definefontsynonym[LibertinusSans-Regular]
[file:/fontsSans/LibertinusSans-Regular.otf]
\definefontsynonym[LibertinusSans-Italic] 
[file:/fontsSans/LibertinusSans-Italic.otf]
\definefontsynonym[LibertinusSans-Bold]   
[file:/fontsSans/LibertinusSans-Bold.otf]
\stoptypescript


\starttypescript[sans][libertinussans][name]
\definefontsynonym [Sans] [LibertinusSans-Regular]
[features=Libertinusfeatures]
\definefontsynonym [SansItalic]   [LibertinusSans-Italic] 
[features=Libertinusfeatures]
\definefontsynonym [SansSlanted]  [LibertinusSans-Italic] 
[features=Libertinusfeatures]
\definefontsynonym [SansCaps] [LibertinusSans-Regular]
[features={Libertinusfeatures,smallcaps}]
\definefontsynonym [SansBold] [LibertinusSans-Bold]
[features=Libertinusfeatures]
\stoptypescript

%MONO

\starttypescript[mono][libertinusmono]
\definefontsynonym[LibertinusMono-Regular]
[file:/fontsMono/LibertinusMono-Regular.otf]
\stoptypescript


\starttypescript[mono][libertinusmono][name]
\definefontsynonym [Mono] [LibertinusMono-Regular]
[features=none]
\stoptypescript

%CORMORANT

\starttypescript[serif][cormorant]
\definefontsynonym[Cormorant-Regular][file:/fonts/Cormorant-Regular.otf]
\stoptypescript


\starttypescript[serif][cormorant][name]
\definefontsynonym [SerifRegular] [Cormorant-Regular]
[features=default]
\stoptypescript

% FAMILY



\starttypescript[miFuente]
\definetypeface [miFuente] [rm] [serif] [libertinus] [default]
\definetypeface [miFuente] [ss] [sans]  [libertinussans] [default]
\definetypeface [miFuente] [tt] [mono]  [libertinusmono] [default]
\stoptypescript

\starttypescript[miCorm]
\definetypeface [miCorm] [rm] [serif] [cormorant] [default]
\stoptypescript


\setupbodyfont[miFuente, 12pt]


\starttext


\startsection[title=Aspectos generales]

Esta guía contiene toda la documentación necesaria para administrar la {\it 
prueba unificada de certificación} que ha diseñado la comisión de alemán. Se 
ruega al profesorado que se familiarice con las secciones del documento a 
través del índice y acuda a ellas según vaya siendo necesario, de manera que se 
pueda {\bf administrar y corregir} la prueba de la manera más satisfactoria 
posible.

%%% trying to get cormorant working...

\startsubsection[title=Organización de carpetas]
{\switchtobodyfont[miCorm] {\tfc la fuente Cormorant no funciona}}
\stopsubsection



Las carpetas aparecen nombradas {\ss por idioma}, nivel y set de pruebas, no 
apareciendo ninguna referencia a convocatorias ni tampoco fechas. Sí aparece la 
referencia a la convocatoria en cada una de las guías de administración para 
los diferentes niveles.
La carpeta correspondiente a cada nivel contiene las distintas

[NTG-context] Re: compatibility between \startshapetext and \startsection ?

2024-05-15 Thread Wolfgang Schuster

garu...@azules.eu schrieb am 14.05.2024 um 23:13:

Hi all,

\startshapetext works pretty well, but when I use \startsection \stopsection, 
shapes are not respected  anymore.
I use layers, to be able to place the content anywhere, but the issue remains 
without layers.

Any clues ?
(\placeinitial seems also to break the shaping)


Example : 2 pages without sectioning, and after 2 pages by uncommenting the 
\startsection and \stopsection commands.


[...]
\dorecurse{5}{
\startsection[title={Title for section{\recurselevel}}]
\darkred\input knuth \par
\darkblue\input ward
\stopsection
}



The problem aren't the section command but the vertical skips added 
before and after each section, you can reproduce the effect when you add 
\blank to your example.


\dorecurse{5}{
\blank
\leftaligned{Title for section{\recurselevel}}
\blank
\darkred\input knuth \par
\darkblue\input ward
}

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] compatibility between \startshapetext and \startsection ?

2024-05-14 Thread garulfo
Hi all,

\startshapetext works pretty well, but when I use \startsection \stopsection, 
shapes are not respected  anymore.
I use layers, to be able to place the content anywhere, but the issue remains 
without layers.

Any clues ?
(\placeinitial seems also to break the shaping)


Example : 2 pages without sectioning, and after 2 pages by uncommenting the 
\startsection and \stopsection commands.


\setupbodyfont [pagella, 8pt]
\setupframed
  [frame=on,
   offset=0.000pt,
   rulethickness=0.000pt,
   location=top,
   align=normal,
   strut=yes,
   ]
\setuplayout [grid=yes]
\setupinteraction [state=start]

%--

\definemeasure [myheight] [{\the\dimexpr\baselineskip*33+\lineskip\relax}]
\definemeasure [myheighta][{\the\dimexpr\baselineskip*10+\lineskip*2\relax}]
\definemeasure [myheightb][{\the\dimexpr\baselineskip*20-\lineskip*2\relax}]

\startuseMPgraphic{mp1}
  path p ;
  numeric myheight  ; myheight := \measure{myheight};
  numeric myheighta ; myheighta := \measure{myheighta};
  numeric myheightb ; myheightb := \measure{myheightb};
  p := (0,0) -- (6cm,0) --
   (6cm,myheighta) -- (4cm,myheighta) -- (4cm,myheightb) -- (6cm,myheightb) 
--
   (6cm,myheight) -- (0cm,myheight) -- cycle;
  build_parshape(p,0,0,0,\baselinedistance,\strutheight,\strutdepth,\topskip) ;
  fill p withcolor \MPcolor{lightyellow};
\stopuseMPgraphic

\defineoverlay[ol1][\useMPgraphic{mp1}]


%==
\starttext
%==

{\sc\bfd Version A, without sectionning, pages 1\ampersand 2}

\startshapetext[mp1, mp1, mp1, mp1, mp1, mp1]
\setupalign[hz,hanging,verytolerant,stretch,normal]%
\setupindenting[yes,small]%
\strut%
\reference[myref1]{MyRef1}Here is the first reference.\par
See reference \in[myref2] on \at{page}[myref2]\par
%
\dorecurse{5}{
%\startsection[title={Title for section{\recurselevel}}]
\darkred\input knuth \par
\darkblue\input ward
%\stopsection
}

\reference[myref2]{MyRef2} Here is the second reference.\par
See reference \in[myref1] on \at{page}[myref1]\par

\stopshapetext

\definelayer[testA]

\setlayer[testA][x=-1cm,y=3cm]{\framed[background=ol1]{\strut\getshapetext}}
\setlayer[testA][x=9cm,y=3cm] {\framed[background=ol1]{\strut\getshapetext}}
\flushlayer[testA]

\page

\setlayer[testA][x=-1cm,y=3cm]{\framed[background=ol1]{\strut\getshapetext}}
\setlayer[testA][x=9cm,y=3cm] {\framed[background=ol1]{\strut\getshapetext}}
\flushlayer[testA]

\page
%==

{\sc\bfd Version B, with sectionning, pages 3\ampersand 4}

\startshapetext[mp1, mp1, mp1, mp1, mp1, mp1]
\setupalign[hz,hanging,verytolerant,stretch,normal]%
\setupindenting[yes,small]%
\strut%
\reference[myref3]{MyRef3}Here is the first reference.\par
See reference \in[myref4] on \at{page}[myref4]\par
%
\dorecurse{5}{
\startsection[title={Title for section{\recurselevel}}]
\darkred\input knuth \par
\darkblue\input ward
\stopsection
}

\reference[myref4]{MyRef4} Here is the second reference.\par
See reference \in[myref3] on \at{page}[myref3]\par

\stopshapetext

\definelayer[testB]

\setlayer[testB][x=-1cm,y=3cm]{\framed[background=ol1]{\strut\getshapetext}}
\setlayer[testB][x=9cm,y=3cm] {\framed[background=ol1]{\strut\getshapetext}}
\flushlayer[testB]

\page

\setlayer[testB][x=-1cm,y=3cm]{\framed[background=ol1]{\strut\getshapetext}}
\setlayer[testB][x=9cm,y=3cm] {\framed[background=ol1]{\strut\getshapetext}}
\flushlayer[testB]

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Errors with 2024-05-11 LMTX

2024-05-12 Thread Rik Kabel
I have come across an error that halts processing with the latest 
release. The following demonstrates this:


   \setuppagenumbering [location=]

   \starttext

 \dorecurse{36}{\dorecurse{19}{abc }}

 \startplacetable[location=split,title={Table}]
    \starttabulate[|p|p|]
    \HL
    \NC Heading \crlf
    heading
    \NC Heading \crlf
    heading
    \NC\AR
    \HL
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \NC abc \crlf
    abc
    \NC abc
    \NC\AR
    \HL
    \stoptabulate
    \stopplacetable

   \stoptext

while this version ends with the error : error (nodes): attempt to 
double-free rule node 55342, ignored


   \setuppagenumbering [location=]
   \starttext

 \dorecurse{37}{\dorecurse{19}{abc }}

 \startplacetable[location=split,title={Table}]

    \starttabulate[|p|p|]
    \HL
    \NC Heading \crlf
    heading
    \NC Heading \crlf
    heading
    \NC\AR
    \HL
    \NC abc \NC abc \NC\AR
    \NC abc \NC abc \NC\AR
    \NC abc \NC abc \NC\AR
    \HL
    \stoptabulate

    \stopplacetable

   \stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Is there a way to consolidate index reference numbers by book?

2024-05-10 Thread Joel via ntg-context
\useregister[workbookA][03_workbook][learnedlong][WB~1:~]
\useregister[workbookB][04_workbook][learnedlong][WB~2:~]
\useregister[workbookC][05_workbook][learnedlong][WB~3:~]
\useregister[workbookD][06_workbook][learnedlong][WB~4:~]




    \startchapter[title=Standards]                    
\placeregister[learnedlong,workbookA,workbookB,workbookC,workbookD]
        \stopchapter

I setup a custon index that lists items from four different workbooks. 

The problem is in the indexi, it displays entreis like this:
WHST.1.1: 11, 231, WB 1: 124, WB 1: 133, WB 2: 325, WB 2: 345, etc.
In other words, it says WB 1 in front of every page number from the first 
workbook.
Is there any way to consolidate the page numbers by book, e.g. output instead 
like this:
WHST.1.1: 11, 231, WB1: 124, 133, WB 2: 325, 345
In other words, it list all page numbers for Workbook 1 right after WB 1: 
instead of placing WB 1 in front of every single page from Workbook 1?
--Joel
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] wiki Command/MPdrawingdonetrue => NO COMMAND FOUND

2024-05-08 Thread garulfo
Is there something to do to make the wiki aware of the existence of 
\MPdrawingdonetrue ?

https://wiki.contextgarden.net/index.php?title=Command/MPdrawingdonetrue=edit=1
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Why is this description environment not showing the correct title?

2024-05-05 Thread Wolfgang Schuster

Mikael Sundqvist schrieb am 05.05.2024 um 16:45:

Hi

On Sun, May 5, 2024 at 4:40 PM Joel via ntg-context  wrote:


\definedescription[latexdesc][headstyle=bold, style=normal, align=flushleft, 
alternative=hanging, width=broad, margin=1cm]

\starttext

 \latexdesc{1540} some event happened
 \latexdesc{1541} some other event happened
 \latexdesc{1542} some event happened quite different

\stoptext


I found the above code (the first line) in the ConTeXt Wiki, as a way to create 
the equivalent of a desc environment from LaTeX. The items inside {} should be 
bold, then there is a gap before the next text.

I am using this to display a simple timeline.

Though the formatting looks perfect, very strangely when I compile it, it changes all of 
the dates to say "1540" (or whatever date was used first).

Why is it showing the wrong title on the desc environment?

--Joel

I don't know how you want it to look, exactly, but ending the
paragraph helps with the numbering. There is also a start/stop version
that suggests a bit more structure.


Paragraphs act as delimiter for each description in the old form, the 
environment
form is better in this regards because a) you can now use multiple 
paragraphs as

part of a single description and you can avoid problem like Joel has because
it is clear where each description ends.


\definedescription
   [latexdesc]
   [headstyle=bold,
style=normal,
align=flushleft,
alternative=hanging,
width=broad,
margin=1cm]

\starttext

\latexdesc{1540} some event happened

\latexdesc{1541} some other event happened

\latexdesc{1542} some event happened quite different

\startlatexdesc
   [title={1540}]
   some event happened
\stoplatexdesc

\startlatexdesc
   [title={1541}]
   some other event happened
\stoplatexdesc

\startlatexdesc
   [title={1542}]
   some event happened quite different
\stoplatexdesc

\stoptext


An alternative to descriptions for such simple aligned text are item 
with the \txt option.
Both blocks are the same but the second use the start/stop option for 
each item.


\starttext

\startitemize[width=3em,symstyle=bold]
\txt{1540} some event happened
\txt{1541} some other event happened
\txt{1542} some event happened quite different
\stopitemize

\blank[2*line]

\startitemize[width=3em,symstyle=bold]
\startspecialitem[txt]{1540} some event happened \stopspecialitem
\startspecialitem[txt]{1541} some other event happened \stopspecialitem
\startspecialitem[txt]{1542} some event happened quite different 
\stopspecialitem

\stopitemize

\stoptext

Wolfgang

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Why is this description environment not showing the correct title?

2024-05-05 Thread Mikael Sundqvist
Hi

On Sun, May 5, 2024 at 4:40 PM Joel via ntg-context  wrote:
>
>
> \definedescription[latexdesc][headstyle=bold, style=normal, align=flushleft, 
> alternative=hanging, width=broad, margin=1cm]
>
> \starttext
>
> \latexdesc{1540} some event happened
> \latexdesc{1541} some other event happened
> \latexdesc{1542} some event happened quite different
>
> \stoptext
>
>
> I found the above code (the first line) in the ConTeXt Wiki, as a way to 
> create the equivalent of a desc environment from LaTeX. The items inside {} 
> should be bold, then there is a gap before the next text.
>
> I am using this to display a simple timeline.
>
> Though the formatting looks perfect, very strangely when I compile it, it 
> changes all of the dates to say "1540" (or whatever date was used first).
>
> Why is it showing the wrong title on the desc environment?
>
> --Joel

I don't know how you want it to look, exactly, but ending the
paragraph helps with the numbering. There is also a start/stop version
that suggests a bit more structure.

\definedescription
  [latexdesc]
  [headstyle=bold,
   style=normal,
   align=flushleft,
   alternative=hanging,
   width=broad,
   margin=1cm]

\starttext

\latexdesc{1540} some event happened

\latexdesc{1541} some other event happened

\latexdesc{1542} some event happened quite different

\startlatexdesc
  [title={1540}]
  some event happened
\stoplatexdesc

\startlatexdesc
  [title={1541}]
  some other event happened
\stoplatexdesc

\startlatexdesc
  [title={1542}]
  some event happened quite different
\stoplatexdesc

\stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Why is this description environment not showing the correct title?

2024-05-05 Thread Joel via ntg-context

\definedescription[latexdesc][headstyle=bold, style=normal, align=flushleft, 
alternative=hanging, width=broad, margin=1cm]

\starttext

    \latexdesc{1540} some event happened
    \latexdesc{1541} some other event happened
    \latexdesc{1542} some event happened quite different

\stoptext


I found the above code (the first line) in the ConTeXt Wiki, as a way to create 
the equivalent of a desc environment from LaTeX. The items inside {} should be 
bold, then there is a gap before the next text.
I am using this to display a simple timeline.
Though the formatting looks perfect, very strangely when I compile it, it 
changes all of the dates to say "1540" (or whatever date was used first).
Why is it showing the wrong title on the desc environment?
--Joel
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Font switching for titles and subtitle not working as expected ?

2024-04-30 Thread Wolfgang Schuster

denis.ma...@unibe.ch schrieb am 30.04.2024 um 14:22:


Hi,

I just jumbled upon this question on tex stackexchange : 
https://tex.stackexchange.com/questions/715799/context-switching-font-for-both-title-and-subject#715804


Using the style key as suggested in the accepted answer works, but 
I’ve had a look in to this, and I don’t understand why the original 
code does not work.


I’ve also tried to find a solution using textcommand instead of 
command, but that makes no difference. Only one setting will be 
accepted. As soon as both, titles and subjects, are changed only the 
first change will be accepted.


Is this a bug, or am I missing something?



When you load a typescript only in a local group (e.g. a section title) 
you should always load it

at the start of the document to avoid such side effects.

    \usebodyfont[chorus] % load the chorus typescript
    \setupbodyfont[modern] % set the default font for the document

Wolfgang

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Hbox error with itemized list on second page

2024-04-30 Thread Ross Schulman
Hello,
I'm attempting to format a resume in Context building off of a template I found 
online. I'm having an odd error with some bullets on the second page, however. 
I'm guessing it has something to do with my \definelayout for the second (and 
subsequent) pages, but I can't figure it out for sure. What is happening is 
that whichever bullets are at the top of the second page are being wrapped as 
if they were appearing on the first page, which has a different layout 
structure.

I've pasted a sanitized version of the tex file below. Any assistance would be 
greatly appreciated!

Thanks,
Ross Schulman


\usemodule[ipsum]
\setuppapersize[letter]
\setuppagenumbering[location=]
\definelayout[first]
  [% horizontal
   backspace=2.5in,
   leftmargin=1.75in,
   leftmargindistance=0.25in,
   width=5.5in,
   rightmargin=0in,
   % vertical
   topspace=0pt,
   header=1.2in,
   headerdistance=.1in,
   height=middle,
   footerdistance=0pt,
   footer=\lineheight,
   bottomspace=.5in]

\definelayout[rest]
  [% horizontal
leftmargin=0in,
width=6.5in,
rightmargin=0in,
% % vertical
topspace=0pt,
header=1in,
headerdistance=.1in,
height=middle,
footerdistance=0pt,
footer=\lineheight,
bottomspace=.3in]

\definelayout[1][first]
\definelayout[2][rest]

\setupmarginblock
  [location=left,
   width=\leftmarginwidth,
   align=flushright]

\usecolors[svg]

\definehead[contacts][title]
\setuphead
[contacts]
[
align=center,
page=no,
after={\thinrule\blank[big]}]

\definehead[topic][subject]
\setuphead
[topic]
[
after={\hairline}]

\defineitemgroup
  [timeline]
  [before=,
   inbetween=,
   width=6em]

\setuplines[before=,after=,command=\strut]

\definelayer[mybkgr][x=0mm,y=0mm,
  width=\paperwidth,height=\paperheight]

\setupbackgrounds[page][background={mybkgr}]

\starttext
\setlayerframed
  [mybkgr]
  []
  [background=color,
   framecolor=forestgreen,
   backgroundcolor=forestgreen,
   foregroundcolor=white,
   width=\paperwidth,
   height=\dimexpr\topspace+\headerheight\relax]
{\dontleavehmode{\tfd ROSS SCHULMAN}\blank[medium]
policy technologist
}

\startmarginblock
\topic{CONTACT}
\startlines
1234 Main St NW
Washington, DC 20011
\stoplines

\topic{LANGUAGES}
\startlines
English (Native Speaker)
Spanish (Conversational)
\stoplines

\topic{TECH}
\startlines
Rust
Javascript \letterampersand\space Typescript
Linux Administration
Google and Microsoft Office Suites
\stoplines
\stopmarginblock

\setupalign[flushleft]
\topic{EXPERIENCE}
\starttimeline
\sym{2021--Now}\color[forestgreen]{Lorem Ipsum Foundation}\hfill
\color[darkgrey]{\tfx San Francisco, CA (remote)}

Senior Fellow
\startitemize[packed]
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize

\sym{2015--2021}\color[forestgreen]{Other Place About Lorem}\hfill
\color[darkgrey]{\tfx Washington, DC}

Senior Lorem Counsel
\startitemize[packed]
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize

\sym{2014--2015}\color[forestgreen]{Lorems R Us}\hfill
\color[darkgrey]{\tfx Washington, DC}

Lorem Manager
\startitemize[packed]
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize

\sym{2010--2014}\color[forestgreen]{Computer and Communications Industry 
Association}\hfill
\color[darkgrey]{\tfx Washington, DC}

Lorem Project Manager
\startitemize[packed]
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize

\sym{2005--2007}\color[forestgreen]{Center for Lorem Ipsum}\hfill
\color[darkgrey]{\tfx Washington, DC}

Program Associate
\startitemize[packed]
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
  \item \ipsum[alternative=words, n=10, inbetween=\space] \par
\stopitemize
\stoptimeline
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https

[NTG-context] Font switching for titles and subtitle not working as expected ?

2024-04-30 Thread denis.maier
Hi,
I just jumbled upon this question on tex stackexchange : 
https://tex.stackexchange.com/questions/715799/context-switching-font-for-both-title-and-subject#715804
Using the style key as suggested in the accepted answer works, but I've had a 
look in to this, and I don't understand why the original code does not work.
I've also tried to find a solution using textcommand instead of command, but 
that makes no difference. Only one setting will be accepted. As soon as both, 
titles and subjects, are changed only the first change will be accepted.

Is this a bug, or am I missing something?

Best,
Denis


%
% Original MWE

\define[2]\mytitle{%
  \switchtobodyfont[chorus]%
  #2
}

\define[2]\mysubject{%
  \switchtobodyfont[chorus]%
  #2
}

\setuphead[title][command=\mytitle]
\setuphead[subject][command=\mysubject]

\starttext
\title{In Zapf Chancery}
\subject{Apparently the default font. Why?}

And in the default font, just as expected.
\stoptext
%

%
% Adapted MWE
%

\define[1]\mytitleformat{%
  \switchtobodyfont[chorus]%
  #1
}

%\setuphead[subject,title][textcommand=\mytitleformat]
%\setuphead[title][textcommand=\mytitleformat]
\setuphead[subject][textcommand=\mytitleformat] % this will adapt the format 
for subjects, as long as titles are not changed


\starttext
\title{In Zapf Chancery}
\subject{Apparently the default font. Why?}

And in the default font, just as expected.
\stoptext
%%
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: ConteXt commands in an rtl environment

2024-04-29 Thread Wolfgang Schuster

Alan Bowen schrieb am 29.04.2024 um 19:37:

I used TeXShop and PopChar Pro to get the letter ר so that it is l2r.

Not a great solution but it works when one is working in r2l text. 
(Thank heaven for Unicode.)


I will have a look at Visual Studio Code.


I tested a few text editors with better RTL support and all of them show 
the text in the same way as TeXShop.


Support for RTL in Visual Studio Code seems to be limited because the 
editor doesn't use the Unicode Bidi Algorithm [1].


[1] https://wiki.archlinux.org/title/Bidirectional_text#Editors

Wolfgang

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Combine lua and btx setup, was: Re: Customize citation format of a bibliography (use the short form as reference format)

2024-04-25 Thread Gerion Entrup
I solved it, although it's kinda hacky. I'm pretty sure that
publications.citevariants.short is not meant to be called directly.

Do you know why `context.getdetail(dataset, tag, "author")` does not work in 
render_cite?
It always returns nil.


```
\setupinteraction[state=start]

\startbuffer[testdata]
@Book{knuth1,
author = {Donald E. Knuth},
    title = {TEX and METAFONT. New directions in typesetting},
year = {1979},
publisher = {Addison-Wesley},
}
@Article{someother,
author = {Some Person and Some Otherperson},
    title = {Another title},
year = {1900},
}
\stopbuffer

% enable tracing
\enabletrackers[publications, publications.crossref, publications.details, 
publications.cite, publications.strings]

\usebtxdataset[main][testdata.buffer]
\usebtxdefinitions[aps]
\setupbtx[dataset=main]
\definebtxrendering[bibrendering][aps][dataset=main, numbering=short]
\setupbtxlist[aps][
  alternative=b,
  distance=.5em,
]

\definebtx[aps:cite:special][aps:cite]
\startluacode
function render_cite(dataset, tag, righttext)
local luadata = publications.datasets[dataset].luadata
local entry = luadata[tag]
local extrasign = ""
if entry.author:lower():find("knuth") then
extrasign = ">"
end
context("[" .. extrasign)
print(righttext)
publications.citevariants.short({dataset = dataset, reference = tag, 
variant = "short", righttext = righttext})
context("]")
end
\stopluacode

\startsetups btx:aps:cite:special
\btxcitereference
\ctxlua{render_cite([==[\currentbtxdataset]==], [==[\currentbtxtag]==], 
[==[\currentbtxrighttext]==])}
\stopsetups
\setupbtx[aps:cite][alternative=special]

\starttext

\def\comma{,}

Knuth developed \TeX~\cite[knuth1]
Several persons said something~\cite[someother].

\placelistofpublications[bibrendering]

\stoptext
```

Gerion

Am Dienstag, 23. April 2024, 16:03:50 MESZ schrieb Gerion Entrup:
> Here is a solution for the first part of my question. This is based on
> https://www.mail-archive.com/ntg-context@ntg.nl/msg101156.html
> and try and error based on publ-imp-aps.mkvi and publ-imp-apa.mkvi:
> 
> It display now the citation _and_ numbering labels in the short form:
> ```
> \setupinteraction[state=start]
> 
> \startbuffer[testdata]
> @Book{knuth1,
>   author = {Donald E. Knuth},
>   title = {TEX and METAFONT. New directions in typesetting},
>   year = {1979},
>   publisher = {Addison-Wesley},
> }
> @Article{someother,
>   author = {Some Person and Some Otherperson},
>   title = {Another title},
>   year = {1900},
> }
> \stopbuffer
> 
> % enable tracing
> \enabletrackers[publications, publications.crossref, publications.details, 
> publications.cite, publications.strings]
> 
> \usebtxdataset[main][testdata.buffer]
> \usebtxdefinitions[aps]
> \setupbtx[dataset=main]
> \definebtxrendering[bibrendering][aps][dataset=main, numbering=short]
> \setupbtxlist[aps][
>   alternative=b,
>   distance=.5em,
> ]
> \setupbtx[aps:cite][alternative=short]
> 
> \starttext
> 
> Knuth developed \TeX \cite[knuth1]
> Several persons said something \cite[someother].
> 
> \placelistofpublications[bibrendering]
> 
> \stoptext
> ```
> 
> The remaining part now is to mark publications of Knuth in a different way.
> I have tried this and failed. Here is my code so far:
> ```
> \startluacode
> function render_cite(short, author)
>   print(author)
>   if author:lower():find("knuth") then
>   context("[>" .. short .. "]")
>   else
>   context("[" .. short .. "]")
>   end
> end
> \stopluacode
> \definebtx[aps:cite:special][aps:cite]
> \startsetups btx:aps:cite:special
>   \btxcitereference
>   \ctxlua{render_cite([==[\btxflush{year}]==], [==[\btxflush{author}]==])}
> \stopsetups
> % use it with \cite[special][knuth1]
> ```
> This has several problems:
> - \btxflush{short} does not work as I expected that. How can I get the short 
> form?
> - \btxflush to pass arguments to lua does not work as intended. On the lua 
> side the
>variable "author" resolves to "\btxflushauthor{author}" and not to "D. E. 
> Knuth".
>How can I pass the data?
> 
> I use Lua only because I find it more convenient as a programming language. 
> If a
> plain tex solution is simpler, I'm happy to use that. 
> 
> 
> Another question that came up while studying the source code:
> What effect have \c!, \s!, and \v!? These commands exist a lot in the above
> cited files.
> 
> Gerion
> 
> 
> Am Mittwoch, 17. Ap

[NTG-context] Combine lua and btx setup, was: Re: Customize citation format of a bibliography (use the short form as reference format)

2024-04-23 Thread Gerion Entrup
Here is a solution for the first part of my question. This is based on
https://www.mail-archive.com/ntg-context@ntg.nl/msg101156.html
and try and error based on publ-imp-aps.mkvi and publ-imp-apa.mkvi:

It display now the citation _and_ numbering labels in the short form:
```
\setupinteraction[state=start]

\startbuffer[testdata]
@Book{knuth1,
author = {Donald E. Knuth},
title = {TEX and METAFONT. New directions in typesetting},
year = {1979},
publisher = {Addison-Wesley},
}
@Article{someother,
author = {Some Person and Some Otherperson},
title = {Another title},
year = {1900},
}
\stopbuffer

% enable tracing
\enabletrackers[publications, publications.crossref, publications.details, 
publications.cite, publications.strings]

\usebtxdataset[main][testdata.buffer]
\usebtxdefinitions[aps]
\setupbtx[dataset=main]
\definebtxrendering[bibrendering][aps][dataset=main, numbering=short]
\setupbtxlist[aps][
  alternative=b,
  distance=.5em,
]
\setupbtx[aps:cite][alternative=short]

\starttext

Knuth developed \TeX \cite[knuth1]
Several persons said something \cite[someother].

\placelistofpublications[bibrendering]

\stoptext
```

The remaining part now is to mark publications of Knuth in a different way.
I have tried this and failed. Here is my code so far:
```
\startluacode
function render_cite(short, author)
print(author)
if author:lower():find("knuth") then
context("[>" .. short .. "]")
else
context("[" .. short .. "]")
end
end
\stopluacode
\definebtx[aps:cite:special][aps:cite]
\startsetups btx:aps:cite:special
\btxcitereference
\ctxlua{render_cite([==[\btxflush{year}]==], [==[\btxflush{author}]==])}
\stopsetups
% use it with \cite[special][knuth1]
```
This has several problems:
- \btxflush{short} does not work as I expected that. How can I get the short 
form?
- \btxflush to pass arguments to lua does not work as intended. On the lua side 
the
   variable "author" resolves to "\btxflushauthor{author}" and not to "D. E. 
Knuth".
   How can I pass the data?

I use Lua only because I find it more convenient as a programming language. If a
plain tex solution is simpler, I'm happy to use that. 


Another question that came up while studying the source code:
What effect have \c!, \s!, and \v!? These commands exist a lot in the above
cited files.

Gerion


Am Mittwoch, 17. April 2024, 15:44:12 MESZ schrieb Gerion Entrup:
> Hi,
> 
> > The APS style is an example of a number-based citation system. As you
> > are looking for a tag-based citation, it might be better to start with
> > something like the APA style.
> 
> I'm kind of satisfied with the publication-list layout of the APS style so I 
> chose
> this as a base. If it is simpler to start with the APA style, I can do that.
> 
> My hope is that it is possible to just change the "label" that is used for
> referencing and keep everything else as is.
> 
> > Is there some specification for your short tag-based citation style?
> 
> biblatex implements this with the "alphabetic" style. I'm not aware of
> a specification, though. Does the "short" form in ConTeXt exist for a
> specific reason? :)
> 
> Gerion
> 
> > On Tue, 16 Apr 2024 06:04:35 +0200
> > Gerion Entrup  wrote:
> > 
> > > Hi,
> > > 
> > > I'm trying to customize a cite format in a bibliography. Currently,
> > > I'm using the aps style which fits so far, except of the plain number
> > > as reference. In concrete, I want to change the following:
> > > - Use the first letter of the last name and the year as reference
> > > (this should be exactly the short form). It is more less also
> > > described here [1].
> > > - Highlight publications of a certain author with an extra char (e.g.
> > > '>')
> > > 
> > > Here is a minimal example (lets assume, every occurrence of Knuth
> > > should be highlighted): ```
> > > \setupinteraction[state=start]
> > > 
> > > \startbuffer[testdata]
> > > @Book{knuth1,
> > >   author = {Donald E. Knuth},
> > >   title = {TEX and METAFONT. New directions in typesetting},
> > >   year = {1979},
> > >   publisher = {Addison-Wesley},
> > > }
> > > @Article{someother,
> > >   author = {Some Person and Some Otherperson},
> > >   title = {Another title},
> > >   year = {1900},
> > > }
> > > \stopbuffer
> > > 
> > > % enable tracing
> > > \enabletrackers[publications, publications.crossref,
> > > publications.details, publications.cite, publications.strings]

[NTG-context] Re: Why are ConTeXt-SBL endnotes empty?

2024-04-22 Thread Joel via ntg-context
 Changing location=none to location=text still left me with the bullet points 
appearing in a big list at the end of my chapter, but without any messages in 
them.

On Monday, April 22, 2024 at 07:54:39 AM MDT, Joel via ntg-context 
 wrote:  
 
 A few years back, I tried using endnotes with ConTeXt-SBL, and it failed to 
compile. I'm forced to try again (due to some other issue with footnotes), and 
instead of compiling to error, it compiles, but the footnote's message ends up 
being empty. 
Why is it appearing empty? Is there a fix?

Here is a minimum working example:
\usemodule[publ-imp-sbl]
\startbuffer [bib]

@Article{na2006,
title={Volcanoes \word{of} New Mexico},
year={2006},
journal={New Mexico Earth Matters},
publisher={New Mexico Bureau \word{of} Geology \word{and} Mineral Resources},
volume={6},
number={1},
location={Socorro, New Mexico}
}

@Book{clark1989,
author = {Clark, William},
title = {Railroads \word{and} railroad towns \word{in} New Mexico},
publisher = {New Mexico Magazine},
year = {1989},
address = {Albuquerque, New Mexico},
isbn = {9780937206126}
}

\stopbuffer

\usebtxdataset[bib.buffer]

\setupbtx[dataset=default]
\usebtxdefinitions[sbl]
\setupbtx[sbl]

\setupnote[footnote][location=none]

\starttext

   \input knuth
    \cite[clark1989]

    \placenotes[footnote]

    
    \startchapter[title=Bibliography]
    \placelistofpublications
    \stopchapter

\stoptext

--Joel


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki    : https://wiki.contextgarden.net
___
  ___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Why are ConTeXt-SBL endnotes empty?

2024-04-22 Thread Jean-Pierre Delange
See here : 

https://wiki.contextgarden.net/Footnotes

Jean-Pierre


> Le 22 avr. 2024 à 16:47, Pablo Rodriguez via ntg-context  
> a écrit :
> 
> On 4/22/24 15:51, Joel via ntg-context wrote:
>> A few years back, I tried using endnotes with ConTeXt-SBL, and it failed
>> to compile. I'm forced to try again (due to some other issue with
>> footnotes), and instead of compiling to error, it compiles, but the
>> footnote's message ends up being empty. 
>> 
>> Why is it appearing empty? Is there a fix?
> 
> Hi Joel,
> 
> the bibliography part doesn’t work for me at all.
> 
> But notes may be placed as their location is text (and you add a real
> footnote).
> 
> This works fine:
> 
>  \setupnote[footnote][location=text]
> 
>  \starttext
> \input knuth
> \footnote{Footnote}
>  \cite[clark1989]
> 
>  \placenotes[footnote]
> 
>  \startchapter[title=Bibliography]
>  \placelistofpublications
>  \stopchapter
>  \stoptext
> 
> I never used a bibliography in ConTeXt, so that part is left to you.
> 
> I hope it helps,
> 
> Pablo
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: documentation: parameters of \setuplist

2024-04-22 Thread Henning Hraban Ramm

Am 22.04.24 um 18:30 schrieb Duncan Hothersall:

Hi Hraban,

I can help with one - aligntitle means an unnumbered section will align 
in the table of contents under the number rather than the title. So for 
example if you have a TOC combining \section and \subject entries, they 
would look like this:


1 ... A section
A subject

rather than

1 ... A section
.. A subject


Thank you! I added it in the wiki.

Hraban

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: documentation: parameters of \setuplist

2024-04-22 Thread Duncan Hothersall
Hi Hraban,

I can help with one - aligntitle means an unnumbered section will align in
the table of contents under the number rather than the title. So for
example if you have a TOC combining \section and \subject entries, they
would look like this:

1 ... A section
A subject

rather than

1 ... A section
.. A subject

Duncan

On Mon, 22 Apr 2024 at 17:09, Henning Hraban Ramm  wrote:

> I tried to complete https://wiki.contextgarden.net/Command/setuplist,
> but I don’t understand all parameters.
>
> Can anyone explain these please:
>
> * state (start stop): what does this en-/disable? collecting entries?
> * label (yes no none Name): language dependent labels? as a prefix or what?
> * location (none, here): disable placement? when makes this sense?
> * aligntitle (yes no): align which part to what?
> * symbol (one two three none default): where is this used?
>
>
> Expect more questions…
>
> Hraban
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Why are ConTeXt-SBL endnotes empty?

2024-04-22 Thread Pablo Rodriguez via ntg-context
On 4/22/24 15:51, Joel via ntg-context wrote:
> A few years back, I tried using endnotes with ConTeXt-SBL, and it failed
> to compile. I'm forced to try again (due to some other issue with
> footnotes), and instead of compiling to error, it compiles, but the
> footnote's message ends up being empty. 
>
> Why is it appearing empty? Is there a fix?

Hi Joel,

the bibliography part doesn’t work for me at all.

But notes may be placed as their location is text (and you add a real
footnote).

This works fine:

  \setupnote[footnote][location=text]

  \starttext
 \input knuth
 \footnote{Footnote}
  \cite[clark1989]

  \placenotes[footnote]

  \startchapter[title=Bibliography]
  \placelistofpublications
  \stopchapter
  \stoptext

I never used a bibliography in ConTeXt, so that part is left to you.

I hope it helps,

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Why are ConTeXt-SBL endnotes empty?

2024-04-22 Thread Joel via ntg-context
A few years back, I tried using endnotes with ConTeXt-SBL, and it failed to 
compile. I'm forced to try again (due to some other issue with footnotes), and 
instead of compiling to error, it compiles, but the footnote's message ends up 
being empty. 
Why is it appearing empty? Is there a fix?

Here is a minimum working example:
\usemodule[publ-imp-sbl]
\startbuffer [bib]

@Article{na2006,
title={Volcanoes \word{of} New Mexico},
year={2006},
journal={New Mexico Earth Matters},
publisher={New Mexico Bureau \word{of} Geology \word{and} Mineral Resources},
volume={6},
number={1},
location={Socorro, New Mexico}
}

@Book{clark1989,
author = {Clark, William},
title = {Railroads \word{and} railroad towns \word{in} New Mexico},
publisher = {New Mexico Magazine},
year = {1989},
address = {Albuquerque, New Mexico},
isbn = {9780937206126}
}

\stopbuffer

\usebtxdataset[bib.buffer]

\setupbtx[dataset=default]
\usebtxdefinitions[sbl]
\setupbtx[sbl]

\setupnote[footnote][location=none]

\starttext

   \input knuth
    \cite[clark1989]

    \placenotes[footnote]

    
    \startchapter[title=Bibliography]
    \placelistofpublications
    \stopchapter

\stoptext

--Joel


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Why don't footnotes appear in floats or figures?

2024-04-22 Thread Joel via ntg-context
 I've managed to get a minimum working example. If you check, you'll see the 
5th footnote inside a placefigure doesn't render anywhere:
\starttext

    \input knuth
    \placefigure{Caption\footnote{message 
A}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
B}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
C}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
D}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
E}}{\externalfigure[cow][width=\textwidth]}
    \input knuth
    \placefigure{Caption\footnote{message 
F}}{\externalfigure[cow][width=\textwidth]}

\stoptext


Is this the correct way to be using the \startpostponing code (see example 
below)?
\starttext
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
A}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
B}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
C}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
D}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
E}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
    \input knuth
\startpostponing
    \placefigure{Caption\footnote{message 
F}}{\externalfigure[cow][width=\textwidth]}
\stoppostponing
\stoptext




On Monday, April 22, 2024 at 02:31:30 AM MDT, Hans Hagen via ntg-context 
 wrote:  
 
 On 4/22/2024 2:45 AM, Joel via ntg-context wrote:
> I'm three days out from sending my work to an editor, and found some 
> serious problem: many footnotes just aren't rendering.
> 
> I have a history text that uses ConTeXt-SBL for the citations, as such, 
> it has lots of footnotes. Sometimes the footnotes are just in the main 
> text, but sometimes also in figure captions, inside floats, inside 
> tables that are inside floats, inside tabulations inside floats, etc.
> 
> What I find alarming is it is frequently not rendering all of the 
> footnote messages at the bottom of the page. The actual footnote number 
> within the body is rendered, but no number is listed in at the bottom of 
> the page. So I might see a list of footnotes, for instance, on page 1, I 
> only get footnotes 1, 2, 3, 5, and 6, but 4 was mysteriously skipped.
> 
> 
> ---
> 1 message
> 2 message
> 3 message
> 5 message
> 6 message
> 
> After a lot of trial-and-error and checking logs and checking my BibTeX 
> files for errors, running everything through BibTex Tidy, etc., and 
> failures to make a minimum working example, I found a single pattern:
> 
> If the footnote marker appears on the SAME page as the footnote text, it 
> has no problem rendering the footnote. But, if ConTeXt decides to move a 
> float a page or two later on--as it frequently seems to do---such that 
> the footnote marker and footnote text at bottom of page should be on 
> DIFFERENT pages, the footnote message at the bottom of the page won't 
> render.
> 
> I've seen some 2+ year old mailing list posts suggesting ConTeXt might 
> have issues with footnotes; they appear to be similar to my issue--is 
> that still a problem? Is there a fix or workaround? Old fixes I could 
> finding in the mailing list don't seem to work with current versions of 
> ConTeXt anymore.
you need to consider the complications of such notes ...

- tex needs to take the notes into account when determining a page break
- it does so by the insert mechanism
- when floats can't be placed they also become inserts (top and bottom)
- when there are inserts in inserts th eproblem becomes more complex (so 
notes inside floats)
- in traditional tex deeply burried inserts disappearm less so in lmtx

There are things that are hard to get right. This works:

\startpostponing
    \startplacefigure[location=here,title={test \footnote{oeps 1}}]
        \blackrule[width=1tw]
        here
        \footnote{hello 1} and
        \footnote{hello 2} and
        \footnote{hello 3} done
    \stopplacefigure
\stoppostponing

\dorecurse{10}{\samplefile{tufte}\par}

Because here the inserts (notes) will migrate but even then one can get 
them out of order (unless we renumber, which then is sensitiev for 
oscillation).

I occasionally wonder if top floats could be done more directly but 
bottom notes still would have an out-of-sync problem




-
                                          Hans Hagen | PRAGMA ADE
              Ridd

[NTG-context] Re: Why don't footnotes appear in floats or figures?

2024-04-22 Thread Hans Hagen via ntg-context

On 4/22/2024 2:45 AM, Joel via ntg-context wrote:
I'm three days out from sending my work to an editor, and found some 
serious problem: many footnotes just aren't rendering.


I have a history text that uses ConTeXt-SBL for the citations, as such, 
it has lots of footnotes. Sometimes the footnotes are just in the main 
text, but sometimes also in figure captions, inside floats, inside 
tables that are inside floats, inside tabulations inside floats, etc.


What I find alarming is it is frequently not rendering all of the 
footnote messages at the bottom of the page. The actual footnote number 
within the body is rendered, but no number is listed in at the bottom of 
the page. So I might see a list of footnotes, for instance, on page 1, I 
only get footnotes 1, 2, 3, 5, and 6, but 4 was mysteriously skipped.



---
1 message
2 message
3 message
5 message
6 message

After a lot of trial-and-error and checking logs and checking my BibTeX 
files for errors, running everything through BibTex Tidy, etc., and 
failures to make a minimum working example, I found a single pattern:


If the footnote marker appears on the SAME page as the footnote text, it 
has no problem rendering the footnote. But, if ConTeXt decides to move a 
float a page or two later on--as it frequently seems to do---such that 
the footnote marker and footnote text at bottom of page should be on 
DIFFERENT pages, the footnote message at the bottom of the page won't 
render.


I've seen some 2+ year old mailing list posts suggesting ConTeXt might 
have issues with footnotes; they appear to be similar to my issue--is 
that still a problem? Is there a fix or workaround? Old fixes I could 
finding in the mailing list don't seem to work with current versions of 
ConTeXt anymore.

you need to consider the complications of such notes ...

- tex needs to take the notes into account when determining a page break
- it does so by the insert mechanism
- when floats can't be placed they also become inserts (top and bottom)
- when there are inserts in inserts th eproblem becomes more complex (so 
notes inside floats)

- in traditional tex deeply burried inserts disappearm less so in lmtx

There are things that are hard to get right. This works:

\startpostponing
\startplacefigure[location=here,title={test \footnote{oeps 1}}]
\blackrule[width=1tw]
here
\footnote{hello 1} and
\footnote{hello 2} and
\footnote{hello 3} done
\stopplacefigure
\stoppostponing

\dorecurse{10}{\samplefile{tufte}\par}

Because here the inserts (notes) will migrate but even then one can get 
them out of order (unless we renumber, which then is sensitiev for 
oscillation).


I occasionally wonder if top floats could be done more directly but 
bottom notes still would have an out-of-sync problem





-
  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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: preventing column break after section title

2024-04-18 Thread Peter Münster
On Thu, Apr 18 2024, Peter Münster wrote:

> How could I prevent a column break after the second section title please?

Ok, found it:

\setupitemize[each][autointro]

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] preventing column break after section title

2024-04-18 Thread Peter Münster
Hi,

How could I prevent a column break after the second section title please?

Minimal example:

\starttext
\startcolumns[n=2]
  \section{title 1}
  \dorecurse{22}{bla\par}
  \section{title 2} % Here starts a new column.
  \startitemize
\dorecurse{15}{\item bla}
  \stopitemize
\stopcolumns
\stoptext

I’ve tried "\setuphead[section][after={\columnbreak[no]}]", but it does
not help.

TIA for any hints,
-- 
   Peter
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Customize citation format of a bibliography (use the short form as reference format)

2024-04-17 Thread Gerion Entrup
Hi,

> The APS style is an example of a number-based citation system. As you
> are looking for a tag-based citation, it might be better to start with
> something like the APA style.

I'm kind of satisfied with the publication-list layout of the APS style so I 
chose
this as a base. If it is simpler to start with the APA style, I can do that.

My hope is that it is possible to just change the "label" that is used for
referencing and keep everything else as is.

> Is there some specification for your short tag-based citation style?

biblatex implements this with the "alphabetic" style. I'm not aware of
a specification, though. Does the "short" form in ConTeXt exist for a
specific reason? :)

Gerion

> On Tue, 16 Apr 2024 06:04:35 +0200
> Gerion Entrup  wrote:
> 
> > Hi,
> > 
> > I'm trying to customize a cite format in a bibliography. Currently,
> > I'm using the aps style which fits so far, except of the plain number
> > as reference. In concrete, I want to change the following:
> > - Use the first letter of the last name and the year as reference
> > (this should be exactly the short form). It is more less also
> > described here [1].
> > - Highlight publications of a certain author with an extra char (e.g.
> > '>')
> > 
> > Here is a minimal example (lets assume, every occurrence of Knuth
> > should be highlighted): ```
> > \setupinteraction[state=start]
> > 
> > \startbuffer[testdata]
> > @Book{knuth1,
> > author = {Donald E. Knuth},
> > title = {TEX and METAFONT. New directions in typesetting},
> > year = {1979},
> > publisher = {Addison-Wesley},
> > }
> > @Article{someother,
> > author = {Some Person and Some Otherperson},
> > title = {Another title},
> > year = {1900},
> > }
> > \stopbuffer
> > 
> > % enable tracing
> > \enabletrackers[publications, publications.crossref,
> > publications.details, publications.cite, publications.strings]
> > 
> > \usebtxdataset[main][testdata.buffer]
> > \usebtxdefinitions[aps]
> > \setupbtx[dataset=main]
> > \definebtxrendering[bibrendering][aps][dataset=main]
> > 
> > % this seems to have no effect?
> > \setupbtx[alternative=short]
> > 
> > \starttext
> > 
> > Knuth developed \TeX \cite[knuth1].
> > Several persons said something \cite[someother].
> > 
> > \placelistofpublications[bibrendering]
> > 
> > \stoptext
> > ```
> > 
> > It should be rendered as:
> > ```
> > Knuth developed TeX [>Knu79].
> > Several persons said something [PO00].
> > 
> > [Knu79] D.E. Knuth, TEX and METAFONT. New directions in
> > typesetting (Addi­son-Wesley, 1979). [PO00] S. Person and S.
> > Otherperson, Another title, (1900). ```
> > 
> > How can I achieve that \cite[something] always renders in the short
> > form by default? How can I customize that references to Knuth contain
> > this extra '>'? How can I customize the APS style to also use the
> > short form in the list of publications instead of numbers?
> > 
> > Best
> > Gerion
> > 
> > [1]
> > https://tex.stackexchange.com/questions/295444/citation-style-with-first-letters-of-authors-lastname



signature.asc
Description: This is a digitally signed message part.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Customize citation format of a bibliography (use the short form as reference format)

2024-04-17 Thread Alan Braslau via ntg-context
Hello,

The APS style is an example of a number-based citation system. As you
are looking for a tag-based citation, it might be better to start with
something like the APA style.

Is there some specification for your short tag-based citation style?

Alan



On Tue, 16 Apr 2024 06:04:35 +0200
Gerion Entrup  wrote:

> Hi,
> 
> I'm trying to customize a cite format in a bibliography. Currently,
> I'm using the aps style which fits so far, except of the plain number
> as reference. In concrete, I want to change the following:
> - Use the first letter of the last name and the year as reference
> (this should be exactly the short form). It is more less also
> described here [1].
> - Highlight publications of a certain author with an extra char (e.g.
> '>')
> 
> Here is a minimal example (lets assume, every occurrence of Knuth
> should be highlighted): ```
> \setupinteraction[state=start]
> 
> \startbuffer[testdata]
> @Book{knuth1,
>   author = {Donald E. Knuth},
>   title = {TEX and METAFONT. New directions in typesetting},
>   year = {1979},
>   publisher = {Addison-Wesley},
> }
> @Article{someother,
>   author = {Some Person and Some Otherperson},
>   title = {Another title},
>   year = {1900},
> }
> \stopbuffer
> 
> % enable tracing
> \enabletrackers[publications, publications.crossref,
> publications.details, publications.cite, publications.strings]
> 
> \usebtxdataset[main][testdata.buffer]
> \usebtxdefinitions[aps]
> \setupbtx[dataset=main]
> \definebtxrendering[bibrendering][aps][dataset=main]
> 
> % this seems to have no effect?
> \setupbtx[alternative=short]
> 
> \starttext
> 
> Knuth developed \TeX \cite[knuth1].
> Several persons said something \cite[someother].
> 
> \placelistofpublications[bibrendering]
> 
> \stoptext
> ```
> 
> It should be rendered as:
> ```
> Knuth developed TeX [>Knu79].
> Several persons said something [PO00].
> 
> [Knu79]   D.E. Knuth, TEX and METAFONT. New directions in
> typesetting (Addi­son-Wesley, 1979). [PO00]   S. Person and S.
> Otherperson, Another title, (1900). ```
> 
> How can I achieve that \cite[something] always renders in the short
> form by default? How can I customize that references to Knuth contain
> this extra '>'? How can I customize the APS style to also use the
> short form in the list of publications instead of numbers?
> 
> Best
> Gerion
> 
> [1]
> https://tex.stackexchange.com/questions/295444/citation-style-with-first-letters-of-authors-lastname



-- 
Alan Braslau
816 West Mountain Avenue
Fort Collins, CO 80521 USA
mobile: (970) 237-0957

Conserve energy! ;-)
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Customize citation format of a bibliography (use the short form as reference format)

2024-04-15 Thread Gerion Entrup
Hi,

I'm trying to customize a cite format in a bibliography. Currently, I'm using 
the aps style which fits so far, except of the plain number as reference.
In concrete, I want to change the following:
- Use the first letter of the last name and the year as reference (this should 
be exactly the short form). It is more less also described here [1].
- Highlight publications of a certain author with an extra char (e.g. '>')

Here is a minimal example (lets assume, every occurrence of Knuth should be 
highlighted):
```
\setupinteraction[state=start]

\startbuffer[testdata]
@Book{knuth1,
author = {Donald E. Knuth},
    title = {TEX and METAFONT. New directions in typesetting},
year = {1979},
publisher = {Addison-Wesley},
}
@Article{someother,
author = {Some Person and Some Otherperson},
    title = {Another title},
year = {1900},
}
\stopbuffer

% enable tracing
\enabletrackers[publications, publications.crossref, publications.details, 
publications.cite, publications.strings]

\usebtxdataset[main][testdata.buffer]
\usebtxdefinitions[aps]
\setupbtx[dataset=main]
\definebtxrendering[bibrendering][aps][dataset=main]

% this seems to have no effect?
\setupbtx[alternative=short]

\starttext

Knuth developed \TeX \cite[knuth1].
Several persons said something \cite[someother].

\placelistofpublications[bibrendering]

\stoptext
```

It should be rendered as:
```
Knuth developed TeX [>Knu79].
Several persons said something [PO00].

[Knu79] D.E. Knuth, TEX and METAFONT. New directions in typesetting 
(Addi­son-Wesley, 1979).
[PO00]  S. Person and S. Otherperson, Another title, (1900).
```

How can I achieve that \cite[something] always renders in the short form by 
default?
How can I customize that references to Knuth contain this extra '>'?
How can I customize the APS style to also use the short form in the list of 
publications instead of numbers?

Best
Gerion

[1] 
https://tex.stackexchange.com/questions/295444/citation-style-with-first-letters-of-authors-lastname

signature.asc
Description: This is a digitally signed message part.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] \getmarking for top at the current page

2024-04-15 Thread Biblio--- via ntg-context
Dear list,

I've got a problem. Not the first one, but the first one to contribute to the 
list. ;)

system> ConTeXt  ver: 2024.04.01 08:59 LMTX  fmt: 2024.4.12  int: 
english/english
system> 'cont-new.mkxl' loaded

%==
%==
\definehead[Datum][subsubsubject]

\startsetups[Test]
  Pr=(\getmarking[Datum][previous])~
  Nx=(\getmarking[Datum][next])~
  Fi=(\getmarking[Datum][first])~
  La=(\getmarking[Datum][last])~
  Tp=(\getmarking[Datum][top])~
  Bt=(\getmarking[Datum][bottom])~
  Cu=(\getmarking[Datum][current])~
\stopsetups

\setupheadertexts[text]
  [\setups{Test}][]
  [\setups{Test}][]

\setuppagenumbering[location=footer]

\starttext

\startDatum[title={secA}]%

  \dorecurse{50}{aaa }

  \pagebreak
 
  \dorecurse{50}{aaa }

\stopDatum

\startDatum[title={secB}]%

  \dorecurse{630}{bbb }

\stopDatum

\startDatum[title={secC}]%

  \dorecurse{50}{ccc }

\stopDatum

\startDatum[title={secD}]%

  \dorecurse{50}{ddd }

\stopDatum

\startDatum[title={secE}]%

  \dorecurse{50}{eee }

\stopDatum


\stoptext
%==
%==


I'd like to write the marking of the very first text at the current page to the 
header. That seems to be a bit tricky, at least for me. (I'm afraid that 
\getmarking[xxx][top] was intended for that and it is not feasible at all.)

At page 1 the header should read "secA", at page 2 again "secA" (because the 
very first text belongs to "secA"), and at page 3 "secC" (because the very 
first text (the section title) belongs to "secC"). Unfortunatly \getmarking[][] 
does not behave like I expacted.

I understand the keywords of \getmarking in the wiki 
(https://wiki.contextgarden.net/Command/getmarking) as listed below:
• previous: marking at the bottom of the page BEFORE the current page (no page 
before then empty)
• next: marking at the top of the page AFTER the current page (no page after 
then bottom of current page)

• top: marking at the top of the current page
• bottom: marking at the bottom of the current page

• first: first marking that starts at the current page (no first than behaving 
like top)
• last: last marking that starts at the current page (no last than behaving 
like bottom)

• current: last stored marking while deciding on pagebreaking between the 
current page and the (potential) following page
• default: first

According to these thoughts, I started with \getmarking[Datum][top]. But "top" 
seems not to work, there is no difference between "top" and "first", "top" 
behaves like "first".

My second thought: Generally \getmarking[Datum][first] would be perfect, so 
I've thought something like

    \doifelse{\fetchmark[Datum][next] of the page before the current 
page}{\fetchmark[Datum][previous]}
      {\getmarking[Datum][previous]}
      {\getmarking[Datum][first]}

could work. (Honestly I don't know how to do "\fetchmark[Datum][next] of the 
page before the current page}". The first page would need a special treatment 
too.)

But: At page 2 \getmarking[Datum][next] (Nx) contains "secB" but at top of page 
3 is not "secB" but "secC". So \getmarking[Datum][next] does not seem to 
contain the correct information I need, therefore I don't get any further.


Any ideas: How do I write the marking of the very first text at the current 
page to the header?


Thank you in advance, Matthias

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: how to apply metapost effects to section title?

2024-04-09 Thread Wolfgang Schuster

seyal.zav...@gmail.com schrieb am 09.04.2024 um 14:53:

i want to produce a gradient header
i tried this code but it does not produce any result:

\startext
\def\Mystyle#1{\startMPcode
   picture tt ; tt := lmt_outline [
   kind = "path",
   text = "#1",
   ] ;
   fill
   for i within tt : pathpart i && endfor cycle
  withshademethod "linear"
  withshadedirection up
  withshadecolors (red, blue) ;
\stopMPcode
}

\definehead[Myhead][section]
\setuphead[Myhead][
   style=\Mystyle,
]
\startMyhead[title=sample] a sample text \stopMyhead
\stoptext


You can't use commands with parameters as argument for the style key.

To format single parts (number or title) of a section title you have to 
apply a command to the "deep...command" key but even then you have to 
make manual changes to the vertical alignment of the text.


 begin example
\starttexdefinition spaces Mystyle #1
  \setbox\scratchboxone\hbox{#1}%
  \setbox\scratchboxtwo\hbox\bgroup
\startMPcode
  picture tt ; tt := lmt_outline [
kind = "path",
text = "#1",
  ];
fill
  for i within tt : pathpart i && endfor cycle
  withshademethod "linear"
  withshadedirection up
  withshadecolors (red, blue) ;
\stopMPcode
  \egroup
  \boxyoffset\scratchboxtwo-\dp\scratchboxone
  \box\scratchboxtwo
\stoptexdefinition

\starttext

\setuphead
  [section]
  [
 deeptextcommand=\Mystyle,
%  deepnumbercommand=\Mystyle,
  ]

\startsection[title=Lorem ipsum]
\samplefile{lorem}
\stopsection

\stoptext
 end example


and the code below works but does not colorize numbers of this heads:
\starttext
 
\def\Mystyle#1{\startMPcode

   picture tt ; tt := lmt_outline [
   kind = "path",
   text = "#1",
   ] ;
   fill
   for i within tt : pathpart i && endfor cycle
  withshademethod "linear"
  withshadedirection up
  withshadecolors (red, blue) ;
\stopMPcode
}
     
\def\startMysection#1{\startsection[title=\Mystyle{#1}]}

\def\stopMysection{\stopsection}
 
\startMysection{hello}

what is best method?
\stopMysection
     
\stoptext


what is your suggestion?


To apply the format the the complete section title you have to create 
your own style and apply it with the "command" key, to get the number 
and title for the current section use the \structurenumber and 
\structuretitle macros.


 begin example
\starttexdefinition spaces protected Mystyle #1#2
  \startMPcode
picture tt ; tt := lmt_outline [
  kind = "path",
  text = "\structurenumber\space\structuretitle",
];
  fill
for i within tt : pathpart i && endfor cycle
withshademethod "linear"
withshadedirection up
withshadecolors (red, blue) ;
  \stopMPcode
\stoptexdefinition

\starttext

\setuphead
  [section]
  [command=\Mystyle]

\startsection[title=Lorem ipsum]
\samplefile{lorem}
\stopsection

\stoptext
 end example

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] how to apply metapost effects to section title?

2024-04-09 Thread seyal . zavira
i want to produce a gradient header
i tried this code but it does not produce any result:

\startext
\def\Mystyle#1{\startMPcode
  picture tt ; tt := lmt_outline [
  kind = "path",
  text = "#1",
  ] ;
  fill
  for i within tt : pathpart i && endfor cycle
 withshademethod "linear"
 withshadedirection up
 withshadecolors (red, blue) ;
\stopMPcode
}

\definehead[Myhead][section]
\setuphead[Myhead][
  style=\Mystyle,
]
\startMyhead[title=sample] a sample text \stopMyhead
\stoptext

and the code below works but does not colorize numbers of this heads:
\starttext  



\def\Mystyle#1{\startMPcode 

  picture tt ; tt := lmt_outline [  

  kind = "path",

  text = "#1",  

  ] ;   

  fill  

  for i within tt : pathpart i && endfor cycle  

 withshademethod "linear"   

 withshadedirection up  

 withshadecolors (red, blue) ;  

\stopMPcode 

}   


    
\def\startMysection#1{\startsection[title=\Mystyle{#1}]}

\def\stopMysection{\stopsection}



\startMysection{hello}  

what is best method?

\stopMysection  



\stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: last page number for a list

2024-04-03 Thread Wolfgang Schuster

Alan Bowen schrieb am 30.03.2024 um 20:59:

How can I get the last page number of a chapter for a list (ToC)?

Outside of a list, I use \lastpagenumber.
But that does not work in a list such as the ToC.

Any tips or pointers will be gladly received.


You can try this:

\definepagestate[alanpage]
\definecounter  [alanindex]

\setuphead
  [chapter]
  [insidesection={\setpagestate[alanpage]},
   aftersection={\setpagestate[alanpage]}]

\setuphead
  [title]
  [insidesection=,
   aftersection=]

\define[1]\ChapterListPage

{\pagestaterealpage{alanpage}{\number\numexpr\incrementedcounter[alanindex]\relax}%
   \thinspace --\thinspace

\pagestaterealpage{alanpage}{\number\numexpr\incrementedcounter[alanindex]\relax}}

\setuplist[chapter][pagecommand=\ChapterListPage]
\setuplist[chapter][pagecommand=\ChapterListPage]

\showgrid

\starttext

\completecontent

\startchapter [title=Knuth]
\dorecurse{12}{\samplefile{knuth}}
\stopchapter

\startchapter [title=Zapf]
\dorecurse{12}{\samplefile{zapf}}
\stopchapter

\stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: last page number for a list

2024-04-03 Thread Alan Bowen
Hi, Bruce—
This does not quite work—the page numbers are those of the first page of
the chapter, not the last. But thanks for the tip about \writetolist.
Perhaps I can get that to work.

What I need are ToC entries like
AuthorName
ShortTitle   1–6

I need this pagination because one of the requirements of continuous
publication on the OJS is that once an item is published changes are not
permitted. So I cannot go with normal continuous publication since, for us
anyway, items are not processed in strict sequential order (e,g., we may
have, paper+paper+ review+paper...)

If it helps: I currently have

\startFMTitle[reference=\Reference, title={}][itemAuthor=AuthorName,
itemTitle=ShortTitle,...]
\setuplist[FMTitle][state=start, alternative=startendfmpages,
criterium=all,]
(\Reference is defined at the in the preamble to input of the
file/component.)

\definelistalternative[startendfmpages][renderingsetup=list:startendfmpages]

\startsetups[list:startendfmpages]
  \structurelistuservariable{itemAuthor}\crlf
  \structurelistuservariable{itemTitle}\hfill%
   \at[\currentlistentrypagenumber]–\at[\lastpagenumber]
\vglue1pc
\stopsetups
where I have \reference[\lastpagenumber]{} at the end of the file. But this
gives me ??–viii (the viii is correct and interactive) for the FMTitle.
Sadly the entries for all my other Titles (SourceTitle, StudyTitle...) is
??–viii.
(Each title is a modified chapter.)

Curiously, \at[\Reference]–\convertnumber{r}{\lastpagenumber}  and
\at[\Reference]–\at[\lastpagenumber] work properly in the body text.
The overall structure is project-product sort with many components in the
product.

This is probably TMI. The bottom line is that I am truly stumped.

All best,
Alan

On Wed, Apr 3, 2024 at 6:56 AM Bruce Horrocks  wrote:

>
>
> > On 30 Mar 2024, at 19:59, Alan Bowen  wrote:
> >
> > How can I get the last page number of a chapter for a list (ToC)?
> >
> > Outside of a list, I use \lastpagenumber.
> > But that does not work in a list such as the ToC.
> >
> > Any tips or pointers will be gladly received.
>
>
> I'm not quite sure what you want to do with these numbers: something like
> printing out a contents page but instead of the start page of a chapter it
> shows the last page of the chapter?
>
> If so then try creating a custom list and use \writetolist immediately
> before each \stopchapter command?
>
> \definelist[LastPages][criterium=all]
> \starttext
> \completecontent
> \page
> \completelist[LastPages]
> \page
> \dorecurse{10}{
>   \startchapter[title={This is my chapter}]
>   This is a chapter\par \dorecurse{6}{\input knuth } \input
> math-kontinuitet-sv
>
>   \writetolist[LastPages]{3.}{\namedstructurevariable{chapter}{title}}
>   \stopchapter
> }
> \stoptext
>
> But I can't get the number option of \writetolist to work - the "3." above
> is ignored. :-(
>
> —
> 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 /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: last page number for a list

2024-04-03 Thread Bruce Horrocks


> On 30 Mar 2024, at 19:59, Alan Bowen  wrote:
> 
> How can I get the last page number of a chapter for a list (ToC)?
> 
> Outside of a list, I use \lastpagenumber. 
> But that does not work in a list such as the ToC.
> 
> Any tips or pointers will be gladly received.


I'm not quite sure what you want to do with these numbers: something like 
printing out a contents page but instead of the start page of a chapter it 
shows the last page of the chapter?

If so then try creating a custom list and use \writetolist immediately before 
each \stopchapter command?

\definelist[LastPages][criterium=all]
\starttext
\completecontent
\page
\completelist[LastPages]
\page
\dorecurse{10}{
  \startchapter[title={This is my chapter}]
  This is a chapter\par \dorecurse{6}{\input knuth } \input math-kontinuitet-sv

  \writetolist[LastPages]{3.}{\namedstructurevariable{chapter}{title}}
  \stopchapter
}
\stoptext

But I can't get the number option of \writetolist to work - the "3." above is 
ignored. :-(

—
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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: OT: San Seriffe

2024-04-01 Thread Keith McKay

Shurely Shome Mishtake. It should be grauniad_sans!

https://wordhistories.net/2017/06/05/origin-of-grauniad/

Keith

On 01/04/2024 15:45, Henning Hraban Ramm wrote:

Am 01.04.24 um 16:34 schrieb Hans Hagen via ntg-context:

On 4/1/2024 3:56 PM, Henning Hraban Ramm wrote:

in honour of Knuth and the current occasion:
https://realdougwilson.com/writing/san-serriffe

the subject title suggest that you found an open type version


Well, I found one, but it‘s not free:
https://commercialtype.com/catalog/guardian_sans

Hraban

___ 

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


maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net 
(mirror)

archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___ 


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: OT: San Seriffe

2024-04-01 Thread Henning Hraban Ramm

Am 01.04.24 um 16:34 schrieb Hans Hagen via ntg-context:

On 4/1/2024 3:56 PM, Henning Hraban Ramm wrote:

in honour of Knuth and the current occasion:
https://realdougwilson.com/writing/san-serriffe

the subject title suggest that you found an open type version


Well, I found one, but it‘s not free:
https://commercialtype.com/catalog/guardian_sans

Hraban

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: OT: San Seriffe

2024-04-01 Thread Hans Hagen via ntg-context

On 4/1/2024 3:56 PM, Henning Hraban Ramm wrote:

in honour of Knuth and the current occasion:
https://realdougwilson.com/writing/san-serriffe

the subject title suggest that you found an open type version

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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] context editor support / syntax highlighting for Pulsar

2024-04-01 Thread Henning Hraban Ramm
"
local blob = found ~= "" and io.loaddata(found) or ""
if blob == ""  then
report("category: %s, filename: %s, not 
found",category,filename)
else
done = done + 1
report("category: %s, filename: %s, 
merged",category,filename)
end
return format("; category: %s\n; filename: 
%s\n%s\n\n",category,filename,blob)
end)
end
    if done > 0 then
report("saving '%s' (%s files merged)",destinationdata,done)
io.savedata(destinationdata,data)
else
report("skipping '%s' (no files merged)",destinationdata)
end
end
local templatename = "textpad-context-template.txt"
local templatedata = resolvers.findfile(templatename) or ""
if templatedata == "" then
report("unable to locate template '%s'",templatename)
else
merge(templatedata, "context.syn",   { "tex commands","context 
commands" })
if environment.argument("textpad") == "latex" then
merge(templatedata, "context-latex.syn", { "tex 
commands","context commands", "latex commands" })
end
end
local r = { }
local c = io.loaddata("context-commands-en.txt") or "" -- sits on 
the same path
local e = io.loaddata("context-environments-en.txt") or "" -- sits on 
the same path
for s in gmatch(c,"\\(.-)%s") do
r[#r+1] = format("\n!TEXT=%s\n\\%s\n!",s,s)
end
for s in gmatch(e,"\\start(.-)%s+\\stop(.-)") do
r[#r+1] = format("\n!TEXT=%s (start/stop)\n\\start%s 
\\^\\stop%s\n!",s,s,s)
end
sort(r)
insert(r,1,"!TCL=597,\n!TITLE=ConTeXt\n!SORT=N\n!CHARSET=DEFAULT")
io.savedata("context.tcl",concat(r,"\n"))
-- cleanup
os.remove("context-commands-en.txt")
os.remove("context-environments-en.txt")
end
end

function scripts.interface.editor(editor,split,forcedinterfaces)
require("char-def")

local interfaces = forcedinterfaces or environment.files or userinterfaces
if not interfaces.en then
-- loaded as script so we have "cont-yes.*" as name
interfaces = { "en" }
end
--
 -- local filename = "i-context.xml"
local filename = "context-en.xml"
local xmlfile  = resolvers.findfile(filename) or ""
if xmlfile == "" then
report("unable to locate %a",filename)
return
end
--
local filename = "mult-def.lua"
local deffile  = resolvers.findfile(filename) or ""
if deffile == "" then
report("unable to locate %a",filename)
return
end
local interface = dofile(deffile)
if not interface or not next(interface) then
report("invalid file %a",filename)
return
end
local variables = interface.variables
local constants = interface.constants
local commands  = interface.commands
local elements  = interface.elements
--
local collected = { }
--
report("generating files for %a",editor)
report("loading %a",xmlfile)
local xmlroot = xml.load(xmlfile)
 -- xml.include(xmlroot,"cd:interfacefile","filename",true,function(s)
 -- local fullname = resolvers.findfile(s)
 -- if fullname and fullname ~= "" then
 -- report("including %a",fullname)
 -- return io.loaddata(fullname)
 -- end
 -- end)
 -- local definitions = { }
 -- for e in xml.collected(xmlroot,"cd:interface/cd:define") do
 -- definitions[e.at.name] = e.dt
 -- end
 -- local function resolve(root)
 -- for e in xml.collected(root,"*") do
 -- if e.tg == "resolve" then
 -- local resolved = definitions[e.at.name or ""]
 -- if resolved then
 -- -- use proper replace helper
 -- e.__p__.dt[e.ni] = resolved
 -- resolved.__p__ = e.__p__
 -- resolve(resolved)
 -- end
 -- end
 -- end
 -- end
 -- resolve(xmlroot)

-- todo: use sequence

for i=1,#interfaces do
local interface  = interfaces[i]
local i_commands = { }
local i_environments = { }
local start = elements.start[interface] or elements.start.en
l

[NTG-context] start/end pages in ToC

2024-03-26 Thread Alan Bowen
Our journal is currently in the process of moving to continuous publication
of items in a given volume as they are ready. This entails re-jigging the
ToC so that it now includes the start and end page numbers of each item. So
far, I have everything pretty much in the right place, but for the page
numbers I am getting only “??”. I am not sure why this is happening and
would be grateful if someone could tell me why or point me to
documentation that explains the problem and how to solve it.

Many thanks in advance.

My minimalish working example:

\definehead[SourceTitle][chapter]
\setuphead[SourceTitle][page=yes,
footer={ItemData}]

\definehead[StudyTitle][chapter]
\setuphead[StudyTitle][page=yes,
footer={ItemData}]

\definetext[ItemData][footer][
{\at[\Reference]–
\at[\namedstructureuservariable{}{authorInitials}endPage]}
]
\setuplist[SourceTitle][
state=start,
textcolor=black,
alternative=startendpages,
criterium=all,
headnumber=no,
interaction=page,
numberalign=flushright,
before={\blank[2.2ex, fixed]},
inbetween=\endgraf,
]

\setuplist[StudyTitle][
state=start,
textcolor=black,
alternative=startendpages,
criterium=all,
headnumber=no,
interaction=all,
numberalign=flushright,
before={\blank[2.2ex, fixed]},
inbetween=\endgraf,
]

\define\ToCEntry{%
\structurelistuservariable{author}\crlf
\structurelistuservariable{title}\hfill%
\at[\structurelistuservariable{reference}]–%
\at[\structurelistuservariable{authorInitials}endPage]
}

\definelistalternative[startendpages]
[renderingsetup=list:startendpages]

\startsetups[list:startendpages]
{\ToCEntry}
\vglue1pc
\stopsetups

\starttext

{\tfa\bf Contents}

\blank[line, fixed]
\WORD{Sources}
\blank[halfline, fixed]
\placelist[SourceTitle][criterium=all]

\blank[line, fixed]
\WORD{Studies}
\blank[halfline, fixed]
\placelist[StudyTitle][criterium=all]

\page[makeup]

\setnumber[userpage][1]
\def\Reference{RefSo01}
\startSourceTitle[reference={\Reference},
bookmark=Source01,
title={}][
title=Source01,
author=Author01,
authorInitials=ABC,
reference={\Reference},
]
\input knuth
\page
\dorecurse{25}{\input ward\par}
\reference[ABCendPage]{}
\stopSourceTitle
\page[makeup]

\setnumber[userpage][1]
\def\Reference{RefSo02}
\startSourceTitle[reference={\Reference},
bookmark=Source02,
title={}][
author=Author02,
title=Source02,
authorInitials=PQR,
reference={\Reference},
]

\input knuth
\page
\dorecurse{10}{\input ward\par}
\reference[PQRendPage]{}
\stopSourceTitle
\page[makeup]

\setnumber[userpage][1]
\def\Reference{RefSt01}
\startStudyTitle[reference={\Reference},
bookmark=Study01,
title={}][
author=Author03,
title=Study01,
authorInitials=XYZ,
reference={\Reference},
]
\input knuth
\blank[big]
\page
\dorecurse{15}{\input ward\par}
\reference[XYZendPage]{}
\stopStudyTitle
\page[makeup]
\stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Struggling with the distance and right margin text

2024-03-22 Thread Ursula Hermann
Dear Pablo,


Many thanks for your example. Sorry for writing so late.

At least I found out, how it works for me .  This is the best way.


\setuppapersize[A8,landscape]
\setupbodyfont[termes, 12.50pt]
\setuplayout[inrightmargin=5.1cm
 backspace=2.9cm,
 inleftmargin=0cm,width=4cm]
\inrightmargin{\blackrule\\{3.2.2}}\par \dontleavehmode \blackrule
\showframe
\starttext
Me

\stoptext




Von: Pablo Rodriguez via ntg-context 
Gesendet: Freitag, 15. März 2024 20:00:35
An: ntg-context@ntg.nl
Cc: Pablo Rodriguez
Betreff: [NTG-context] Re: Struggling with the distance and right margin text

On 3/15/24 14:06, Ursula Hermann wrote:
> Dear List,

Dear Ursula,

this might help you (it isn’t perfect, but you just seem to copy and
paste fragments from your source files):

  %\showframe\showstruts
  \mainlanguage[de-at]
  \setuppagenumbering[alternative=doublesided]
  \definemargindata  [MyInMargin][ininner]
  \definemarginframed[MyInMargin]
[topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
  \defineframed[topruletitle]
[width=max,
 frame=off,
 topframe=on,
 rulethickness=1pt,
 align={justify},
 extras=\dontleavehmode]
  \starttext
  \topruletitle{\MyInMargin {1.1.1}\bf
  Beispiel 3.2.17. (Vertauschung von All- und Existenzquantor).} \par
  \input knuth\page

  \topruletitle{\MyInMargin{3.2.22}{\bf
  Theorem 3.2.22 (Rechenregeln für Quantoren)}. Seien \m P(\m x)und
\input zapf b}
  \stoptext

Sorry for saying that again, but please elaborate both your minimal
samples and your descriptions of the issues you are experiencing.

Some comments on the code fragments you sent.

First of all, please include always code that can be compiled simply
after being copied and pasted.

This requires \starttext (most of the time) and \stoptext (mandatory to
avoid stupid errors).

> \definepapersize[MyBook][width=19cm,height=29.7cm]
> \setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook
> %\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
> \setupbodyfont[modern, 12.50pt]

If these lines are irrelevant for the issue you are experiencing, please
don’t include them.

> \definemargindata  [MyInMargin][inleft]
> \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]

You define this margin framed, but your sample makes no use of it.

Sorry, but I don’t get it.

> \defineenumeration
>   [theorem]
>   [
> text=Theorem,
> title=yes,
> width=fit,
> distance=0.2em,
> alternative=serried,
>   ]
> \definetextbackground[GrayBackground][
>   location=paragraph,
>   background=color,
>   backgroundcolor=lightgray,
>   leftoffset=.5\bodyfontsize,
>   rightoffset=.5\bodyfontsize,
>   topoffset=.5\bodyfontsize,
>   bottomoffset=.5\bodyfontsize,
>   frame=off,]
>   \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\}
>   \blackrule[color=black, height=0.10ex, width=13.50cm]

If your sample includes no theorem or text background, please remove
these definitions when sending code.

BTW, avoid include text content (such as margin and body rules [but not
their definitions]) before \starttext.

Also, use \clrf instead of \\ (since the mailing list displays the
relevant line as ("\" instead of "\\"):

>   \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\}

Here starts your text:

> \starttext
> \margintext {1.1.1}
> {\bf Beispiel 3.2.17. (Vertauschung von All- und Existenzquantor).} \par

Your margin text is undefined. Your code has a defined margin text
command, but it isn’t used.

> So  I have here an example from the second page:

Sorry, but I’m having the impression you are using ConTeXt as a kind of
command-based DTP software (which I think it isn’t at all).

Or, do you define commands for each page?

I think it is better to define a single margin text command and use a
doublesided page setup.

> \definemargindata[inrightmargin][right][margin=margin,width=.50em\rightmarginwidth,style=,color=]
> \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt, 
> width=.90cm]

Again, margin text commands defined, but never used.

> \blackrule[color=black, height=0.10ex, width=13.40cm]
> {\blackrule[color=black, height=0.10ex, width=1cm, distance=.90cm]\par

Here you open a brace that is not closed at all.

At least, consider that this won’t be extremely readable for other
people (this is only a sample).

It also may be problematic for you, if you leave the source untouched
for some weeks.

> \defineenumeration
>   [theorem]
>   [
> text=Theorem,
> title=yes,
> width=fit,
> distance=0.2em,
> alternative=serried,
>   ]

At least, it would be better not to include a definition inside content
that seems to (or may) be grouped with braces.

BTW, it is exactly t

[NTG-context] Re: Use of marking

2024-03-21 Thread Thomas Meyer

Hi Pablo and Bruce,

thank you very much for your two solutions. That helps me enormously now.

Greetings
Thomas

Am 21.03.24 um 16:34 schrieb Bruce Horrocks:

\startsetups[doc:header]
   \getmarking[chapternumber] \space - \space \getmarking[chapter]
   \space :: \space
   \getmarking[sectionnumber] \space - \space \getmarking[section]
\stopsetups
\setupheadertexts[\setup{doc:header}]

\starttext
\dorecurse{10}{
   \startchapter[title={This is my chapter}]
   This is a chapter\par \dorecurse{6}{\input knuth } \input math-kontinuitet-sv

   \startsection[title={This is my section}]
This is a section\par \dorecurse{6}{\input knuth }\input math-kontinuitet-sv
   \stopsection
   \stopchapter
}
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Use of marking

2024-03-21 Thread Bruce Horrocks


> On 20 Mar 2024, at 18:45, Andres Conrado Montoya  
> wrote:
> 
> 2. As far as I have found, including the chapter/section number in the 
> marking is not really a trivial task. I usually hack something using 
> \headnumber and \getmarking, like so: 

You can do the following:

\startsetups[doc:header]
  \getmarking[chapternumber] \space - \space \getmarking[chapter]
  \space :: \space
  \getmarking[sectionnumber] \space - \space \getmarking[section]
\stopsetups
\setupheadertexts[\setup{doc:header}]

\starttext
\dorecurse{10}{
  \startchapter[title={This is my chapter}]
  This is a chapter\par \dorecurse{6}{\input knuth } \input math-kontinuitet-sv

  \startsection[title={This is my section}]
   This is a section\par \dorecurse{6}{\input knuth }\input math-kontinuitet-sv
  \stopsection
  \stopchapter
}
\stoptext

Caveat: it needs an if...then test around the section number for when a section 
hasn't started.
—
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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Use of marking

2024-03-20 Thread Andres Conrado Montoya
As I understand, Thomas needs a layout in which the header shows something
like

1. Chapter title -- 1.1. Section title (including the numbers! *This is the
important bit!*)

There are a couple things about this:

1. In a section (part, chapter, section, etc.) you can introduce three
versions of the title for that section. title= is the general one and if
nothing else is specified, this will be used in markings (headers or footer
or wherever you want to put therm) and in listings (contents). If you give
those arguments, marking= and listing=, you will get those texts in those
places: marking= on markings (you can call them with \getmarking) and
listing= in the table of contents.

2. As far as I have found, including the chapter/section number in the
marking is *not really a trivial task*. I usually hack something using
\headnumber and \getmarking, like so:

\setuppagenumbering[alternative=doublesided,location=,]

\setupheadertexts[{\headnumber[section].~\getmarking[section]}---{\headnumber[chapter].~\getmarking[chapter]}]
\setupfootertexts[][pagenumber][pagenumber][]
\setuphead[chapter][header=high]

\starttext
\dorecurse{10}{
  \startchapter[title={This is my chapter}]
  This is a chapter\par \dorecurse{6}{\input knuth } \input
math-kontinuitet-sv

  \startsection[title={This is my section}]
   This is a section\par \dorecurse{6}{\input knuth }\input
math-kontinuitet-sv
  \stopsection
  \stopchapter
}
\stoptext

But with a caveat: the `header=high` setting in setuphead for the chapter
needs to be included, or you will get a section number in the first page,
even if there is no section. I have not found a better mechanism yet, but
I'm quite sure there is a correct solution for this... I just haven't found
it yet. Checking for the presence of \getmarking[section] with
\doifsomething does not work, or I could not make it work.

A little bit more info here:
https://wiki.contextgarden.net/Command/getmarking
https://wiki.contextgarden.net/Command/headnumber


El mié, 20 mar 2024 a las 9:23, Hraban Ramm () escribió:

> \setupheadtext[de][section=Aufgabe]
> Rename the section, then you don’t need marking.
>
> Sorry, I'm in a hurry and must look up how to get the number…
>
>
> Am 20.03.24 um 12:18 schrieb Thomas Meyer:
>
> Hi Hraban,
>
> and thanks.
>
> setuphead[chapter,section][numberwidth=2em] or "fit"
> works!
>
> I know \setupheadertexts, but do not know what shall I write here:
> \startsection[titel=Aufgabe, marking=?]
> If I write marking=Aufgabe I get Aufgabe, no number! For chapter the same.
>
> \setupheadertexts
>[] [{\getmarking[chapter]} - {\getmarking[section]}]
> [{\getmarking[chapter]} - {\getmarking[section]}] []
> > Kapitel - Aufgabe
>
>
> Thanks in advance
> Greetings
> Thomas
>
>
> Am 20.03.24 um 09:09 schrieb Hraban Ramm:
>
>
> Am 20.03.24 um 08:18 schrieb Thomas Meyer:
>
> HI folks,
>
> yesterday while reading along I learned how to suppress the chapter
> numbers in sections. That was something I was looking for myself.
>
> But how do you use marking correctly in startsection? I would like to see
> "1. Kapitel - 1. Aufgabe" in the header on the right. How can I automate
> this with marking?
> And how can I reduce the space between the number (1.) and the title
> (Kapitel or Aufgabe)?
>
> Thanks for your help
> Thomas
>
> Hi Thomas,
>
> do you know how to use \setupheadertexts?
>
> https://wiki.contextgarden.net/Command/setupheadertexts
>
> I guess you're using the section level for "Aufgabe"?
>
> Then something like {\getmarking{chapter} – \getmarking{section}} might
> fit your request.
>
> The formatting should be possible with
> \setuphead[chapter,section][numberwidth=2em] or "fit".
>
> Hraban
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
>
>
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>

[NTG-context] Re: Use of marking

2024-03-20 Thread Hraban Ramm

\setupheadtext[de][section=Aufgabe]
Rename the section, then you don’t need marking.

Sorry, I'm in a hurry and must look up how to get the number…

Am 20.03.24 um 12:18 schrieb Thomas Meyer:

Hi Hraban,

and thanks.

setuphead[chapter,section][numberwidth=2em] or "fit"
works!

I know \setupheadertexts, but do not know what shall I write here:
\startsection[titel=Aufgabe, marking=?]
If I write marking=Aufgabe I get Aufgabe, no number! For chapter the same.

\setupheadertexts
   [] [{\getmarking[chapter]} - {\getmarking[section]}] 
[{\getmarking[chapter]} - {\getmarking[section]}] []

> Kapitel - Aufgabe


Thanks in advance
Greetings
Thomas


Am 20.03.24 um 09:09 schrieb Hraban Ramm:



Am 20.03.24 um 08:18 schrieb Thomas Meyer:

HI folks,

yesterday while reading along I learned how to suppress the chapter 
numbers in sections. That was something I was looking for myself.


But how do you use marking correctly in startsection? I would like 
to see "1. Kapitel - 1. Aufgabe" in the header on the right. How can 
I automate this with marking?
And how can I reduce the space between the number (1.) and the title 
(Kapitel or Aufgabe)?


Thanks for your help
Thomas


Hi Thomas,

do you know how to use \setupheadertexts?

https://wiki.contextgarden.net/Command/setupheadertexts

I guess you're using the section level for "Aufgabe"?

Then something like {\getmarking{chapter} – \getmarking{section}} 
might fit your request.


The formatting should be possible with 
\setuphead[chapter,section][numberwidth=2em] or "fit".


Hraban


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

maillist :ntg-context@ntg.nl  
/https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  :https://www.pragma-ade.nl  /https://context.aanhet.net  (mirror)
archive  :https://github.com/contextgarden/context
wiki :https://wiki.contextgarden.net
___



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

maillist :ntg-context@ntg.nl  
/https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  :https://www.pragma-ade.nl  /https://context.aanhet.net  (mirror)
archive  :https://github.com/contextgarden/context
wiki :https://wiki.contextgarden.net
__
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Use of marking

2024-03-20 Thread Thomas Meyer

Hi Hraban,

and thanks.

setuphead[chapter,section][numberwidth=2em] or "fit"
works!

I know \setupheadertexts, but do not know what shall I write here:
\startsection[titel=Aufgabe, marking=?]
If I write marking=Aufgabe I get Aufgabe, no number! For chapter the same.

\setupheadertexts
   [] [{\getmarking[chapter]} - {\getmarking[section]}] 
[{\getmarking[chapter]} - {\getmarking[section]}] []

> Kapitel - Aufgabe


Thanks in advance
Greetings
Thomas


Am 20.03.24 um 09:09 schrieb Hraban Ramm:



Am 20.03.24 um 08:18 schrieb Thomas Meyer:

HI folks,

yesterday while reading along I learned how to suppress the chapter 
numbers in sections. That was something I was looking for myself.


But how do you use marking correctly in startsection? I would like to 
see "1. Kapitel - 1. Aufgabe" in the header on the right. How can I 
automate this with marking?
And how can I reduce the space between the number (1.) and the title 
(Kapitel or Aufgabe)?


Thanks for your help
Thomas


Hi Thomas,

do you know how to use \setupheadertexts?

https://wiki.contextgarden.net/Command/setupheadertexts

I guess you're using the section level for "Aufgabe"?

Then something like {\getmarking{chapter} – \getmarking{section}} 
might fit your request.


The formatting should be possible with 
\setuphead[chapter,section][numberwidth=2em] or "fit".


Hraban


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

maillist :ntg-context@ntg.nl  
/https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  :https://www.pragma-ade.nl  /https://context.aanhet.net  (mirror)
archive  :https://github.com/contextgarden/context
wiki :https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Use of marking

2024-03-20 Thread Hraban Ramm


Am 20.03.24 um 08:18 schrieb Thomas Meyer:

HI folks,

yesterday while reading along I learned how to suppress the chapter 
numbers in sections. That was something I was looking for myself.


But how do you use marking correctly in startsection? I would like to 
see "1. Kapitel - 1. Aufgabe" in the header on the right. How can I 
automate this with marking?
And how can I reduce the space between the number (1.) and the title 
(Kapitel or Aufgabe)?


Thanks for your help
Thomas


Hi Thomas,

do you know how to use \setupheadertexts?

https://wiki.contextgarden.net/Command/setupheadertexts

I guess you're using the section level for "Aufgabe"?

Then something like {\getmarking{chapter} – \getmarking{section}} might 
fit your request.


The formatting should be possible with 
\setuphead[chapter,section][numberwidth=2em] or "fit".


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Use of marking

2024-03-20 Thread Thomas Meyer

HI folks,

yesterday while reading along I learned how to suppress the chapter 
numbers in sections. That was something I was looking for myself.


But how do you use marking correctly in startsection? I would like to 
see "1. Kapitel - 1. Aufgabe" in the header on the right. How can I 
automate this with marking?
And how can I reduce the space between the number (1.) and the title 
(Kapitel or Aufgabe)?


Thanks for your help
Thomas

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Adjusted Chapter Headings

2024-03-19 Thread Wolfgang Schuster

Jeroen schrieb am 19.03.2024 um 12:59:
I have some style adjustments for the chapters. The chapter "numbers" 
need to be Boek I, Boek II, etc. A vertical separator was introduced 
with an inframe. The chapter title at the right side does not vertically 
align properly with the chapter number in the frame (inside the frame is 
vertically centered, the title not). Is there a way to align the chapter 
title with the chapter number?




\starttexdefinition MyNumberChapterCommand #1
     \inframed[frame=off,rightframe=on,framecolor=black,
      rulethickness=1px,height=30pt]{#1\enspace}
\stoptexdefinition

\setuphead[chapter][style={\bfc},numbercommand=\MyNumberChapterCommand,
     page=no]


\define[2]\MyNumberChapterCommand
  {#1\space\blackrule[width=1pt,height=22pt,depth=8pt]\space#2}

\setuphead
  [chapter]
  [   page=no,
   command=\MyNumberChapterCommand,
 style=\bfc]

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Adjusted Chapter Headings

2024-03-19 Thread Jeroen
I have been able to achieve it as following, but the first frame width is
fixed so will cause problems with other chapter numbers such as VIII


\unexpanded\def\HeadTitle#1#2%
{\hbox to \hsize \bgroup
\hfill
\setupframed[offset=.5em,frame=off]
\tbox{\framed[width=22mm,align=right]{#1}}%
\tbox{\framed[width=130mm,align=right,leftframe=on,
rulethickness=0.8pt]{#2}}%
\egroup}

\setuplabeltext[chapter=Boek~]

\setuphead[chapter][style={\bfc}, command=\HeadTitle, textstyle=bold]

...

\startchapter
  [title={Algemene Beginselen},
   ownnumber={I}]

Op di 19 mrt 2024 om 15:49 schreef Hraban Ramm :

> Hi Jeroen,
>
> it might make sense to use
>
> \setuphead[chapter][
>   conversion=R,
> ]
> \setuplabeltext[nl][chapter={Boek }]
>
> instead of ownnumber.
>
> I would use one command for number and title and put both in the same kind
> of frame. Probably you should use a \strut in the text or
> \inframed[strut=yes] to assure the same text height.
>
> HTH, Hraban
> Am 19.03.24 um 12:59 schrieb Jeroen:
>
> I have some style adjustments for the chapters. The chapter "numbers" need
> to be Boek I, Boek II, etc. A vertical separator was introduced with an
> inframe. The chapter title at the right side does not vertically align
> properly with the chapter number in the frame (inside the frame is
> vertically centered, the title not). Is there a way to align the chapter
> title with the chapter number?
>
>
>
> \starttexdefinition MyNumberChapterCommand #1
> \inframed[frame=off,rightframe=on,framecolor=black,
>  rulethickness=1px,height=30pt]{#1\enspace}
> \stoptexdefinition
>
> \setuphead[chapter][style={\bfc},numbercommand=\MyNumberChapterCommand,
> page=no]
>
> \starttext
>
> \startchapter
>   [title={Algemene Beginselen},
>ownnumber={Boek I}]
>
> \samplefile{tufte}
>
> \stopchapter
>
> \startchapter
>   [title={Organisatorische Structuren},
>ownnumber={Boek II}]
>
> \samplefile{tufte}
>
> \stopchapter
>
> \stoptext
>
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
>
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Adjusted Chapter Headings

2024-03-19 Thread Hraban Ramm

Hi Jeroen,

it might make sense to use

\setuphead[chapter][
  conversion=R,
]
\setuplabeltext[nl][chapter={Boek }]

instead of ownnumber.

I would use one command for number and title and put both in the same 
kind of frame. Probably you should use a \strut in the text or 
\inframed[strut=yes] to assure the same text height.


HTH, Hraban

Am 19.03.24 um 12:59 schrieb Jeroen:
I have some style adjustments for the chapters. The chapter "numbers" 
need to be Boek I, Boek II, etc. A vertical separator was introduced 
with an inframe. The chapter title at the right side does not 
vertically align properly with the chapter number in the frame (inside 
the frame is vertically centered, the title not). Is there a way to 
align the chapter title with the chapter number?




\starttexdefinition MyNumberChapterCommand #1
    \inframed[frame=off,rightframe=on,framecolor=black,
     rulethickness=1px,height=30pt]{#1\enspace}
\stoptexdefinition

\setuphead[chapter][style={\bfc},numbercommand=\MyNumberChapterCommand,
    page=no]

\starttext

\startchapter
  [title={Algemene Beginselen},
   ownnumber={Boek I}]

\samplefile{tufte}

\stopchapter

\startchapter
  [title={Organisatorische Structuren},
   ownnumber={Boek II}]

\samplefile{tufte}

\stopchapter

\stoptext

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

maillist :ntg-context@ntg.nl  
/https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  :https://www.pragma-ade.nl  /https://context.aanhet.net  (mirror)
archive  :https://github.com/contextgarden/context
wiki :https://wiki.contextgarden.net
__
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Adjusted Chapter Headings

2024-03-19 Thread Jeroen
I have some style adjustments for the chapters. The chapter "numbers" need
to be Boek I, Boek II, etc. A vertical separator was introduced with an
inframe. The chapter title at the right side does not vertically align
properly with the chapter number in the frame (inside the frame is
vertically centered, the title not). Is there a way to align the chapter
title with the chapter number?



\starttexdefinition MyNumberChapterCommand #1
\inframed[frame=off,rightframe=on,framecolor=black,
 rulethickness=1px,height=30pt]{#1\enspace}
\stoptexdefinition

\setuphead[chapter][style={\bfc},numbercommand=\MyNumberChapterCommand,
page=no]

\starttext

\startchapter
  [title={Algemene Beginselen},
   ownnumber={Boek I}]

\samplefile{tufte}

\stopchapter

\startchapter
  [title={Organisatorische Structuren},
   ownnumber={Boek II}]

\samplefile{tufte}

\stopchapter

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Mikael’s missing math manual

2024-03-18 Thread Hraban Ramm

Am 18.03.24 um 07:36 schrieb Mikael Sundqvist:

Hi,

On Sun, Mar 17, 2024 at 10:57 PM Hraban Ramm  wrote:

… and another thing that came up in my workshops and in discussions at
our booth: the math manual is eagerly awaited! (My book too, but I can’t
answer most questions about math.)

Oh, I see. So, I should really try to get something out. It is
difficult to find enough time working on it, in particular since Hans
is always adding new (not only math) stuff, but I will try. It is fun
to participate in the development, and I do not want to delay it
(somebody has to push him and test, and so on...)

But I should probably get something out, even if that is not really
finished/polished. All the basics are there. Then it can be a
work-in-progress document, adding/modifying new stuff.


Yes, please! The version that you gave me a year ago is already really 
interesting and helpful, and Hans’ manuals are also often "in progress". 
A visible TODO marker might help – I’m using the following in my book to 
keep track of incomplete sections:


\defineregister[todos]
\define[1]\TODO{\inouter{\tt\color[red]{TODO}}\expanded{\todos{\structurevariable{title}}}\color[red]{\bf
 #1}\autoinsertnextspace}

…
\startsection[title=Lists]
\TODO{Research the options of \tex{setupitemgroup}!}
\stopsection
…

\startchapter[title=Work list]
  Sections that still need work.\blank

  \placetodos
\stopchapter

So I get a prominent marker in the content and the title of the affected 
section as an index.



There have been many changes along the way, and maybe at some time
some things were not really working, but later fixed.


I thought so, too.

For promotion I’d like to have a few examples where the difference 
between TeX/LaTeX default rendering and new ConTeXt rendering is visible.


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: how to include an an svg file?

2024-03-16 Thread Jean-Pierre Delange

Dear CTX wizards,

The commands given by Hans don't work properly in my case (with CTX on 
Windows 11). I am probably ignorant of how to implement \startMPpage. 
I'm not a "MetaPost lover", but I'd like to understand something; 
especially as I know how to make simple frames to include summaries.


In any case, the MWE below correctly displays the "smile" images (in 
*.pdf format) and incorrectly displays the smile.svg image). On the 
other hand, the \startMPpage script given by Hans only produces a white 
square. The *.log is attached.


The MWE :

\starttext

\startchapter[title={MetaPost}]


First : a draw sample with a simple command %\externalfigure


\externalfigure[smile.pdf]


% Hans comments on Metapost


Now gives the attached but it took me a while to figure out what works. 
An inkscape export adds for instance something (globally applied) that 
is not in the svg file (which actually derived from tiger.svg as 
mentioned in the file).



To be honest this is a horrible file and a good example of making things 
more complex than needed (probably common in wysiwyg applications), 
although we already had the machinery in the mp/pdf converter.



The biggest issue here is that one has to put some constrants in place 
order to make it work in e.g. sumatra (mypdf) and acrobat (which here 
actually does weird erratic things when I play with another test).



As with much complex svg, browsers also differ in interpretation o fsome 
features so it's hard to figure out what to do when there are 
conflicting demands. (Pointing to something that works tomorrow doesn't 
mean it worked when we tried to implement something yesterday.)



For Hraban - who mentioned it - i also added support for group opacity 
and transformed shades.



Hans Hagen


% If we use another call to the same smile drawing (but in *.svg format)

% the svg file is given by Inkscape (as the smile.pdf, exported through 
Inkscape)



\startMPcode

draw lmt_svg [ filename = "smile.svg"]

\stopMPcode



\stopchapter


\startchapter[title={Hans tricky drawing}]


Now, see the results of Hans has given to \quote{metapost lovers}, here 
is some of the trickery used :



\startMPpage[offset=1ts]


draw image (

fill (unitsquare xscaled 10cm yscaled 4cm)

withcolor svgcolor(0.5,0,0)

;


registerluminositygroup ("test") (

fill (unitsquare scaled 2cm) shifted (1cm,1cm)

withshademethod "circular"

withshadecolors (.6,.1)

) ;


applyluminositygroup ("test") (

fill (unitsquare scaled 2cm) shifted (1cm,1cm)

withshademethod "circular"

) ;


draw luminositygroup (

fill (unitsquare scaled 2cm) shifted (4cm,1cm)

withshademethod "circular"

withshadecolors (.6,.1)

) (

fill (unitsquare scaled 2cm) shifted (4cm,1cm)

withshademethod "circular"

) ;


draw luminosityshade (

(unitsquare scaled 2cm) shifted (7cm,1cm)

) (

withshademethod "circular"

withshadecolors (.6,.1)

) (

withshademethod "circular"

) ;

) ;


\stopMPpage

\stopchapter


\stoptext


Le 15/03/2024 à 20:39, Hans Hagen via ntg-context a écrit :

On 3/13/2024 9:16 AM, Henning Hraban Ramm wrote:

Am 12.03.24 um 23:59 schrieb seyal zavira:
You are correct. when i convert this svg to pdf via inkscape it 
works like a charm.


But what is standard way of including an svg file with context if we 
want to inkscape render the images?


\externalfigure[smile]

without any other settings, but inkscape must be callable on the 
command line (which doesn’t work for me on MacOS any more, must 
investigate…).

    \startMPcode
    draw lmt_svg [ filename = "smile.svg"]
    \stopMPcode

Now gives the attached but it took me a while to figure out what 
works. An inkscape export adds for instance something (globally 
applied) that is not in the svg file (which actually derived from 
tiger.svg as mentioned in the file).


To be honest this is a horrible file and a good example of making 
things more complex than needed (probably common in wysiwyg 
applications), although we already had the machinery in the mp/pdf 
converter.


The biggest issue here is that one has to put some constrants in place 
order to make it work in e.g. sumatra (mypdf) and acrobat (which here 
actually does weird erratic things when I play with another test).


As with much complex svg, browsers also differ in interpretation o 
fsome features so it's hard to figure out what to do when there are 
conflicting demands. (Pointing to something that works tomorrow 
doesn't mean it worked when we tried to implement something yesterday.)


For Hraben - who mentioned it - i also added support for group opacity 
and transformed shades.


In the process I tried a few inkscape options (pdf export) but some 
produce faulty files (with missing stuff) so i guess we have a complex 
situation in general. That said, as long as one sticks to reliable and 
clean code (plain svg) it should mostly work out.


Text is

[NTG-context] Re: Struggling with the distance and right margin text

2024-03-15 Thread Pablo Rodriguez via ntg-context
On 3/15/24 14:06, Ursula Hermann wrote:
> Dear List, 

Dear Ursula,

this might help you (it isn’t perfect, but you just seem to copy and
paste fragments from your source files):

  %\showframe\showstruts
  \mainlanguage[de-at]
  \setuppagenumbering[alternative=doublesided]
  \definemargindata  [MyInMargin][ininner]
  \definemarginframed[MyInMargin]
[topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
  \defineframed[topruletitle]
[width=max,
 frame=off,
 topframe=on,
 rulethickness=1pt,
 align={justify},
 extras=\dontleavehmode]
  \starttext
  \topruletitle{\MyInMargin {1.1.1}\bf
  Beispiel 3.2.17. (Vertauschung von All- und Existenzquantor).} \par
  \input knuth\page

  \topruletitle{\MyInMargin{3.2.22}{\bf
  Theorem 3.2.22 (Rechenregeln für Quantoren)}. Seien \m P(\m x)und
\input zapf b}
  \stoptext

Sorry for saying that again, but please elaborate both your minimal
samples and your descriptions of the issues you are experiencing.

Some comments on the code fragments you sent.

First of all, please include always code that can be compiled simply
after being copied and pasted.

This requires \starttext (most of the time) and \stoptext (mandatory to
avoid stupid errors).

> \definepapersize[MyBook][width=19cm,height=29.7cm]
> \setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook
> %\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
> \setupbodyfont[modern, 12.50pt]

If these lines are irrelevant for the issue you are experiencing, please
don’t include them.

> \definemargindata  [MyInMargin][inleft]
> \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]

You define this margin framed, but your sample makes no use of it.

Sorry, but I don’t get it.

> \defineenumeration
>   [theorem]
>   [
>     text=Theorem,
>     title=yes,
>     width=fit,
>     distance=0.2em,
>     alternative=serried,
>   ]
> \definetextbackground[GrayBackground][
>   location=paragraph,
>   background=color,
>   backgroundcolor=lightgray,
>   leftoffset=.5\bodyfontsize,
>   rightoffset=.5\bodyfontsize,
>   topoffset=.5\bodyfontsize,
>   bottomoffset=.5\bodyfontsize,
>   frame=off,]
>   \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\}
>   \blackrule[color=black, height=0.10ex, width=13.50cm]

If your sample includes no theorem or text background, please remove
these definitions when sending code.

BTW, avoid include text content (such as margin and body rules [but not
their definitions]) before \starttext.

Also, use \clrf instead of \\ (since the mailing list displays the
relevant line as ("\" instead of "\\"):

>   \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\}

Here starts your text:

> \starttext
> \margintext {1.1.1}
> {\bf Beispiel 3.2.17. (Vertauschung von All- und Existenzquantor).} \par

Your margin text is undefined. Your code has a defined margin text
command, but it isn’t used.

> So  I have here an example from the second page: 

Sorry, but I’m having the impression you are using ConTeXt as a kind of
command-based DTP software (which I think it isn’t at all).

Or, do you define commands for each page?

I think it is better to define a single margin text command and use a
doublesided page setup.

> \definemargindata[inrightmargin][right][margin=margin,width=.50em\rightmarginwidth,style=,color=]
> \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt, 
> width=.90cm]

Again, margin text commands defined, but never used.

> \blackrule[color=black, height=0.10ex, width=13.40cm]
> {\blackrule[color=black, height=0.10ex, width=1cm, distance=.90cm]\par

Here you open a brace that is not closed at all.

At least, consider that this won’t be extremely readable for other
people (this is only a sample).

It also may be problematic for you, if you leave the source untouched
for some weeks.

> \defineenumeration
>   [theorem]
>   [
>     text=Theorem,
>     title=yes,
>     width=fit,
>     distance=0.2em,
>     alternative=serried,
>   ]

At least, it would be better not to include a definition inside content
that seems to (or may) be grouped with braces.

BTW, it is exactly the same definition as the one included before.

It isn’t just to be removed in minimal samples, your final code doesn’t
need the duplicated command definition.

> \inright{3.2.22}
> {\bf Theorem 3.2.22 (Rechenregeln für Quantoren)}. Seien \m P(\m x)und 
>
> My problem here is that there is not the same distance between the  the
> text and the  margintext .

Please, always compile the minimal samples that you send to the list.

This is simply to ensure other list subscribers will get the same
results as you.

After adding a final \stoptext command, I had to run:

  mtxrun --script check source-sample.tex

This allowed me to sp

[NTG-context] Struggling with the distance and right margin text

2024-03-15 Thread Ursula Hermann
Dear List,



On the first page I had this example:
\definepapersize[MyBook][width=19cm,height=29.7cm]
\setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook 
%\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
\setupbodyfont[modern, 12.50pt]
\definemargindata  [MyInMargin][inleft]
\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
\defineenumeration
  [theorem]
  [
text=Theorem,
title=yes,
width=fit,
distance=0.2em,
alternative=serried,
  ]
\definetextbackground[GrayBackground][
  location=paragraph,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.5\bodyfontsize,
  rightoffset=.5\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]
  \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\}
  \blackrule[color=black, height=0.10ex, width=13.50cm]
\starttext
\margintext {1.1.1}
{\bf Beispiel 3.2.17. (Vertauschung von All- und Existenzquantor).} \par


So  I have here an example from the second page:


\definemargindata[inrightmargin][right][margin=margin,width=.50em\rightmarginwidth,style=,color=]

\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt, 
width=.90cm]
\blackrule[color=black, height=0.10ex, width=13.40cm]
{\blackrule[color=black, height=0.10ex, width=1cm, distance=.90cm]\par
\defineenumeration
  [theorem]
  [
text=Theorem,
title=yes,
width=fit,
distance=0.2em,
alternative=serried,
  ]
\inright{3.2.22}
{\bf Theorem 3.2.22 (Rechenregeln für Quantoren)}. Seien \m P(\m x)und

My problem here is that there is not the same distance between the  the text 
and the  margintext .

And now the margintext should be on the right side.

So maybe someone could help me please.
Many thanks.



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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How to track down source of [entry not flushed] displaying in indexes?

2024-03-13 Thread Joel via ntg-context
 After many hours of trial-and-error, I was able to recreate the problem in a 
minimum working example:
file main.tex only contains:

\starttext

    \index{birds}
    \index{insects}
    
    \input secondary
    
    \placeindex
    
\stoptext
file secondary.tex only contains:


   \index{turtles}

For reasons I can't understand, the index produces the same [entry not flushed] 
error. It seems here happening when contents are input.
My code is so simple, I can't understand what I've typed wrong.

--Joel


On Wednesday, March 13, 2024 at 12:51:56 PM MDT, Joel via ntg-context 
 wrote:  
 
  Okay, I maybe made some progress. I traced the code back and back through the 
various documents and found I have some items inside:

\startnointerference\startnointerference
My intent is to have items that are "there" but invisible to viewers, taking up 
no space on screen, but treated as being present, so the index will still point 
to that particular page.
This solution seems to be what's causing the [entry not flushed] error in the 
index.
Is there another solution instead of startnointerferencethat will hide text or 
any content but still allow page references to link to that blank spot?

--Joel

On Wednesday, March 13, 2024 at 07:53:21 AM MDT, Joel via ntg-context 
 wrote:  
 
 I have some custom registers that I use to index some information. When 
compiled, it just prints [entry not flushed] instead of printing some of the 
page numbers.
I have tens of thousands of lines of code, so have no idea how to break the 
problem down to a minimal example. What does [entry not flushed] mean? What 
kind of feature in my document do I need to search for that might explain why 
this is appearing?

Here is the minimal code used in my index, as you see it isn't showing the 
error, so something else in the document is causing it:

 \setvalue{W3}{this is text for W3}


\defineregister[learnedshort][compress=yes]
\setupregister[learnedshort][style=sansbold, textstyle=slanted, n=3, 
pagenumber=yes, indicator=no]
%
\defineregister[learnedlong][compress=yes]
\setupregister[learnedlong][style=sansbold, textstyle=slanted, n=2, 
pagenumber=yes, indicator=no]
%
\define[1]\learnedis{%
    \txt{} \getvalue{#1}
    \learnedshort{#1}
    \learnedlong{#1}
}
\define[1]\learned{%
    \textreference[textref#1]{\expanded{\currentstructuretitle}}
    \reference[ref#1]{}%
%
    \learnedshort{#1}
    \learnedlong{\getvalue{#1}}
}

\starttext

\learned{W3}

    \startchapter[title=Standards]
  \placeregister[learnedlong]
    \stopchapter
\stoptext


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki    : https://wiki.contextgarden.net
___
  
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki    : https://wiki.contextgarden.net
___
  ___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How to track down source of [entry not flushed] displaying in indexes?

2024-03-13 Thread Joel via ntg-context
 Okay, I maybe made some progress. I traced the code back and back through the 
various documents and found I have some items inside:

\startnointerference\startnointerference
My intent is to have items that are "there" but invisible to viewers, taking up 
no space on screen, but treated as being present, so the index will still point 
to that particular page.
This solution seems to be what's causing the [entry not flushed] error in the 
index.
Is there another solution instead of startnointerferencethat will hide text or 
any content but still allow page references to link to that blank spot?

--Joel

On Wednesday, March 13, 2024 at 07:53:21 AM MDT, Joel via ntg-context 
 wrote:  
 
 I have some custom registers that I use to index some information. When 
compiled, it just prints [entry not flushed] instead of printing some of the 
page numbers.
I have tens of thousands of lines of code, so have no idea how to break the 
problem down to a minimal example. What does [entry not flushed] mean? What 
kind of feature in my document do I need to search for that might explain why 
this is appearing?

Here is the minimal code used in my index, as you see it isn't showing the 
error, so something else in the document is causing it:

 \setvalue{W3}{this is text for W3}


\defineregister[learnedshort][compress=yes]
\setupregister[learnedshort][style=sansbold, textstyle=slanted, n=3, 
pagenumber=yes, indicator=no]
%
\defineregister[learnedlong][compress=yes]
\setupregister[learnedlong][style=sansbold, textstyle=slanted, n=2, 
pagenumber=yes, indicator=no]
%
\define[1]\learnedis{%
    \txt{} \getvalue{#1}
    \learnedshort{#1}
    \learnedlong{#1}
}
\define[1]\learned{%
    \textreference[textref#1]{\expanded{\currentstructuretitle}}
    \reference[ref#1]{}%
%
    \learnedshort{#1}
    \learnedlong{\getvalue{#1}}
}

\starttext

\learned{W3}

    \startchapter[title=Standards]
  \placeregister[learnedlong]
    \stopchapter
\stoptext


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki    : https://wiki.contextgarden.net
___
  ___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] How to track down source of [entry not flushed] displaying in indexes?

2024-03-13 Thread Joel via ntg-context
I have some custom registers that I use to index some information. When 
compiled, it just prints [entry not flushed] instead of printing some of the 
page numbers.
I have tens of thousands of lines of code, so have no idea how to break the 
problem down to a minimal example. What does [entry not flushed] mean? What 
kind of feature in my document do I need to search for that might explain why 
this is appearing?

Here is the minimal code used in my index, as you see it isn't showing the 
error, so something else in the document is causing it:

 \setvalue{W3}{this is text for W3}


\defineregister[learnedshort][compress=yes]
\setupregister[learnedshort][style=sansbold, textstyle=slanted, n=3, 
pagenumber=yes, indicator=no]
%
\defineregister[learnedlong][compress=yes]
\setupregister[learnedlong][style=sansbold, textstyle=slanted, n=2, 
pagenumber=yes, indicator=no]
%
\define[1]\learnedis{%
    \txt{} \getvalue{#1}
    \learnedshort{#1}
    \learnedlong{#1}
}
\define[1]\learned{%
    \textreference[textref#1]{\expanded{\currentstructuretitle}}
    \reference[ref#1]{}%
%
    \learnedshort{#1}
    \learnedlong{\getvalue{#1}}
}

\starttext

\learned{W3}

    \startchapter[title=Standards]
  \placeregister[learnedlong]
    \stopchapter
\stoptext


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Document metadata after context --extra=select script

2024-03-10 Thread Michael Guravage
Greetings,

I set a document's title with the following code:

\expanded
  {\setupmetadata
[title={Document Title}]}

I then create a derivative document with a selection of pages using
ConTeXt's select script.

context --extra=select [options] list-of-files

The metadata title of this document is "mtx-context-select." While I can
use any number of utilities to manually tweak the title, is there a ConTeXt
way to preserve or assign metadata values when using these scripts?

-- 
With kind regards,

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How to set section title based on section content?

2024-03-09 Thread Wolfgang Schuster

Joel via ntg-context schrieb am 09.03.2024 um 16:01:

How to set section title based on section content?

I have a document that has some structures like this:

\starttext

\startsection[title={Animals}]

\event{\input knuth }

\stopsection

\startsection[title={Books}]

\event{\input knuth }

\stopsection

\stoptext

The event macro runs a bunch of conditionals, deciding which content to 
place inside the section. It places any one of neary 200 possible 
different types of content there.


Sadly when I wrote the code, I thought generic titles would be okay. Now 
I realize I need to be more specific, giving titles that match the 
content inside. I could move the section titles inside the \event macro, 
but it means rewriting ~200 other macros.


In other words, how do I define a section title by defining it somewhere 
in the content of the \event macro?


\starttext

\startsection[\whatistitle] %<-- would display "Neon Tetras"

\event{\thetitleis{Neon Tetras}\input knuth }

\stopsection

\startsection[\whatistitle] %<-- would display "Detective Stories"

\event{\thetitleis{Detective Stories}\input knuth }

\stopsection

\stoptext


When each section contains nothing except the \event command I would 
remove the section titles from the document itself and place them as 
part of the \event command.


\define[1]\Event
  {\startsection[title={#1}]
   \input{knuth}
   \stopsection}

\starttext

\Event{Neon Tetras}

\Event{Detective Stories}

\stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] How to set section title based on section content?

2024-03-09 Thread Joel via ntg-context
How to set section title based on section content?

I have a document that has some structures like this:

\starttext

\startsection[title={Animals}]

\event{\input knuth }

\stopsection

\startsection[title={Books}]

\event{\input knuth }

\stopsection

\stoptext

The event macro runs a bunch of conditionals, deciding which content to place 
inside the section. It places any one of neary 200 possible different types of 
content there.

Sadly when I wrote the code, I thought generic titles would be okay. Now I 
realize I need to be more specific, giving titles that match the content 
inside. I could move the section titles inside the \event macro, but it means 
rewriting ~200 other macros.

In other words, how do I define a section title by defining it somewhere in the 
content of the \event macro?

\starttext

\startsection[\whatistitle] %<-- would display "Neon Tetras"

\event{\thetitleis{Neon Tetras}\input knuth }

\stopsection

\startsection[\whatistitle] %<-- would display "Detective Stories"

\event{\thetitleis{Detective Stories}\input knuth }

\stopsection

\stoptext





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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: How can I do this?

2024-03-08 Thread Otared Kavian
Hi Ursula,

The reason for which you did not get the expected result is that you have « } » 
missing in your file, that is the closing brace after your italic command
« {\it » at the end of your document. 
Moreover you did not have a \stoptext in your file, and a math command « \m » 
was not written correctly. Talking of math, I personnaly prefer to enclose 
in-line math between dollar signs $, that is writing « $\exists x \in H$ » 
instead of  « \m{\exists x \in H} ».

Also the way you write your text is somewhat « incorrect » (or as Mikael 
Sundqvist would put it, « interesting »…), since in principle all the setups 
and definitions must be before the body of your document which begns with 
\starttext. Another point i sthat instead of using \par you can leave a blank 
line, which makes the document more readable. And you don’t need to break the 
lines by « hand », since ConTeXt does it in a better way.
Finally instead of 
\blackrule[color=black, height=0.10ex, width=13.50cm]
you can use just \hairline, and the thickness and color of such a \hairline can 
be adjusted by 
\setupthinrules[rulethickness=4pt,color=darkgreen]
(for instance), which should be put before \starttext.

Best regards: Otared

% begin textbackground-Ursula.tex
\definetextbackground[myBG][
  location=paragraph,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.8\bodyfontsize,
  rightoffset=.8\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off]

\setupnarrower[left=0.80cm, right=0.80cm]
\definehspace[oneem][0.5em]
\setupinteraction
   [state=start,
color=blue]

\usecolors[svg]
\setupinteraction
  [state=start,
   contrastcolor=cornflowerblue]
   
   
\starttext
\margintext {1.1.1} {\bf Beispiel 3.2.17 (Vertauschung von All- und 
Existenzquantor).}

{\it Sei M die Menge aller Männer und F die Menge aller Frauen. Die Aussage 
h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen machen Sie sich 
die Bedeutung der beiden Aussagen klar.}

\startitemize[n,packed,broad]
\item \m{\forall m ∈ M : ∃f ∈ F : h(m, f)}  

\item $∃f ∈ F : ∀m ∈ M : h(m, f)$.

\stopitemize


\startmyBG
Mitunter ist es aus der Formulierung nur schwer zu erkennen, dass
ein $∃\forall∀ $ oder ein $\forall∀\m∃$ versteckt ist. Dann ist es besonders 
wichtig, die
Formulierung sehr lange zu prüfen und eventuell auch formalisiert
noch einmal aufzuschreiben.”
\blank

\startnarrower[left, right]

Der\hspace[oneem] Wert \hspace[oneem] von \hspace[oneem] 
\m{y = f(x)} ist unabhängig von der Wahl

von \m{x\doubleprime} ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} 

(Beutelspacher [10, S.54])

\blank
\stopnarrower
\stopmyBG


\blank

\blackrule[color=black, height=0.10ex, width=13.50cm]

\reference[Regel:1]{3.1}

{\bf Aufgabe 3.2.18} Formulieren Sie gemäß der Regel (\goto{3.1}[Regel:1]) 
äquivalent

\startitemize[n,packed,broad]

\item \m{\forall n \in \naturalnumbers\mtp{:} n^2 > n \implies n > 1},

\item \m{\forall n \in \naturalnumbers\mtp{:} 3\divides n \implies 4 \divides 
n},

\item \m{\forall n \in \naturalnumbers\mtp{:} n^3 \mtext{ ungerade }\nospace
\implies n \mtext{ ungerade}}.

\stopitemize

\blackrule[color=black, height=0.10ex, width=13.50cm]

{\bf Aufgabe 3.2.19} Bilden Sie die Verneinung der folgenden Aussagen:

\startitemize[n,packed,broad]
\item Alle Rosen sind verwelkt oder teuer.

\item Alle rosen sind entweder verwelkt oder teuer.

\stopitemize


\reference[Abschnitt:1]{3.2.1.1}

{\it Hinweis: Beachten Sie die Konvention aus Abschnitt 
\goto{3.2.1.1}[Abschnitt:1] die Formulierung \quotation {entweder ... oder} 
entspricht dem ausschließenden Oder
und die Formulierung \quotation{oder} dem (mathematischen) einschließenden
Oder.}

\blackrule[color=black, height=0.10ex, width=13.50cm]

\stoptext
% end textbackground-Ursula.tex


> On 6 Mar 2024, at 13:52, Ursula Hermann  wrote:
> 
> Dear List,
> I need a tip how to do this:
> In the command \definepapersize[Mybook] the height should be not 24 cm, but a 
> little bit longer. My Problem is, as you can see on the PDF, that there are 
> troubles with the Gray Background. The Gray Background should begin with : 
> Mitunter. . I think it should be the topoffset, and the bottomoffset, but how 
> many .\bodyfontsize should I try?
> Many thanks 
> Uschi 
> \mainlanguage[de]
> \definepapersize[MyBook][width=19cm,height=24cm]
> \setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook 
> %\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
> \setupbodyfont[Times New Roman,12.55pt]
> \definemargindata  [MyInMargin][inright]
> \definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
> \defineenumeration
>   [theorem]
>   [
> text=Theorem,
> title=yes,
> width=fit,
> distance=0.2em,
> alternative=serried,
>   ]
> \definetextbackground[GrayBackground][
>   location=p

[NTG-context] Re: Log entries about confusing level change

2024-03-08 Thread Hans Hagen

On 3/8/2024 3:38 AM, Rik Kabel wrote:

Hello all,

The following example produces two log entries that seem a bit odd. The 
log entries are:


backend > bookmarks > confusing level change at level 3
around '1 body1'
backend > bookmarks > confusing level change at level 3
around 'back1'

and they refer to the first chapter of the bodymatter and the first 
chapter of the backmatter, respectively.


The example:

\setupinteraction [state=start]
\placebookmarks   [chapter]
\starttext
   \startfrontmatter
     \startchapter [title=front1]
   \samplefile {knuth-gpt}
     \stopchapter
   \stopfrontmatter
   \startbodymatter
     \startchapter [title=body1]
   \samplefile {knuth-gpt}
     \stopchapter
   \stopbodymatter
   \startbackmatter
     \startchapter [title=back1]
   \samplefile {knuth-gpt}
     \stopchapter
   \stopbackmatter
\stoptext

Does the level change message suggest that something is missing in the 
document?
normally harmless so i can add an extra check but bookmarks can be a 
pain when less structure is used (somewhat weird low level pdf stuff)


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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Log entries about confusing level change

2024-03-07 Thread Rik Kabel

Hello all,

The following example produces two log entries that seem a bit odd. The 
log entries are:


   backend > bookmarks > confusing level change at level 3
   around '1 body1'
   backend > bookmarks > confusing level change at level 3
   around 'back1'

and they refer to the first chapter of the bodymatter and the first 
chapter of the backmatter, respectively.


The example:

   \setupinteraction [state=start]
   \placebookmarks   [chapter]
   \starttext
  \startfrontmatter
    \startchapter [title=front1]
  \samplefile {knuth-gpt}
    \stopchapter
  \stopfrontmatter
  \startbodymatter
    \startchapter [title=body1]
  \samplefile {knuth-gpt}
    \stopchapter
  \stopbodymatter
  \startbackmatter
    \startchapter [title=back1]
  \samplefile {knuth-gpt}
    \stopchapter
  \stopbackmatter
   \stoptext

Does the level change message suggest that something is missing in the 
document?


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] multicolumn title and abstact (bachotex) using tugboat.mkxl

2024-03-07 Thread Damien Thiriet via ntg-context

Hello,


I am currently writing my paper for last year's BachoTeX proceedings.
I am using tugboat.mkxl module to design the layout.

In bachotex proceedings, the author's data and abstract are on a single 
column and the article is usually typeset on two columns.

Comments in tugboat.mkxl states:

%D We have several column mechanisms and they all serve a different 
purpose. Here we
%D use pagecolumns. They support much of what we can do in single 
columns, but of
%D course there are exceptions. Floats can go into columns of aremoved 
to the top or
%D bottom when there is no room. We don't span mid column. Notes can go 
in columns
%D or at the end. We can start with a single column (for titles and 
such).


I can't figure out which part of the file should be used/adapted to 
start with a single column.
What I did is to put datas and abstract in a frame and use \placefigure. 
As stated in pagecolumns
manual, everything is put on the top of next page. (BTW, there is a 
typo: «of aremoved»)


I don't know, whether this MWE helps is relevant, but just in case, here 
is what I did:


* copy tugboat.mkxl to a new file p-bachotex.mkxl
* changed p-bachotex.mkxl like this:

\startsetups bachotex:naglowek:columns
\defineframedtext [Dane]
\setupframedtext
[Dane]
[width=18cm ,
 align=normal,
 frame=no]
\definenarrower
[Streszczenia]
[2*middle]

\startplacefigure [location={here,none}]
{\startDane
{\tfa\getvariable{tugboat}{author}}\par
\getvariable{tugboat}{address}\par
{\tt\getvariable{tugboat}{email}}\par

\startStreszczenia
\doifelsebufferempty {abstract} {
% no abstract
} {
\blank[line]

\enforced\let\\\endgraf
\setups[tugboat:abstract:setup]
\startAbstracts[title={Abstract}]
\stopAbstracts
}
\stopStreszczenia
\stopDane}
\stopplacefigure
\stopsetups

\startsetups tugboat:article:start

  \starttext

\setups{tugboat:columns:presets}

\setups{tugboat:banner:setup:\getvariable{tugboat}{type}}

\setupheadertexts
[\setups{tugboat:banner:text:article}]
[pagenumber]

\setuppagenumber
[number=\getvariable{tugboat}{page}]

\startmode[columns]
\startpagecolumns
\stopmode

\setups[tugboat:introduction:article]
\doifmodeelse{columns}{
\setups{bachotex:naglowek:columns}
} {
\setups{bachotex:naglowek:nocolumns}
}

\stopsetups

My article begins so:

\enablemode [columns]
\usemodule [bachotex]

% skipped tugboat variables for this MWE

\StartAbstract
  \input tufte
\StopAbstract
\StartArticle
   \input knuth
\StopArticle

Thank you for your help

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: missing metadata in LMTX

2024-03-06 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 06.03.2024 um 16:52:

On 3/6/24 15:54, Hans Hagen wrote:

[...]

\setupmetadata
[title=FooBar]

that's for those who go global

Many thanks for the new command, Hans.

I‘m afraid this new command breaks my compilation.

The error message isn’t very helpful for me (see below).

I wonder whether this requires a minimal sample to be fixed.


Yes, a minimal example would help because \setupmetadata works in your 
previous example.


Wolfgang

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: missing metadata in LMTX

2024-03-06 Thread Pablo Rodriguez via ntg-context
On 3/6/24 15:54, Hans Hagen wrote:
> [...]
>> \setupmetadata
>>[title=FooBar]
>
> that's for those who go global

Many thanks for the new command, Hans.

I‘m afraid this new command breaks my compilation.

The error message isn’t very helpful for me (see below).

I wonder whether this requires a minimal sample to be fixed.

Many thanks for your help,

Pablo


tex error   > tex error on line 0 in file : Argument of \D9>:title
has an extra }



\par }
 \prerolltostring
#1->\beginlocalcontrol \setbox \b_syst_boxes \hbox {\expand
\everypreroll #1}
\normalexpanded {\setbox \b_syst_boxes \emptybox \endlocalcontrol
\boxtostring \b_syst_boxes }
 \scrn_identity_get
#1->\setidentityvariable {#1}{\prerolltostring
{\interactionparameter {#1}}
}


[[special cmd: end local call]]




I've run across a '}' that doesn't seem to match anything. For example,
'\def\a#1{...}' and '\a}' would produce this error. The '\par' that I've
just
inserted will cause me to report a runaway argument that might be the
root of the
problem.
mtx-context | fatal error: return code: 1
> exit status: 256

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: missing metadata in LMTX

2024-03-06 Thread Hans Hagen

On 3/6/2024 11:18 AM, Marco Patzer wrote:

On Tue, 5 Mar 2024 23:14:04 +0100
Wolfgang Schuster  wrote:


Here is the official solution:

\startxmlsetups xml:meta
\setupmetadata
  [author={\xmltext{#1}{/author}},
   title={\xmltext{#1}{/title}}]
\stopxmlsetups


So now we have:

\setupinteraction
   [title=FooBar]

\setupdocument
   [metadata:title=FooBar]


that just sets defaults for \setupinteraction so that they inherit from 
document



\setupmetadata
   [title=FooBar]


that's for those who go global


Are any of those deprecated or the preferred way? I'm starting to
get confused.


even if we would use \setupmetadata we'd still have \setupinteraction 
because we remain compatible


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 / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] How can I do this?

2024-03-06 Thread Ursula Hermann
Dear List,
I need a tip how to do this:
In the command \definepapersize[Mybook] the height should be not 24 cm, but a 
little bit longer. My Problem is, as you can see on the PDF, that there are 
troubles with the Gray Background. The Gray Background should begin with : 
Mitunter. . I think it should be the topoffset, and the bottomoffset, but how 
many .\bodyfontsize should I try?
Many thanks
Uschi
\mainlanguage[de]
\definepapersize[MyBook][width=19cm,height=24cm]
\setuppapersize[MyBook][MyBook] % Prints on paper the size of MyBook 
%\setuppapersize[MyBook][A4] %Would print MyBook-size pages on A4 paper
\setupbodyfont[Times New Roman,12.55pt]
\definemargindata  [MyInMargin][inright]
\definemarginframed[MyInMargin][topframe=on,bottomframe=on,rulethickness=1pt,width=1.90cm]
\defineenumeration
  [theorem]
  [
text=Theorem,
title=yes,
width=fit,
distance=0.2em,
alternative=serried,
  ]
\definetextbackground[GrayBackground][
  location=paragraph,
  background=color,
  backgroundcolor=lightgray,
  leftoffset=.8\bodyfontsize,
  rightoffset=.8\bodyfontsize,
  topoffset=.5\bodyfontsize,
  bottomoffset=.5\bodyfontsize,
  frame=off,]
  \margintext{\blackrule[color=black, height=0.10ex, width=1cm]\\}
  \blackrule[color=black, height=0.10ex, width=13.50cm]
\starttext
\margintext {1.1.1} {\bf Beispiel 3.2.17 (Vertauschung von All- und 
Existenzquantor).}
\par {\it Sei M die Menge aller Männer und F die Menge aller Frauen. Die 
Aus-\par
sage h(m, f) sei ”m ist verliebt in f“. Unter diesen Voraussetzungen machen Sie 
sich die Bedeutung der beiden Aussagen klar.}
\par
\startitemize[n,packed,broad]
\item \m{\forall m ∈ M : ∃f ∈ F : h(m, f)}  \item ∃f ∈ F : ∀m ∈ M : h(m, f).
\stopitemize
\startGrayBackground
\tf Mitunter ist es aus der Formulierung nur schwer zu erkennen, dass
ein \m ∃\forall∀ oder ein \m \forall∀\m∃ versteckt ist. Dann ist es besonders 
wichtig, die
Formulierung sehr lange zu prüfen und eventuell auch formalisiert
noch einmal aufzuschreiben.”
\blank
\setupnarrower [left=0.80cm, right=0.80cm]
\startnarrower[left, right]
\definehspace[oneem][0.5em]
Der\hspace[oneem] Wert\hspace[oneem] von\hspace[oneem] \m{y = f(x)} ist 
unabhängig von der Wahl\\
von \m{x\doubleprime} ist gleichbedeutend mit \m{∃y : ∀x : f(x) = y} \\ 
(Beutelspacher [10, S.54])\par
\blank
\stopnarrower
\stopGrayBackground
\blank
\blackrule[color=black, height=0.10ex, width=13.50cm]
\setupinteraction
   [state=start,
color=blue]
\reference[Regel:1]{3.1}\par
{\bf Aufgabe 3.2.18} Formulieren Sie gemäß der Regel (\goto{3.1}[Regel:1]) 
äquivalent
\startitemize[n,packed,broad]
\item \m{\forall n \in \naturalnumbers\mtp{:} n^2 > n \implies n > 1},\item 
\m{\forall n \in \naturalnumbers\mtp{:} 3\divides n \implies 4 \divides 
n},\item \m{\forall n \in \naturalnumbers\mtp{:} n^3 \mtext{ ungerade }\nospace
\implies n \mtext{ ungerade}}.
\stopitemize
\blackrule[color=black, height=0.10ex, width=13.50cm]\par
{\bf Aufgabe 3.2.19} Bilden Sie die Verneinung der folgenden Aussagen:
\startitemize[n,packed,broad]
\item Alle Rosen sind verwelkt oder teuer.
\item Alle rosen sind entweder verwelkt oder teuer.
\stopitemize
\par
\usecolors[svg]
\setupinteraction
  [state=start,
   contrastcolor=cornflowerblue]
\reference[Abschnitt:1]{3.2.1.1}
{\it Hinweis: Beachten Sie die Konvention aus Abschnitt \goto 
{3.2.1.1}[Abschnitt:1]die For-\par
mulierung \quotation {entweder ... oder} entspricht dem ausschließenden Oder\par
und die Formulierung \quotation{oder} dem (mathematischen) einschließenden\par
Oder.\par
\blackrule[color=black, height=0.10ex, width=13.50cm]



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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: missing metadata in LMTX

2024-03-06 Thread Henning Hraban Ramm

Am 06.03.24 um 11:18 schrieb Marco Patzer:

On Tue, 5 Mar 2024 23:14:04 +0100
Wolfgang Schuster  wrote:


Here is the official solution:

\startxmlsetups xml:meta
\setupmetadata
  [author={\xmltext{#1}{/author}},
   title={\xmltext{#1}{/title}}]
\stopxmlsetups


So now we have:

\setupinteraction
   [title=FooBar]

\setupdocument
   [metadata:title=FooBar]

\setupmetadata
   [title=FooBar]

Are any of those deprecated or the preferred way? I'm starting to
get confused.


There’s also \settaggedmetadata; I actually didn’t know \setupmetadata.
Both are missing in the wiki yet.
Also https://wiki.contextgarden.net/Command/setupinteraction doesn’t 
talk about metadata. Sigh.


AFAIK the metadata from \setupinteraction is used for everything, as 
long as you don’t overwrite it elsewhere.


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: missing metadata in LMTX

2024-03-06 Thread Marco Patzer
On Tue, 5 Mar 2024 23:14:04 +0100
Wolfgang Schuster  wrote:

> Here is the official solution:
> 
> \startxmlsetups xml:meta
>\setupmetadata
>  [author={\xmltext{#1}{/author}},
>   title={\xmltext{#1}{/title}}]
> \stopxmlsetups

So now we have:

\setupinteraction
  [title=FooBar]

\setupdocument
  [metadata:title=FooBar]

\setupmetadata
  [title=FooBar]

Are any of those deprecated or the preferred way? I'm starting to
get confused.

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: missing metadata in LMTX

2024-03-05 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 04.03.2024 um 07:17:

On 3/4/24 01:18, Wolfgang Schuster wrote:

Pablo Rodriguez via ntg-context schrieb am 03.03.2024 um 20:02:

[...]
With LuaTeX, I get PDF metadata. With LuaMetaTeX, I cannot get them.
[...]

I can confirm the issue and it happens because Hans changed they way
how the values of the \setupinteraction commands are passed to Lua
side of ConTeXt to be written to the PDF file.


Many thanks for your reply and your explanation, Wolfgang.


I can provide at the moment solutions which ensure the information
appear in the PDF but none of the is very elegant and I hope Hans
can help with a clean solution.


The first one avoids the issue until Hans provides a final fix.


Here is the official solution:

\startxmlsetups xml:meta
  \setupmetadata
[author={\xmltext{#1}{/author}},
 title={\xmltext{#1}{/title}}]
\stopxmlsetups

The command is new and accepts the following keys:

  - title
  - subtitle
  - author
  - keyword
  - date

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: missing metadata in LMTX

2024-03-03 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 03.03.2024 um 20:02:

Dear list,

this issue has been bugging me for some time:

[...]

With LuaTeX, I get PDF metadata. With LuaMetaTeX, I cannot get them.

For both, I’m using current latest (from 2024.02.27 09:21).

Could anyone confirm the issue or explain me what I am missing


I can confirm the issue and it happens because Hans changed they way
how the values of the \setupinteraction commands are passed to Lua
side of ConTeXt to be written to the PDF file.

I can provide at the moment solutions which ensure the information
appear in the PDF but none of the is very elegant and I hope Hans
can help with a clean solution.

The first solution works around the grouping issue of the xmlsetups
environment and pushes the setting beyond the limit of it.

\startxmlsetups xml:meta
  \aftergrouped{\setupinteraction
[author={\xmltext{#1}{/author}},
 title={\xmltext{#1}{/title}}]}
\stopxmlsetups

The second solution makes the assignment to the \setupinteraction
command global to ensure they are kept even the environment ends,
int old MkII days ConTeXt provided a \startglobal environment to
do this but now I have rely on the primitives.

\startxmlsetups xml:meta
  \globaldefs\plusone
  \setupinteraction
[author={\xmltext{#1}{/author}},
 title={\xmltext{#1}{/title}}]
  \globaldefs\zerocount
\stopxmlsetups

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] missing metadata in LMTX

2024-03-03 Thread Pablo Rodriguez via ntg-context
Dear list,

this issue has been bugging me for some time:

  \startbuffer[demo]
  

   author
   title


  text

  
  \stopbuffer

  \starttext

  \startxmlsetups xml:initialize
\xmlsetsetup{#1}{code|meta|text}{xml:*}
  \stopxmlsetups

  \xmlregistersetup{xml:initialize}

  \startxmlsetups xml:doc
\xmlflush{#1}
  \stopxmlsetups

  \startxmlsetups xml:meta
\setupinteraction
  [author={\xmltext{#1}{/author}},
   title={\xmltext{#1}{/title}}]
  \stopxmlsetups

  \startxmlsetups xml:text
 \xmlflush{#1}
  \stopxmlsetups

  \setupinteraction[state=start]
  \xmlprocessbuffer{main}{demo}{}
  \stoptext

With LuaTeX, I get PDF metadata. With LuaMetaTeX, I cannot get them.

For both, I’m using current latest (from 2024.02.27 09:21).

Could anyone confirm the issue or explain me what I am missing?

Many thanks for your help,

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Japanese

2024-03-02 Thread Wolfgang Schuster

Emanuel Han schrieb am 01.03.2024 um 16:23:

Dear Wolfgang,

thank you for your valuable remarks. I integrated them, see corrected 
attached example.


Yes, correct layout examples exist. They're all showing vertical 
writing, but the rules and principles are exactly the same for 
horizontal writing.


 *
position of the headers and footers:
https://www.w3.org/TR/jlreq/#fig1_30


See my attached gongitsune.tex example how you can squeeze text in a 
very narrow header/footer.



 *
aligning lines to the text box: https://www.w3.org/TR/jlreq/#fig1_3


You can use the lines key for \setuplayout to let ConTeXt calculate the 
necessary value for the text height.



 *
protrusion of ruby: https://www.w3.org/TR/jlreq/#fig_ad1_6


You're getting this for free because ruby text doesn't take up vertical 
space, in case vertical text is working it would now stick into the 
margins as expected.


\starttext
\ruledhbox{a \ruby{x}{y} b}
\stoptext


In my previous mail, I wrote wrong amounts of lines. They should be 46 
lines on one page, while the actual example doesn't show the 46th line.


It would be important to identify the reason why only 24 characters 
are used to create a line when 25 could be used. Then we can develop a 
method to turn that mechanism off or circumvent it.

Quotation from https://www.w3.org/TR/jlreq:
/In principle, when composing a line with //ideographic (cl-19) 
<https://www.w3.org/TR/jlreq/#cl-19>//, //hiragana (cl-15) 
<https://www.w3.org/TR/jlreq/#cl-15>// and //katakana (cl-16) 
<https://www.w3.org/TR/jlreq/#cl-16>// characters, no extra spacing 
appears between their //character frame 
<https://www.w3.org/TR/jlreq/#term.character-frame>//. This is called 
solid setting (see //Figure 5 <https://www.w3.org/TR/jlreq/#fig1_8>//)./


1. ConTeXt has a mechanism to typeset Japanese texts.

2. There are flaws in the output it produces but this nothing which 
can't be fixed.


3. To fix the problems someone has to be passionate to fix them and 
we're willing to help here.


As you can see in my second example file japanese.tex there is a font 
feature to create half sized parentheses etc. which isn't supported yet 
by ConTeXt's mechanism for japanese and in case your willing to improve 
it this should be taken care of as well.


Wolfgang

\definefontfeature [halt] [halt=yes]

\starttext

\setscript[nihongo]

\begingroup \showmakeup[glyph,fontkern]

% \startfont[file:notosanscjkjpregular*default]「うわアぬすと狐め」と、どなりたてました。\stopfont
% 
% \startfont[file:notosanscjkjpregular*default]「「うわアぬすと狐め」と、「どなりたてました」。\stopfont
% 
% 
\startfont[file:notosanscjkjpregular*default,halt]「うわアぬすと狐め」と、どなりたてました。\stopfont
% 
% 
\startfont[file:notosanscjkjpregular*default,halt]「「うわアぬすと狐め」と、「どなりたてました」。\stopfont

\startfont[name:notosansjpregular*default]「うわアぬすと狐め」と、どなりたてました。\stopfont

\startfont[name:notosansjpregular*default]「「うわアぬすと狐め」と、「どなりたてました」。\stopfont

\startfont[name:notosansjpregular*default,halt]「うわアぬすと狐め」と、どなりたてました。\stopfont

\startfont[name:notosansjpregular*default,halt]「「うわアぬすと狐め」と、「どなりたてました」。\stopfont

\endgroup

\stoptext
% \definefontfeature [fixeddimensions] [dimensions={1,1.8,0}]
% 
% \definefontfamily [noto_japanese] [rm] [Noto Serif CJK JP] 
[features={default,fullprotrusion,fixeddimensions}]
% \definefontfamily [noto_japanese] [ss] [Noto Sans CJK JP]  
[features={default,fullprotrusion,fixeddimensions}]

% \definefontfamily [noto_japanese] [rm] [Noto Serif CJK JP] 
[features={default,fullprotrusion}]
% \definefontfamily [noto_japanese] [ss] [Noto Sans CJK JP]  
[features={default,fullprotrusion}]

\definefontfamily [noto_japanese] [rm] [Noto Serif JP] 
[features={default,fullprotrusion}]
\definefontfamily [noto_japanese] [ss] [Noto Sans JP]  
[features={default,fullprotrusion}]

\setupbodyfont
  [noto_japanese]

\setscript
  [nihongo]

\setupalign
  [hanging]

\setupindenting
  [yes,1em]

\setupinterlinespace
  [line=2\bodyfontsize,
   height=0.9,
   depth=0.1]

\setupruby
  [style={\switchtobodyfont[6pt]}]

\setuppagenumbering
  [alternative=doublesided,
   location=none]

\setuphead
  [title,subject]
  [align=middle]

\startsetups [header:rightpage]

  \startframed [
  frame=off,
  strut=no,
  height=\headerheight,
  offset=none,
  align=low,
  roffset=1em,
  ]

\getmarking[subject]

  \stopframed

\stopsetups

\startsetups [header:leftpage]

  \startframed [
  frame=off,
  strut=no,
  height=\headerheight,
  offset=none,
  align=low,
  loffset=1em,
  ]

\getmarking[title]

  \stopframed

\stopsetups

\startsetups [footer:rightpage]

  \startframed [
  frame=off,
  strut=no,
  height=\headerheight,
  offset=none,
  align=low,
  roffset=1em,
  ]

\prefixedpagenumber

  \stopframed

\stopsetups

\startsetups [footer:leftpage]

  \startframed [
  frame=off,
  strut=no,
  height=\headerheight,
  offset=none,
  align=low,
  loffset=1em,
  ]

\pre

[NTG-context] Wiki page : Mixed languages sample (French, Ancient Greek, Arabic, Chinese)

2024-03-01 Thread Jean-Pierre Delange

Dear List,

Several years ago I tried to write documents, mainly lectures, but also 
essays, in which I tried to make several languages (Romance and 
non-Romance) coexist.
Here below is an example of an attempt to compose an acceptable 
document, in the form of an exercise in which Arabic and Chinese are 
introduced into a document written in French. With footnotes and a few 
framed lines.


I submit this example for your perusal and ask you whether it could 
possibly appear on a wiki page devoted to the combination of 
non-European languages in the same text. In English translation, of course.


%We are giving below an example of a text written in a Latin language, 
in which we want to print here and there some text in ancient Greek, 
Arabic and Chinese.


\setuplanguage[fr][patterns={fr,agr}]

\mainlanguage[fr]

\setuplayout [backspace=40mm]

\setuppagenumbering[alternative=doublesided, location={header, inmargin}]

\setupmargindata[inmargin][location=inner, 
style={\ssx\setupinterlinespace[line=2.8ex]}]


\setupmarginframed[inmargin][align=right]

\setupbodyfontenvironment[default][em=italic]

% Use Theano Didot as Ancient Greek font

\definefallbackfamily[mainface][serif][Theano Didot][preset=range:greek, 
it={Old Standard Italic}, force=yes]


% Choose between Ipaexmincho font and NotoSansTC (Traditional Chinese)

%\definefallbackfamily [mainface] [rm] [ipaexmincho] 
[range=cjkunifiedideographs]


\definefallbackfamily [mainface] [rm] [notosanstc] 
[range=cjkunifiedideographs]


% Choose between two Arabic fonts

%\definefallbackfamily[mainface] [serif] [nafeesnastaleeq] [range=arabic]

\definefallbackfamily[mainface] [serif] [hussaininastaleeq] [range=arabic]

\definefontfamily [mainface] [serif] [GaramondNo8][sc=NewG8 Regular SC]

\definefontfamily [mainface] [sans] [FreeSans] [rscale=0.7]

\definefontfamily[mainface] [serif] [GFS Didot]

\setupbodyfont[mainface]

\setupindenting[1.5em]

\setupindenting[yes]

\setupcolors[state=start]


\defineframedtext

[MyFrame]

[before={\blank},

after={\blank},

frame=off,

background=MyFrame,

%width=\textwidth,

width=max,

height=fit,

style=italic]


\definelabel

[Définition]

[headstyle=\bf\smallcaps]


\startuseMPgraphic{MyFrame}

path b;

picture p;

%p := textext.rt("\white\Définition");

p := textext.rt("\white\framedtextparameter{Title}");

%p := textext.rt("\white\getvariable{text}{text1}");

p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight);

b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth;

fill OverlayBox withcolor lightgray; %\MPcolor{

fill b withcolor darkred;

draw bottomboundary OverlayBox withpen pencircle scaled 1pt withcolor

darkred;

draw topboundary OverlayBox withpen pencircle scaled 1pt withcolor

darkred;

draw p;

setbounds currentpicture to boundingbox currentpicture enlarged 2mm;

\stopuseMPgraphic


\defineoverlay

[MyFrame]

[\useMPgraphic{MyFrame}]



\setupwhitespace[medium]

\setupinterlinespace[line=3.2ex]


\setupitemize[each][margin=yes]


\setuphead[title][header=empty]


\setupheader[style={\sc}]

\setupfooter[style={\itxx}]

\setupheadertexts[Utilisation de plusieurs langues dans un même texte 
avec \ConTeXt][][][{\getmarking[section]}]


\setupfootertexts[][][][© J.-P. Delange, 2016 — La reproduction de ce 
texte est soumise à autorisation.]


\defineparagraphs[TwoColumns][n=2, align={hz, hanging}]

\setupparagraphs[TwoColumns][1][width=210pt, style=rm, align=left]

\starttext

\title{\ConTeXt, ou comment imprimer des langues non-romanes}

\section {\sc Préambule}


Lorsqu'il s'agit de proposer un document dans une langue nationale (le 
français), tout va bien. Lorsqu'il s'agit de rédiger en français un 
document un peu complexe, avec des citations — ou des références — dans 
une autre langue, qui en particulier n'a pas les mêmes exigences que le 
français, ni les mêmes {\em signes diacritiques} on se heurte à quelques 
difficultés. Les suites logicielles comme Microsoft Office ou 
LibreOffice ne manquent pas de puissance, mais à vrai dire, dès que nous 
entrons dans les exigences de l'édition professionnelle, qui consistent 
à présenter un texte lisible et enrichi (en notes, etc.), la situation 
devient vite techniquement assez pénible. La situation la plus courante 
que nous rencontrons dans les Lettres, en Philosophie, en Histoire, et 
plus généralement dans les Humanités, est celle d'un texte dans lequel 
il y a des citations d'auteurs grecs ou latin, avec des références en 
notes de bas de page, qui contiennent du grec. Cela pourrait être 
quelque chose comme ceci :


\blank\startnarrower[1*left,1*right]\tfx\setupinterlinespace

\noindent \quotation{Ἔφη γάρ οἱ Σωκράτη ἐντυχεῖν λελουμένον τε καὶ τὰς 
βλαύτας ὑποδεδεμένον, ἃ ἐκεῖνος ὀλιγάκις ἐποίει· καὶ ἐρέσθαι αὐτὸν ὅποι 
ἴοι οὕτω καλὸς γεγενημένος. καὶ τὸν εἰπεῖν ὅτι· Ἐπὶ δεῖπνον εἰς 
Ἀγάθωνος. χθὲς γὰρ αὐτὸν διέφυγον τοῖς ἐπινικίοις, φοβηθεὶς τὸν ὄχλον· 
ὡμολόγησα δ᾽ εἰς τήμερον παρέσεσθα

[NTG-context] Re: MetaPost lines in tables?

2024-02-22 Thread Henning Hraban Ramm

Am 22.02.24 um 18:35 schrieb Hans Hagen via ntg-context:

On 2/21/2024 7:47 PM, Henning Hraban Ramm wrote:

(I’m sure I already used that somewhere… Must document…)
ok, new feature dedicated to Hraban ... who then of course has to 
document it.


This is nice.
Thank you, will do.

(Actually I’m not much interested in dashed borders but to have lines 
affected by my sketchy style - courtesy of Aditya et al., see below)


Taco, will the syntax pages in the wiki update automatically to a newer 
version?



"""
\startuseMPgraphic{mp:sketchy}
input mp-sketch.mp;
sketchypaths;

sketch_amount := 1 + (uniformdeviate 2);
sketch_passes := 3;
sketch_segments := 2 + (uniformdeviate 3);
sketch_length := OverlayWidth / 3;

draw topboundary withpen pensquare withcolor lightgray;
naturalizepaths;
\stopuseMPgraphic

\defineoverlay[sketchylines][\useMPgraphic{mp:sketchy}]

\setupTABLE[r][first][style=bold]
\setupTABLE[r][each][
topoffset=1em,bottomoffset=0.5em,
background=sketchylines,
% would be nice if the background wouldn’t start at each column
]
\setupTABLE[c][each][frame=off]
\bTABLE[]
\bTR
\bTD{Stadt}\eTD
\bTD{Land}\eTD
\bTD{Fluss}\eTD
\eTR
\dorecurse{10}{
\bTR
\bTD\strut \eTD\bTD \eTD\bTD \eTD
\eTR
}
\eTABLE
"""


Hraban%D \module
%D   [   file=mp-sketch.mp
%Dversion=2021.05.13
%D  title=\CONTEXT\ \METAPOST\ graphics,
%D   subtitle=Sketch drawing,
%D author=Aditya Mahajan,
%D   date=\currentdate,
%D  copyright={Aditya Mahajan}]

%D This metapost module is inspired by a TeX.SE question:
%D http://tex.stackexchange.com/q/39296/323
%D
%D I thought that it would be fun to implement a similar feature in MetaPost.
%D
%D To use this package in MetaPost:
%D
%D \starttyping
%Dinput mp-sketch;
%D
%Dbeginfig(1)
%D  sketchypaths; % Make draw and fill sketchy
%D  ...
%D  naturalizepaths; % Restore the value of draw and fill
%D  ...
%Dendfig
%D \stoptyping
%D
%D The code is heavily inspired by Hans Hagen's Metafun macros.
%D
%D The macro \type{sketchypaths} is modeled after \type{visualizepaths} from
%D \filename{mp-tool}.

def sketchypaths =
let draw = sketchdraw ;
let fill = sketchfill ;
enddef ;

%D Check if \filename{mp-tool} is loaded
if not known context_tool :
  let normaldraw = draw;
  let normalfill = fill;

  def naturalizepaths =
  let fill = normalfill ;
  let draw = normaldraw ;
  enddef ;
fi

%D The variable \type{sketch_amount} determines the amount of randomness in the
%D drawing
numeric sketch_amount; sketch_amount := 0.75bp;

%D The variable \type{sketch_passes} determines the number of times the path
%D is drawn
numeric sketch_passes; sketch_passes := 1;

%D Based on \type{randomized}. Assumes p is path:
numeric sketch_segments; sketch_segments := 20;

%D Length (time) of line segments:
numeric sketch_length; sketch_length := 5mm;

primarydef p sketchrandomized s = (
if path p :
for t = 0 step 1/sketch_segments until 1-1/sketch_segments :
((point   (t*arclength(p)) on p) 
randomshifted s) .. controls
((postcontrol (t*arclength(p)) on p) 
randomshifted s) and
((precontrol  ((t+1/sketch_segments)*arclength(p)) on p) 
randomshifted s) ..
endfor
% TODO: beide Ansätze kombinieren. Eckpunkte erhalten!

%for t = 0 step sketch_length until arclength p:
%  (point (arctime t of p) of p) randomshifted s ..
%endfor
if cycle p : % funktioniert nicht
  cycle
else :
  ((point   (arclength(p)) on p) randomshifted 
s)
  %(point (arctime t of p) of p) randomshifted s
fi
else :
p
fi
) enddef ;



%D The macro \type{sketchdraw} draws the randomized path. The
%D \type{expr} ... \type{text} trick is copied from the definition of
%D \type{drawarrow}
def sketchdraw expr p =
   do_sketchdraw(p)
enddef;

def do_sketchdraw(expr p) text t =
  if (path p) :
  for i = 1 upto max(1,sketch_passes) :
normaldraw p
   sketchrandomized sketch_amount
   withtransparency ("multiply", 1/max(1,sketch_passes))
   t ;
  endfor;
  else :
  normaldraw p t;
  fi
enddef;

%D The macro \type{sketchfill} randomizes the path before filling it.
def sketchfill expr p =
  do_sketchfill(p)
enddef ;

def do_sketchfill(expr p) text t =
  if (path p) :
  for i = 1 upto max(1,sketch_passes) :
normalfill p
   sketchrandomized sketch_amount
   withtransparency ("multiply", 1/max(1,sketch_passes))
   t ;
  endfor;
  else :
  normalfill p t;
  fi
enddef;

picture NoisePattern;
NoisePattern := image(
  pickup pencircle xyscaled 0.5bp;
  numeric pmax ; pmax := 7 ;
  numeric x ; numeric y ;
for i = 1 upto pmax:
for j = 1 upto pmax:
  

[NTG-context] Re: Text in Margin

2024-02-19 Thread Henning Hraban Ramm

Am 19.02.24 um 14:14 schrieb Jeroen:
In a textbook I am looking to place a large left margin at every page of 
each chapter. At left printed pages a left margin and at right printed 
pages a right margin, so like a double sided construction. In this 
margin I would like to place:


1. Keywords and small descriptions to emphasize some text from the textflow
2. Figures
3. An expansion of a table that is placed in the main textflow but that 
needs to cover a wider range then the text area so it expands into the 
margin


What is the the easiest way to achieve this?


Generally, you use \inmargin, \inouter etc.

Additional to Wolfgang’s suggestions:

If you need sidefloats that cover not only the margin but should 
decrease the text width, you can move sidefloats into the margin like:


\startplacefigure[title={},location=outer]
\offset[rightoffset=-\marginwidth]{\externalfigure[cow][width=0.5\textwidth]}
\stopplacefigure

Beware: it doesn’t work well with captions (I’ve still no solution that 
always works), and \offset understands only rightoffset and leftoffset, 
not outeroffset.
The example is on a right page; you must “pull” the image into the 
margin (rightmargin with negative value), if you try „pushing“ with 
leftoffset=\marginwidth, the text flow is wrong.


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Two bugs with descriptions in ConTeXt.

2024-02-13 Thread Wolfgang Schuster

SirColeman via ntg-context schrieb am 13.02.2024 um 22:04:
The first bug is that descriptions interfere with the counters, 
resulting in the peculiar behavior demonstrated in the resulting PDF.


Still no bug and there is no need to create your own counter because 
enumerations exist which are descriptions with a counter.


Unless I'm mistaken, I think it happens because the head of the 
description is evaluated twice, thus incrementing the counter 
twice---at least, that's the only explanation for how the number is 
incremented by 2 each time. Further, this issue seems to persist 
whether we're using macros or writing \incrementcounter directly.


The solution is to either make sure that the head of descriptions is 
evaluated only once, or document that text placed as the head of 
descriptions is meant to be evaluated twice, if there's a good reason 
for doing so. Of course, this silly example of incrementing counters 
can be subdued by placing the \incrementcounter directly in the after 
option when customizing descriptions. But it demonstrates the issue.


What you're supposed to do here is to increment the counter *before* you 
use the counter value.


As you guessed the content of the title is evaluated multiple times to 
get the width of the description title, in cases where a counter is 
incremented in such a case (very common when you have counters in a 
table cell) you use the trialtypesetting mode to increment only once.


I've tried to make the examples given be as varied as possible, 
demonstrating the different ways in which descriptions interact with 
the counter.


The second bug is that descriptions, or at least that's my intuitive 
expectation, shouldn't interfere with the bullets of items. I expect 
that the bullet stays where it is, and the description is placed next 
to it. But what happens is that the bullet is shifted to the right, 
making it overlap with the description's head, which isn't pretty.


Is this even a real world example?

The reason why the bullet points are at the wrong position is that 
descriptions and items use the same mechanism to set the text offset on 
the left and right sides and when you combine both mechanism the values 
are added. In case you you have a document where a descriptions appear 
as part of an item I suggest to use a different alternative (e.g. 
serried) for the description layout.


Wolfgang

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Section numbering does not work

2024-02-13 Thread Oliver Marugg



> Am 13.02.2024 um 16:54 schrieb Wolfgang Schuster 
> :
> 
> Oliver Marugg schrieb am 13.02.2024 um 00:17:
>> Hi
>> Section numbering does not work until I remove \startbackmatter 
>> \stopbackmatter. I had a longer text file and I stripped it down until I 
>> found this?
>> Greets Oliver
>> Running freshly installed context ARM64 on m1 and updated it via sh 
>> install.sh on ARM64 macos 14.3.1:
>> 
>> context --version
>> mtx-context | ConTeXt Process Management 1.05
>> mtx-context |
>> mtx-context | main context file: 
>> /Applications/ConTeXtStandalone/tex/texmf-context/tex/context/base/mkiv/context.mkiv
>> mtx-context | current version: 2024.01.24 22:39
>> mtx-context | main context file: 
>> /Applications/ConTeXtStandalone/tex/texmf-context/tex/context/base/mkxl/context.mkxl
>> mtx-context | current version: 2024.01.24 22:39
>> --
>> Stripped down MWE:
>> \setuppapersize[A4] [A4]
>> \starttext
>> \completecontent[criterium=all]
>> % ToC
>> \page
>> \chapter{CHAP 1}
>> TEXT
>> \startbackmatter
>> \startchapter[title=Literature]
>> \placelistofpublications
>> \stopchapter
>> \stopbackmatter
>> \stoptext
> 
> Besides enabling numbering for the backpart you can use the appendix block 
> which has numbering by default.
> 
> %\defineconversionset[appendix:default][n]
> 
> \starttext
> 
> \startfrontmatter
>  \completecontent[criterium=all]
> \stopfrontmatter
> 
> \startbodymatter
>  \startchapter[title=CHAP 1]
>  TEXT
>  \stopchapter
> \stopbodymatter
> 
> \startappendices
>  \startchapter[title=Literature]
>  \placelistofpublications
>  \stopchapter
> \stopappendices
> 
> \stoptext
> 
> Wolfgang



Thanks Wolfgang for your practical hint. 

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Section numbering does not work

2024-02-13 Thread Wolfgang Schuster

Oliver Marugg schrieb am 13.02.2024 um 00:17:

Hi

Section numbering does not work until I remove \startbackmatter 
\stopbackmatter. I had a longer text file and I stripped it down until I found 
this?

Greets Oliver


Running freshly installed context ARM64 on m1 and updated it via sh install.sh 
on ARM64 macos 14.3.1:

context --version
mtx-context | ConTeXt Process Management 1.05
mtx-context |
mtx-context | main context file: 
/Applications/ConTeXtStandalone/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2024.01.24 22:39
mtx-context | main context file: 
/Applications/ConTeXtStandalone/tex/texmf-context/tex/context/base/mkxl/context.mkxl
mtx-context | current version: 2024.01.24 22:39
--

Stripped down MWE:

\setuppapersize[A4] [A4]
\starttext
\completecontent[criterium=all]
% ToC
\page
\chapter{CHAP 1}
TEXT
\startbackmatter
\startchapter[title=Literature]
\placelistofpublications
\stopchapter
\stopbackmatter
\stoptext


Besides enabling numbering for the backpart you can use the appendix 
block which has numbering by default.


%\defineconversionset[appendix:default][n]

\starttext

\startfrontmatter
  \completecontent[criterium=all]
\stopfrontmatter

\startbodymatter
  \startchapter[title=CHAP 1]
  TEXT
  \stopchapter
\stopbodymatter

\startappendices
  \startchapter[title=Literature]
  \placelistofpublications
  \stopchapter
\stopappendices

\stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Section numbering does not work

2024-02-13 Thread Oliver Marugg
Many thanks Taco, that works indeed;-)


> Am 13.02.2024 um 09:29 schrieb Taco Hoekwater :
> 
> 
> 
>> On 13 Feb 2024, at 00:17, Oliver Marugg  wrote:
>> 
>> Hi 
>> 
>> Section numbering does not work until I remove \startbackmatter 
>> \stopbackmatter. I had a longer text file and I stripped it down until I 
>> found this?
> 
> IIRC :
> 
> \setupsectionblock[backpart][number=yes]
> 
> Best wishes,
> Taco
> 
>> Greets Oliver
>> 
>> 
>> Running freshly installed context ARM64 on m1 and updated it via sh 
>> install.sh on ARM64 macos 14.3.1:
>> 
>> context --version
>> mtx-context | ConTeXt Process Management 1.05
>> mtx-context |
>> mtx-context | main context file: 
>> /Applications/ConTeXtStandalone/tex/texmf-context/tex/context/base/mkiv/context.mkiv
>> mtx-context | current version: 2024.01.24 22:39
>> mtx-context | main context file: 
>> /Applications/ConTeXtStandalone/tex/texmf-context/tex/context/base/mkxl/context.mkxl
>> mtx-context | current version: 2024.01.24 22:39
>> --
>> 
>> Stripped down MWE:
>> 
>> \setuppapersize[A4] [A4] 
>> \starttext
>> \completecontent[criterium=all]
>> % ToC
>> \page
>> \chapter{CHAP 1}
>> TEXT
>> \startbackmatter
>> \startchapter[title=Literature]
>> \placelistofpublications
>> \stopchapter
>> \stopbackmatter
>> \stoptext
>> ___
>> If your question is of interest to others as well, please add an entry to 
>> the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / 
>> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
>> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
>> archive  : https://github.com/contextgarden/context
>> wiki : https://wiki.contextgarden.net
>> ___
> 
> — 
> Taco Hoekwater  E: t...@bittext.nl
> genderfluid (all pronouns)
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Re: Section numbering does not work

2024-02-13 Thread Taco Hoekwater


> On 13 Feb 2024, at 00:17, Oliver Marugg  wrote:
> 
> Hi 
> 
> Section numbering does not work until I remove \startbackmatter 
> \stopbackmatter. I had a longer text file and I stripped it down until I 
> found this?

IIRC :

\setupsectionblock[backpart][number=yes]

Best wishes,
Taco

> Greets Oliver
> 
> 
> Running freshly installed context ARM64 on m1 and updated it via sh 
> install.sh on ARM64 macos 14.3.1:
> 
> context --version
> mtx-context | ConTeXt Process Management 1.05
> mtx-context |
> mtx-context | main context file: 
> /Applications/ConTeXtStandalone/tex/texmf-context/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2024.01.24 22:39
> mtx-context | main context file: 
> /Applications/ConTeXtStandalone/tex/texmf-context/tex/context/base/mkxl/context.mkxl
> mtx-context | current version: 2024.01.24 22:39
> --
> 
> Stripped down MWE:
> 
> \setuppapersize[A4] [A4] 
> \starttext
> \completecontent[criterium=all]
> % ToC
> \page
> \chapter{CHAP 1}
> TEXT
> \startbackmatter
> \startchapter[title=Literature]
> \placelistofpublications
> \stopchapter
> \stopbackmatter
> \stoptext
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

— 
Taco Hoekwater  E: t...@bittext.nl
genderfluid (all pronouns)


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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


[NTG-context] Section numbering does not work

2024-02-12 Thread Oliver Marugg
Hi 

Section numbering does not work until I remove \startbackmatter 
\stopbackmatter. I had a longer text file and I stripped it down until I found 
this?

Greets Oliver


Running freshly installed context ARM64 on m1 and updated it via sh install.sh 
on ARM64 macos 14.3.1:

context --version
mtx-context | ConTeXt Process Management 1.05
mtx-context |
mtx-context | main context file: 
/Applications/ConTeXtStandalone/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2024.01.24 22:39
mtx-context | main context file: 
/Applications/ConTeXtStandalone/tex/texmf-context/tex/context/base/mkxl/context.mkxl
mtx-context | current version: 2024.01.24 22:39
--

Stripped down MWE:

\setuppapersize[A4] [A4] 
\starttext
\completecontent[criterium=all]
% ToC
\page
\chapter{CHAP 1}
TEXT
\startbackmatter
\startchapter[title=Literature]
\placelistofpublications
\stopchapter
\stopbackmatter
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___


  1   2   3   4   5   6   7   8   9   10   >