[NTG-context] Re: defining hashtag simulator

2024-05-20 Thread seyal . zavira
Thanks.

What if we want the text to be copied when it is clicked?
I found these link on the stack site for this
https://tex.stackexchange.com/questions/174637/copy-to-clipboard-feature-in-pdf-output/545107#545107

also i defined this:
\def\Hashtag#1{
\hbox{\tfa\ctxlua{
str = "#1"
replacespace = string.gsub(str," ","_")

context.letterhash()
context(replacespace)
}
}
}
\starttext
\Hashtag{hello}
\stoptext

i used hbox for making phrase unbreakable.

How can you put all the code in the one Lua function and not need to put hbox 
or goto function outside of Lua?
___
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: Special charakter

2024-05-18 Thread BPJ
For those characters which your OS doesn't make it easy to input:

https://jkorpela.fi/fui.html8

Most OSes also have apps for this.

Den lör 18 maj 2024 17:36Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> skrev:

> Thomas Meyer schrieb am 18.05.2024 um 14:53:
>
> Thanks to all of you for your hints and comments!
> I thought \l does work, why \L does not.
> To type \L is faster than changing the keyboard language when I write in
> German normally.
>
>
> 1. Hans made a while ago the decision to reduce the number of commands to
> output certain characters and create accented characters. To still be able
> to create them he added the \with... commands.
>
> 2. The reason why \L doesn't produce Ł are the following lines from
> chem-str.mkxl which nils the values of all listed commands.
>
> \permanent\let\X\relax
> \permanent\let\T\relax
> \permanent\let\B\relax
> \permanent\let\L\relax
> \permanent\let\M\relax
> \permanent\let\R\relax
>
> The same thing happens for the \CC commands which gets reset in
> tabl-com.mkxl
>
> \permanent\protected\lettonothing\CC
>
> 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
>
> ___
>
___
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: Special charakter

2024-05-18 Thread Wolfgang Schuster

Thomas Meyer schrieb am 18.05.2024 um 14:53:

Thanks to all of you for your hints and comments!
I thought \l does work, why \L does not.
To type \L is faster than changing the keyboard language when I write 
in German normally.


1. Hans made a while ago the decision to reduce the number of commands 
to output certain characters and create accented characters. To still be 
able to create them he added the \with... commands.


2. The reason why \L doesn't produce Ł are the following lines from 
chem-str.mkxl which nils the values of all listed commands.


\permanent\let\X\relax
\permanent\let\T\relax
\permanent\let\B\relax
\permanent\let\L\relax
\permanent\let\M\relax
\permanent\let\R\relax

The same thing happens for the \CC commands which gets reset in 
tabl-com.mkxl


\permanent\protected\lettonothing\CC

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: Wiki - test/proposal to further clarify documentation

2024-05-18 Thread Bruce Horrocks
On 17 May 2024, at 21:40, garu...@azules.eu wrote:
> 
> I have tested on 2 pages :
> - https://wiki.contextgarden.net/Sciences (only mathematics part)
> - https://wiki.contextgarden.net/Fonts
> 
> After these tests, I think this may help users to find their way around the 
> various sources of documentation :
> In one small table he/she has an overview of the documentation for a given 
> topic,  :
> - the few key tutorials
> - link to one "main wiki page" about the topic
> - the few key manuals
> - the reference for commands

The fonts page is a lot better than before[1], IMHO. I would prefer the table 
were 90% width rather than 50 but that is minor.

So is the plan to go through each of the main headings in the left side-bar and 
make the same type of change?

> 
> I'm not sure I've selected the few documents that are considered by the 
> community as the key tutorials.
> Thanks for your feedback again.

I don't think that is a problem - the Wiki can be updated by others as long as 
the layout/structure of the page is clear so people know where to add links.

> PS : in order to benefit from mediawiki page organization features, I moved 
> some pages, for example
> wiki.contextgarden.net/blablabla
> ==> wiki.contextgarden.net/Topic/blablabla


[1] Previous style for reference: 
<https://web.archive.org/web/20231116125758/https://wiki.contextgarden.net/Fonts>
—
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] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2024-05-17 Thread Cron Daemon
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 context/latest/
 context/latest/cont-lmt.zip
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 general/manuals/
 general/manuals/pdfmerge.pdf
 general/qrcs/
 general/qrcs/setup-mapping-en.pdf
 general/qrcs/setup-mapping-it.pdf
 
 sent 185,981 bytes  received 43,500,122 bytes  2,647,642.61 bytes/sec
 total size is 581,971,883  speedup is 13.32


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2024-05-17.17
248030043   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-17.17/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-17.17/current
374779456   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-17.17
374779456   total
___
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] expansion question

2024-05-15 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

\setupinteraction[state=start]
\setupattachments[method=hidden]
\protected\def\PDFfile[#1]%
  {\cldcontext{file.addsuffix("#1", "pdf")}}
\starttext
  \doifelsefile{\PDFfile[xml-mkiv]}
{yes}{no}
  \attachment[file={\PDFfile[xml-mkiv]}]
\stoptext

I need the \PDFfile definition to be \protected for only one case (that
I cannot reproduce in my sample).

Is there any way to define an unprotected command and invoke it as
protected only for a particular case?

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: what am I missing in the typescript?

2024-05-15 Thread Wolfgang Schuster

madiazm.eo...@gmail.com schrieb am 15.05.2024 um 14:01:

indeed! thanks a lot, I'm trying different things since yesterday and got no 
clues...

I just adapted it to the other script that works good (and there reads 
[SerifRegular]...[SerifItalic]...[SerifBold]...

why is no Regular needed here? (just trying to learn)


Below is a snippet from font-unk.mkxl where you can see which names are 
mapped
to a certain font alternative, e.g. \tf (the normal upright style) 
expect a fontsynonym

with the name Serif.

\definebodyfont [default] [rm]
  [\s!tf=Serif    sa 1,
   \s!bf=SerifBold    sa 1,
   \s!it=SerifItalic  sa 1,
   \s!sl=SerifSlanted sa 1,
   \s!bi=SerifBoldItalic  sa 1,
   \s!bs=SerifBoldSlanted sa 1,
   \s!sc=SerifCaps    sa 1] % obsolete, is a font feature now

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] index sort order (de)

2024-05-14 Thread Henning Hraban Ramm

Hi,
I checked the German index sorting rules, and as far as I can tell, all 
of them are somewhat wrong.


– de, default, or no setting (just mainlanguage de)
– Duden
- DIN 5007-1(:2005)
- DIN 5007-2(:1996)
- de-AT

IMO, "Duden" is obsolete, should be the same as default; it makes no 
sense to have a default setting that doesn’t adhere to the official 
rules. If Û#m not mistaken it’s also the same as DIN 5007-1; maybe there 
was a difference before 2005. (DIN 5007-2 and de-AT have their uses.)


The order of umlauts etc. should be ok.

[ß]
In tex/context/base/mkiv/sort-lan.lua, ß is replaced by s, while it 
should be sorted like ss in default and both DIN versions. (de-AT sorts 
ss after ß.)


[upper-/lowercase]
While casing is not mentioned in Wikipedia 
(https://de.wikipedia.org/wiki/Alphabetische_Sortierung), Duden „Satz 
und Korrektur“ says:


Uppercase characters get sorted the same as lowercase (i.e. mixed), but 
if both appear, lowercase comes first.


ATM all German settings sort lowercase behind uppercase.



Generally, default method seems to be not "default" but "before". Does 
this make sense?


If we look at the method presets, there’s none for {zm,pm,zc,zm,uc} 
(upper like lower, ignore diacritics – basic default for German).


"""
\mainlanguage[de]
\setupregister[index][language=de]

\starttext

\index{Apfel}
\index{Äpfel}
\index{apfel}
\index{äpfel}
\index{aepfel}
\index{Aepfel}
\index{Ápfel}
\index{ápfel}

\page
\completeindex

\stoptext
"""

default order should be:

aepfel
Aepfel
apfel
Apfel
äpfel
Äpfel
ápfel
Ápfel
aqua

DIN 5007-2 sorts like:

aepfel
Aepfel
äpfel
Äpfel
apfel
Apfel
ápfel
Ápfel
aqua

de-AT sorts like:

aepfel
Aepfel
apfel
Apfel
aqua
äpfel
Äpfel
ápfel
Ápfel




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] [installation] "unzipping" gives 0K files on windows

2024-05-14 Thread yashpalgoyal1304+ntgcontext
hi! greetings of the day.

-
### QoL improvements for installation

* on win10 22h2 pc, i am facing problems (attached below) in installing context 
via [`context-win64.zip`].
* so, i had to run the install.bat again and again. 
* due to which the same step of "fetching 
'http://lmtx.pragma-ade.com/install-lmtx//texmf.zip'" and "fetching 
'http://lmtx.pragma-ade.com/install-lmtx//texmf-context.zip'" was performed 
repeatedly
* this consumes lots of time, will & internet bandwidth 
& takes away the focus from other important part of installation

So, 
1. can `install.bat` (or whatever responsible) pick these zips from current 
directory if these exist there?
of course, it should match their hash from the internet for verifying that 
these are same zips it needs.
2. rather than blindly removing the zips after (trying to) unzip, the 
`mtx-install.lua` should confirm 
if the "unzipping" hasn't resulted in these empty 0B files - as it seems some 
fundamental issue on windows
(description & context attached below)

-
### version number

i understand that there's [only a 'latest' version, ... no stable 
release][context_history], 
* but still where is the version number for this latest shown on web?
* i am looking for a plaintext way, i.e. which can be accessed from anywhere 
without any install. 
* so, it might be via some "Releases" section on an html webpage, or some file 
like xml, yml, json, etc containing release versions listing

also, please don't use `:` colon or ` ` spaces in version as various package 
managers use version as directory names.
so, my suggested one is: `2025.01.08.T1320` i.e. `.MM.dd.THHmm`

i found various places which mentioned versions, but none of those mentioned 
"latest stable" version:
* news on [main_page]: `The Wiki's ConTeXt installation is on version ConTeXt 
2024.01.08 11:23 LMTX.`
again, it shows the "wiki's context installation". not the release.
* installation wiki: [check_installation]: `mtx-context | current version: 
2024.04.01 08:59`
it is aimed at illustration & outdated. no reason for it to be kept up-to-date.
* [pragma-ade] shows: `2024-05-11 12:57 | 118925584`
but it seems for the sources i guess? and it uses `-` dashes as date separator 
rather than dots at other places above. 
also, what does last column show with '118925584'?


-
### details of the problem:

* on running `context-win64/install.bat` even as admin & finishing the 
procedure, the `context --version` is not running. 
* the `texmf` directory tree matches [`texmf.zip`] (~52MB), but rather than 
`fonts`, `web2c` being dirs, those appear as files of 0B
* similarly the `texmf-context` dir tree matches [`texmf-context.zip`] 
(~115MB), but again, all the `colors`, `context`, `doc`, `tex`, `web2c` are 
shown as 0B files rather than being dirs
* also the `texmf-win64/bin/` contains a link-file (broken) of 0B with its name 
in chinese: `畬浡瑥瑡硥攮數`

just for records:
i have already enabled the developer tools on windows since a long time ago. 
so, creating filesystem links should work here already.

here's exerpt from the `install.bat` run's console output for "unzipping":

```
mtx-install | fetching 'http://lmtx.pragma-ade.com/install-lmtx//texmf.zip'
mtx-install | unzipping 'texmf.zip'
  70 files of  706 done,6960406 bytes, 0.083 seconds
 140 files of  706 done,   10371456 bytes, 0.151 seconds
 210 files of  706 done,   14124718 bytes, 0.234 seconds
 280 files of  706 done,   19504148 bytes, 0.318 seconds
 350 files of  706 done,   24662280 bytes, 0.401 seconds
 420 files of  706 done,   33169752 bytes, 0.484 seconds
 490 files of  706 done,   40851921 bytes, 0.583 seconds
 560 files of  706 done,   47678981 bytes, 0.672 seconds
 630 files of  706 done,   68347030 bytes, 0.818 seconds
 700 files of  706 done,   85872915 bytes, 0.943 seconds
 706 files of  706 done,   86963093 bytes, 0.963 seconds
mtx-install | fetching 
'http://lmtx.pragma-ade.com/install-lmtx//texmf-context.zip'
mtx-install | unzipping 'texmf-context.zip'
 533 files of 5333 done,   88905129 bytes, 0.807 seconds
1066 files of 5333 done,   96885926 bytes, 1.333 seconds
1599 files of 5333 done,  116688474 bytes, 1.911 seconds
2132 files of 5333 done,  125260237 bytes, 2.375 seconds
2665 files of 5333 done,  142877653 bytes, 2.890 seconds
3198 files of 5333 done,  152403593 bytes, 3.375 seconds
3731 files of 5333 done,  160173210 bytes, 3.854 seconds
4264 files of 5333 done,  170072731 bytes, 4.333 seconds
4797 files of 5333 done,  176877135 bytes, 4.791 seconds
5330 files of 5333 done,  183560838 bytes, 5.270 seconds
5333 files of 5333 done,  183587012 bytes, 5.270 seconds
mtx-install | installing tex/texmf-win64, 5 files
mtx-install | skipping tex/texmf-win64/bin/context.exe
mtx-install | new  :  31 % : 1315 : tex/texmf-win64/bin/context.lua
mtx-install | new  :  62 % :  3075584 : 
tex/te

[NTG-context] Re: applying style to frame content

2024-05-14 Thread Wolfgang Schuster

seyal.zav...@gmail.com schrieb am 14.05.2024 um 09:57:

Hi all,

what is the better way to apply a metapost effect to a piece of any structure 
text
for example when defining footnotes, frames , etc.
i use this method for frames:

this is my MWE:
\defineframed[Myframe][frame=off]
\starttexdefinition spaces protected Mystyle #1
\startMPcode
  picture tt ; tt:= lmt_outline [
kind = "path",
text = "\Myframe{#1}",
  ];
fill
  for i within tt : pathpart i && endfor cycle
  withshademethod "linear"
  withshadedirection up
  withshadecolors (red,blue);
\stopMPcode
\stoptexdefinition

\starttext
\Mystyle{hello}
\stoptext


but what is the proper way if i want to use this style as simple as \tfb in 
definition of this structures? such as:
\defineframed[Myframe][frame=off,style=\tfb\Mystyle,]


You can't apply commands which take arguments (like \Mystyle) to pass 
content fro TeX to Metapost with the style key. The only solution here 
is to create a new commands which takes the content as argument and 
combine the frame and shade in the command definition.


\defineframed[Myframe][frame=off]

\starttexdefinition spaces protected 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
\stoptexdefinition

\define[1]\Mycommand
  {\Myframe{\Mystyle{#1}}}

% \define[1]\Mycommand
%   {\Mystyle{\Myframe{#1}}}

\starttext
\Mycommand{hello}
\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] applying style to frame content

2024-05-14 Thread seyal . zavira
Hi all,

what is the better way to apply a metapost effect to a piece of any structure 
text
for example when defining footnotes, frames , etc.
i use this method for frames:

this is my MWE:
\defineframed[Myframe][frame=off]
\starttexdefinition spaces protected Mystyle #1
   \startMPcode
 picture tt ; tt:= lmt_outline [
   kind = "path",
   text = "\Myframe{#1}",
 ];
   fill
 for i within tt : pathpart i && endfor cycle
 withshademethod "linear"
 withshadedirection up
 withshadecolors (red,blue);
   \stopMPcode
\stoptexdefinition

\starttext
\Mystyle{hello}
\stoptext


but what is the proper way if i want to use this style as simple as \tfb in 
definition of this structures? such as:
\defineframed[Myframe][frame=off,style=\tfb\Mystyle,]

Thanks in advance.
___
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] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2024-05-13 Thread Cron Daemon
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 context/latest/
 context/latest/cont-lmt.zip
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 
 sent 180,450 bytes  received 40,343,045 bytes  2,794,723.79 bytes/sec
 total size is 582,476,037  speedup is 14.37


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2024-05-13.21
248566476   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-13.21/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-13.21/current
375315889   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-13.21
375315889   total
___
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: Metapost limitation ?

2024-05-12 Thread Mikael Sundqvist
Hi,

On Sun, May 12, 2024 at 6:24 PM Fabrice Couvreur <
fabrice1.couvr...@gmail.com> wrote:
>
> With Okular, it works !

Very good. You can still try the thing below:

\startluacode
  local exp = math.exp
  local N   = 1000
  local xstep  = 1.6/N
  local ystep  = 1.8/N
  local xmin   = 0.3
  local ymin   = 0.4

  local function f(x,y)
local x = xstep*x - xmin
local y = ystep*y - ymin
local z = x + exp(-60*x) - y
if z > 0 then
  return '1'
else
  return '0'
end
  end

  potrace.setbitmap("mybitmap", potrace.contourplot(N,N,f))
\stopluacode

\startMPpage[offset=1dk]
  path p ; p := lmt_potraced [
stringname = "mybitmap",
value  = "1",
tolerance  = 0.1,
threshold  = 0.2,
optimize   = true,
  ] ;
  p := p xsized 10cm ;
  draw p withpen pencircle scaled 5 withcolor "darkblue" ;
  drawpoints p withcolor "orange" ;
  drawpointlabels p ;
  p := subpath(6,19) of p ;
  draw p withpen pencircle scaled 3 withcolor "yellow" ;
\stopMPpage

Another thing, Hans added nocycle, so you can write your loop if you want
to use it as something like

  def compute_curve(suffix f)(expr xmin, xmax, xinc) =
  for x=xmin step xinc until xmax:
   (x,f(x)) ..
  endfor nocycle ;
  enddef;

Then you do not need to think about the first and/or last point separately.
___
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: Metapost limitation ?

2024-05-12 Thread Fabrice Couvreur
Sorry for the comment !
I use Evince

Le dim. 12 mai 2024 à 17:30, Hans Hagen  a écrit :

> On 5/12/2024 3:57 PM, Fabrice Couvreur wrote:
> > Hi,
> > When I want to draw the curve which corresponds to n=60 (blue curve), it
> > doesn't seem possible: I don't understand.
> > Thanks
> > Fabrice
> >
> >   \startMPpage[offset=1DK]
> >
> >numeric u;
> >u = 6cm;
> >
> >interim linejoin := mitered;
> >interim ahangle := 30;
> >
> >path xx, yy;
> >xx = ( (-0.3,0) -- 1.4 right) scaled u;
> >yy = ( (-0.1,0) -- 1.8 right) rotated 90 scaled u;
> >
> >def compute_curve(suffix f)(expr xmin, xmax, xinc) =
> >((xmin,f(xmin))
> >for x=xmin+xinc step xinc until xmax:
> > .. (x,f(x))
> >endfor)
> >enddef;
> >
> >
> >for i = 1 upto 4:
> >
> >vardef f(expr x) =x+exp(-i*x) enddef;
> >
> >path curve;
> >
> >curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;
> >
> >draw curve;
> >
> >endfor;
> >
> >vardef f(expr x) =x+exp(-6*x) enddef;
> >
> >path curve;
> >
> >curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;
> >
> >draw curve;
> >
> >vardef f(expr x) =x+exp(-15*x) enddef;
> >
> >path curve;
> >
> >curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;
> >
> >draw curve;
> >
> >
> >vardef f(expr x) =x+exp(-60*x) enddef;
> >
> >path curve;
> >
> >curve = compute_curve(f,-0.4,1.4,0.0001) scaled u; ->>>>> not
> > drawn
>
> best put a comment before the ->>>>>>>
>
> >draw curve withcolor blue;
> >
> >
> >drawarrow (0,0) -- (u,0) withpen pencircle scaled 1.5bp;
> >drawarrow (0,0) -- (0,u) withpen pencircle scaled 1.5bp;
> >
> >
> >label.urt("A",(0,1u));
> >
> >draw xx;
> >draw  yy;
> >
> >draw (1u,0) -- (1u,1.8u);
> >
> >
> >label.llft("0",(0,0));
> >
> > vardef mark_y_axis(expr value, name) =
> >  save p; pair p; p = value * u * up;
> >  draw (left--right) scaled 1 shifted p;
> >  label.lft(name, p shifted 2 left);
> >enddef;
> >
> >for a = 1 upto 1:
> >  mark_y_axis(a, "");
> >endfor
> >
> > mark_y_axis(1, "$1$");
> >
> >
> >   vardef mark_x_axis(expr value, name) =
> > save p; pair p; p = value * u * right;
> > draw (up--down) scaled 1 shifted p;
> > label.bot(name, p shifted 2 down);
> >   enddef;
> >
> >   for a = 1 upto 1:
> > mark_x_axis(a, "");
> >   endfor
> >
> >   mark_x_axis(1, "$1$");
> >
> >
> >path rectangle;
> >rectangle = (-0.3u,-0.4u) -- (1.3u,-0.4u) -- (1.3u,-0.4u) --
> > (1.3u,1.4u) -- (-0.3u,1.4u)--cycle;
> >
> >clip currentpicture to rectangle;
> >   \stopMPpage
> >
> your exp usage:
>
>exp(-60*-0.4)
>
> if you see what huge numbers come out of that, like
>
> -51.006602 11100558579.857309 l
> -50.989594 11034154639.123087 l
> -50.972586 10968147929.149401 l
> -50.955579 10902536073.687559 l
> -50.938571 10837316710.703716 l
>
> you could imagine a viewer crapping out on that because no matter what
> one clips it still is 'kind of drawn', so what viewer do you use?
>
> 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
>
> ___
>
___
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: Metapost limitation ?

2024-05-12 Thread Hans Hagen

On 5/12/2024 3:57 PM, Fabrice Couvreur wrote:

Hi,
When I want to draw the curve which corresponds to n=60 (blue curve), it 
doesn't seem possible: I don't understand.

Thanks
Fabrice

  \startMPpage[offset=1DK]

           numeric u;
           u = 6cm;

           interim linejoin := mitered;
           interim ahangle := 30;

           path xx, yy;
           xx = ( (-0.3,0) -- 1.4 right) scaled u;
           yy = ( (-0.1,0) -- 1.8 right) rotated 90 scaled u;

           def compute_curve(suffix f)(expr xmin, xmax, xinc) =
               ((xmin,f(xmin))
               for x=xmin+xinc step xinc until xmax:
                    .. (x,f(x))
               endfor)
           enddef;


           for i = 1 upto 4:

           vardef f(expr x) =x+exp(-i*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

           draw curve;

           endfor;

           vardef f(expr x) =x+exp(-6*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

           draw curve;

           vardef f(expr x) =x+exp(-15*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

           draw curve;


           vardef f(expr x) =x+exp(-60*x) enddef;

           path curve;

           curve = compute_curve(f,-0.4,1.4,0.0001) scaled u; ->>>>> not 
drawn


best put a comment before the ->>>>>>>


           draw curve withcolor blue;


           drawarrow (0,0) -- (u,0) withpen pencircle scaled 1.5bp;
           drawarrow (0,0) -- (0,u) withpen pencircle scaled 1.5bp;


           label.urt("A",(0,1u));

           draw xx;
           draw  yy;

           draw (1u,0) -- (1u,1.8u);


           label.llft("0",(0,0));

            vardef mark_y_axis(expr value, name) =
             save p; pair p; p = value * u * up;
             draw (left--right) scaled 1 shifted p;
             label.lft(name, p shifted 2 left);
           enddef;

           for a = 1 upto 1:
             mark_y_axis(a, "");
           endfor

            mark_y_axis(1, "$1$");


          vardef mark_x_axis(expr value, name) =
            save p; pair p; p = value * u * right;
            draw (up--down) scaled 1 shifted p;
            label.bot(name, p shifted 2 down);
          enddef;

          for a = 1 upto 1:
            mark_x_axis(a, "");
          endfor

          mark_x_axis(1, "$1$");


           path rectangle;
           rectangle = (-0.3u,-0.4u) -- (1.3u,-0.4u) -- (1.3u,-0.4u) -- 
(1.3u,1.4u) -- (-0.3u,1.4u)--cycle;


           clip currentpicture to rectangle;
          \stopMPpage


your exp usage:

  exp(-60*-0.4)

if you see what huge numbers come out of that, like

-51.006602 11100558579.857309 l
-50.989594 11034154639.123087 l
-50.972586 10968147929.149401 l
-50.955579 10902536073.687559 l
-50.938571 10837316710.703716 l

you could imagine a viewer crapping out on that because no matter what 
one clips it still is 'kind of drawn', so what viewer do you use?


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] Metapost limitation ?

2024-05-12 Thread Fabrice Couvreur
Hi,
When I want to draw the curve which corresponds to n=60 (blue curve), it
doesn't seem possible: I don't understand.
Thanks
Fabrice

 \startMPpage[offset=1DK]

  numeric u;
  u = 6cm;

  interim linejoin := mitered;
  interim ahangle := 30;

  path xx, yy;
  xx = ( (-0.3,0) -- 1.4 right) scaled u;
  yy = ( (-0.1,0) -- 1.8 right) rotated 90 scaled u;

  def compute_curve(suffix f)(expr xmin, xmax, xinc) =
  ((xmin,f(xmin))
  for x=xmin+xinc step xinc until xmax:
   .. (x,f(x))
  endfor)
  enddef;


  for i = 1 upto 4:

  vardef f(expr x) =x+exp(-i*x) enddef;

  path curve;

  curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

  draw curve;

  endfor;

  vardef f(expr x) =x+exp(-6*x) enddef;

  path curve;

  curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

  draw curve;

  vardef f(expr x) =x+exp(-15*x) enddef;

  path curve;

  curve = compute_curve(f,-0.4,1.4,0.0001) scaled u;

  draw curve;


  vardef f(expr x) =x+exp(-60*x) enddef;

  path curve;

  curve = compute_curve(f,-0.4,1.4,0.0001) scaled u; ->>>>> not
drawn

  draw curve withcolor blue;


  drawarrow (0,0) -- (u,0) withpen pencircle scaled 1.5bp;
  drawarrow (0,0) -- (0,u) withpen pencircle scaled 1.5bp;


  label.urt("A",(0,1u));

  draw xx;
  draw  yy;

  draw (1u,0) -- (1u,1.8u);


  label.llft("0",(0,0));

   vardef mark_y_axis(expr value, name) =
save p; pair p; p = value * u * up;
    draw (left--right) scaled 1 shifted p;
label.lft(name, p shifted 2 left);
      enddef;

  for a = 1 upto 1:
mark_y_axis(a, "");
  endfor

   mark_y_axis(1, "$1$");


 vardef mark_x_axis(expr value, name) =
   save p; pair p; p = value * u * right;
   draw (up--down) scaled 1 shifted p;
   label.bot(name, p shifted 2 down);
 enddef;

 for a = 1 upto 1:
   mark_x_axis(a, "");
 endfor

 mark_x_axis(1, "$1$");


  path rectangle;
  rectangle = (-0.3u,-0.4u) -- (1.3u,-0.4u) -- (1.3u,-0.4u) --
(1.3u,1.4u) -- (-0.3u,1.4u)--cycle;

  clip currentpicture to rectangle;
 \stopMPpage
___
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: outlinetext broken?

2024-05-11 Thread Hans Hagen

On 5/11/2024 8:33 PM, Jairo A. del Rio wrote:
As for the current ConTeXt, the example above still produces the wrong 
output. Can anyone reproduce this case? Thank you in advance. 

It's a bit tricky but this is what i can get ... see attached.

(You have to wait till a next upload.)

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
-


outlines-003.pdf
Description: Adobe PDF document
\continuewhenlmtxmode

\starttext
\startMPpage[offset=10pt]
draw lmt_outline [
text = "\mathematics{\sqrt{2}-1}"
] ;

draw lmt_outline [
text = "\mathematics{\sqrt[rule=no]{2}-1}"
] shifted (0,-1cm) ;

draw lmt_outline [
text = "\mathematics{\sqrt[rule=yes]{2}-1}"
] shifted (0,-2cm) ;
\stopMPpage
\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: outlinetext broken?

2024-05-11 Thread Jairo A. del Rio
As for the current ConTeXt, the example above still produces the wrong
output. Can anyone reproduce this case? Thank you in advance.

Jairo

El sáb, 4 may 2024 a la(s) 7:23 p.m., Jairo A. del Rio (
jairoadelr...@gmail.com) escribió:

> Hi, list
>
> \startMPpage
> draw outlinetext.d("\mathematics{\sqrt{2}-1}")(withcolor black withpen
>   currentpen) scaled 1;
> \stopMPpage
>
> fails (radicals are not drawn at all). As for context --version,
>
> mtx-context | ConTeXt Process Management 1.06
> mtx-context |
> mtx-context | main context file:
> /usr/local/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2024.04.01 08:59
> mtx-context | main context file:
> /usr/local/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl
> mtx-context | current version: 2024.04.01 08:59
>
> Maybe it's only me, but I tried with several fonts and the outcome is
> similar.
>
> Best regards,
> Jairo
>


ema.pdf
Description: Adobe PDF document
___
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] Cron /var/www/aanhet.net/context/bin/cron/context-mirror

2024-05-11 Thread Cron Daemon
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 context/latest/
 context/latest/cont-lmt.zip
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 general/manuals/
 general/manuals/canbedone.pdf
 general/manuals/examples-mathmeanings.pdf
 general/manuals/examples-naturaltables.pdf
 general/manuals/tagging.pdf
 
 sent 179,875 bytes  received 44,563,678 bytes  3,890,743.74 bytes/sec
 total size is 582,473,746  speedup is 13.02


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2024-05-11.13
248560168   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-11.13/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-11.13/current
375309581   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-11.13
375309581   total
___
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] How to place text, but make it completely hidden from viewers?

2024-05-09 Thread Joel via ntg-context
I have found a few situations is confusing/breaking ConTeXt:
- Footnotes inside tables, figures, frames, margins (won't render the cited 
item).
- Custom index items inside those items (displays "entry not flushed").
My workaround has been to define a size 0 font \tfz, then put it in a block 
like this:

    {\tfz%    \starteffect[hidden]%
    \cite[author1912]    \stopeffect%
    }%
The problem this seems to create, is sometimes if placed between two passages, 
it interprets a need to create two paragraph breaks:
\input knuth
    {\tfz%    \starteffect[hidden]%
    \cite[author1912]    \stopeffect%
    }%
\input knuth
It creates a paragraph break after the first knuth, then another after the 
hidden text, thereby creating a "double spaced" break between two paragraphs. 
Note the above code is used in many macros, so I don't have full control always 
where it appears, but its making the double-spaced break everywhere.

Is there either (1) something can enter before this code that essentially has 
the effect of "backup to the previous paragraph" or (2) some other method of 
hiding text that makes it present on the page, but just not visible to the 
reader, that won't create a double spaced break, or take up any space 
what-so-ever?
--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: weird \inlinetypebuffer interaction

2024-05-09 Thread Pablo Rodriguez via ntg-context
On 5/9/24 12:57, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 08.05.2024 um 18:05:
>> [...]
>> Since \type doesn’t collapse hyphens, wouldn’t it be possible to add
>> \nohyphencollapsing to \typeinlinebuffer just for the sake of output
>> consistency?
>
> You can make \typeinlinebuffer behave like \type by adding a second
> initializer which besides other things prevents hyphen collapsing.
>
> buff-ver.mkxl:
>
> \protected\def\buff_verbatim_type_buffer_indeed_inline#1#2%
>{\cdef\currenttype{#1}%
> \buff_verbatim_initialize_type_one
> +  \buff_verbatim_initialize_type_two

Many thanks for your improvement, Wolfgang.

It would be great to have it included in standard ConTeXt.

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: weird \inlinetypebuffer interaction

2024-05-09 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 08.05.2024 um 18:05:

On 5/7/24 22:37, Wolfgang Schuster wrote:

[...]
\typebuffer disables automatic \endash and \emdash with the
\nohyphencollapsing command
but the command isn't used for \typeinlinebuffer.

Many thanks for your explanation, Wolfgang.

Since \type doesn’t collapse hyphens, wouldn’t it be possible to add
\nohyphencollapsing to \typeinlinebuffer just for the sake of output
consistency?


You can make \typeinlinebuffer behave like \type by adding a second 
initializer which besides other things prevents hyphen collapsing.



buff-ver.mkxl:

\protected\def\buff_verbatim_type_buffer_indeed_inline#1#2%
  {\cdef\currenttype{#1}%
   \buff_verbatim_initialize_type_one
+  \buff_verbatim_initialize_type_two
   \dostarttaggedchained\t!verbatim\currenttype\??type
   \clf_typebuffer
 name   {#2}%
 strip  {\v!yes}%
 regime {\currentregime}%
 method {\p_buff_option}%
 nature {inline}% is default anyway
   \relax
   \dostoptagged}

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] 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: more register questions!

2024-05-07 Thread Rik Kabel

Hello Wolfgang and all,

I have been trying to extend this to handle endnotes. So far, I have not 
succeeded; the number is always that of the last endnote.


I could possibly increment a counter for each endnote processed, but 
that seems a hack.


--
Rik

On 2024-05-03 06:18, Wolfgang Schuster wrote:

Thomas A. Schmitz schrieb am 02.05.2024 um 17:01:

Hi,

making wonderful progress on my registers and translating from xml. 
There is one thing I can't figure out (and I or some other good soul 
may have asked in the past...). Is it possible to mark occurrences in 
footnotes? Ideally, the entry in the register would look like


p. 100\high{20}

to show that the term occurs in note 20 on p. 100. But if that's 
asking too much, I would be content with applying a processor (say, 
italic) to these register entries. From the looks of the tuc file, 
Context doesn't appear to "know" that a register entry is within a 
footnote. But Hans never ceases to amaze me, so maybe there is a way 
(short of applying special markup to these notes in the source)?


You can play with the following example, the main point use to use the 
\setregisterentry command and pass the footnote counter with the third 
(optional) argument.


\def\IndexPageCommand#1%
  {#1\doifsomething
 {\currentregisterpageuserdata{footnote}}
 {\high{\currentregisterpageuserdata{footnote

\setupregister[index][pagecommand=\IndexPageCommand]

\starttext

\dorecurse{200}
{\samplefile{lorem}\expanded{\setregisterentry[index][entries=\recurselevel]}% 

\samplefile{lorem}\footnote{xxx\expanded{\setregisterentry[index][entries=\recurselevel][footnote={\rawcountervalue[footnote]}]}}% 


   \samplefile{lorem}}

\page \placeindex

\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
___ 
___
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: transparent color

2024-05-06 Thread Wolfgang Schuster

Bruce Horrocks schrieb am 06.05.2024 um 15:30:

On 6 May 2024, at 09:41, Hans van der Meer via ntg-context  
wrote:

I would like to use a transparent version of an existing color. Thus
\definecolor[transparentcolor][color,t=0.2,a=1]
instead of
\definecolor[transparentcolor][r=..,g=..,b=..,t=0.2,a=1]
because I do not know the rgb values of the color that must be made 
transparent, only its name.

How to accomplish?

The Wiki page <https://wiki.contextgarden.net/Color> gives the source files for 
various sets of colours (built in, crayola etc) and the source has the RGB values in 
a fairly obvious format.


\definecolor [wolley] [\colorcomponents{yellow},t=0.5,a=1]

\starttext

%\showcolorcomponents [yellow]

\framed[background=color,backgroundcolor=darkblue,foregroundcolor=yellow]{yellow}

\framed[background=color,backgroundcolor=darkblue,foregroundcolor=wolley]{wolley}

\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: transparent color

2024-05-06 Thread Henning Hraban Ramm

Am 06.05.24 um 16:01 schrieb Jacob Kauffmann via ntg-context:



Am 06.05.2024 um 10:41 schrieb Hans van der Meer via ntg-context 
:

I would like to use a transparent version of an existing color. Thus
\definecolor[transparentcolor][color,t=0.2,a=1]
instead of
\definecolor[transparentcolor][r=..,g=..,b=..,t=0.2,a=1]
because I do not know the rgb values of the color that must be made 
transparent, only its name.

How to accomplish?


I think like this:

\definecolor[myred][r=.5]
\defineprocesscolor[myredish][myred][a=1,t=.2]


Oh, another one that I didn’t know. (Of course it’s in the source, but 
only Wolfgang knows all of it. ;-)


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: transparent color

2024-05-06 Thread Jacob Kauffmann via ntg-context


> Am 06.05.2024 um 10:41 schrieb Hans van der Meer via ntg-context 
> :
> 
> I would like to use a transparent version of an existing color. Thus
> \definecolor[transparentcolor][color,t=0.2,a=1]
> instead of
> \definecolor[transparentcolor][r=..,g=..,b=..,t=0.2,a=1]
> because I do not know the rgb values of the color that must be made 
> transparent, only its name.
> 
> How to accomplish? 

I think like this:

\definecolor[myred][r=.5]
\defineprocesscolor[myredish][myred][a=1,t=.2]
___
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: transparent color

2024-05-06 Thread Bruce Horrocks


> On 6 May 2024, at 09:41, Hans van der Meer via ntg-context 
>  wrote:
> 
> I would like to use a transparent version of an existing color. Thus
> \definecolor[transparentcolor][color,t=0.2,a=1]
> instead of
> \definecolor[transparentcolor][r=..,g=..,b=..,t=0.2,a=1]
> because I do not know the rgb values of the color that must be made 
> transparent, only its name.
> 
> How to accomplish? 

The Wiki page <https://wiki.contextgarden.net/Color> gives the source files for 
various sets of colours (built in, crayola etc) and the source has the RGB 
values in a fairly obvious format.

—
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: transparent color

2024-05-06 Thread Henning Hraban Ramm

Am 06.05.24 um 10:41 schrieb Hans van der Meer via ntg-context:

I would like to use a transparent version of an existing color. Thus
\definecolor[transparentcolor][color,t=0.2,a=1]
instead of
\definecolor[transparentcolor][r=..,g=..,b=..,t=0.2,a=1]
because I do not know the rgb values of the color that must be made 
transparent, only its name.


How to accomplish?


Interesting task. Perhaps via multitone colors?
https://wiki.contextgarden.net/Spot_Colors

Otherwise you can use \definetransparency and \starttransparent around 
\color (or \startcolor).


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] transparent color

2024-05-06 Thread Hans van der Meer via ntg-context
I would like to use a transparent version of an existing color. Thus
\definecolor[transparentcolor][color,t=0.2,a=1]
instead of
\definecolor[transparentcolor][r=..,g=..,b=..,t=0.2,a=1]
because I do not know the rgb values of the color that must be made 
transparent, only its name.

How to accomplish? 

yours sincerely
dr. Hans van der Meer



___
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] outlinetext broken?

2024-05-04 Thread Jairo A. del Rio
Hi, list

\startMPpage
draw outlinetext.d("\mathematics{\sqrt{2}-1}")(withcolor black withpen
  currentpen) scaled 1;
\stopMPpage

fails (radicals are not drawn at all). As for context --version,

mtx-context | ConTeXt Process Management 1.06
mtx-context |
mtx-context | main context file:
/usr/local/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2024.04.01 08:59
mtx-context | main context file:
/usr/local/context/tex/texmf-context/tex/context/base/mkxl/context.mkxl
mtx-context | current version: 2024.04.01 08:59

Maybe it's only me, but I tried with several fonts and the outcome is
similar.

Best regards,
Jairo


ema.pdf
Description: Adobe PDF document
___
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: more register questions!

2024-05-03 Thread Thomas A. Schmitz

Hi Wolfgang,

powerful and elegant, as always! I think I have a solution with xml; I 
will have to test it more extensively with my complex real file; but 
here comes, also for Hraban (if it works in real life, I'll add it to 
the wiki...).


Thanks a lot!

Thomas

\startbuffer[test]

  
Dummy text.Dummy footnote.
  
  
Dummy text.Dummy footnote.
  
  

\stopbuffer

\startxmlsetups xml:testsetups
  \xmlsetsetup{#1}{*}{-}
  \xmlsetsetup{#1}{document|chapter|p|footnote|indexentry|index}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:document
  \xmlflush {#1}
\stopxmlsetups

\startxmlsetups xml:chapter
  \xmlflush {#1} \page
\stopxmlsetups

\startxmlsetups xml:p
  \xmlflush {#1} \par
\stopxmlsetups

\startxmlsetups xml:footnote
  \footnote[\xmlatt{#1}{id}]{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:indexentry
  \xmldoiftext {#1} {ancestor::footnote}
   {\setregisterentry 
[index][keys:1=\xmlatt{#1}{key},entries:1=\xmlatt{#1}{key}][footnote={\rawcountervalue[footnote]}]}


{\setregisterentry[index][keys:1=\xmlatt{#1}{key},entries:1=\xmlatt{#1}{key}]}
\stopxmlsetups

\startxmlsetups xml:index
  \page \placeregister [index]
\stopxmlsetups

\def\IndexPageCommand#1%
  {#1\doifsomething
 {\currentregisterpageuserdata{footnote}}
 {\high{\currentregisterpageuserdata{footnote

\setupregister[index][pagecommand=\IndexPageCommand]
\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext




On 5/3/24 12:18, Wolfgang Schuster wrote:
You can play with the following example, the main point use to use the 
\setregisterentry command and pass the footnote counter with the third 
(optional) argument.


\def\IndexPageCommand#1%
   {#1\doifsomething
  {\currentregisterpageuserdata{footnote}}
  {\high{\currentregisterpageuserdata{footnote

\setupregister[index][pagecommand=\IndexPageCommand]

\starttext

\dorecurse{200}
{\samplefile{lorem}\expanded{\setregisterentry[index][entries=\recurselevel]}%
\samplefile{lorem}\footnote{xxx\expanded{\setregisterentry[index][entries=\recurselevel][footnote={\rawcountervalue[footnote]}]}}%
    \samplefile{lorem}}

\page \placeindex

\stoptext

Wolfgang


--
Prof. Dr. Thomas A. Schmitz
Institut für Klassische und Romanische Philologie
Universität Bonn
Rabinstr. 8
53111 Bonn
http://www.philologie.uni-bonn.de/de/personal/schmitz

___
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: more register questions!

2024-05-03 Thread Henning Hraban Ramm

Am 03.05.24 um 22:24 schrieb Thomas A. Schmitz:

Hi Massi,

yes, that was a very good idea! I can detect if the element  
occurs within a footnote by testing


\xmldoiftext {#1} {ancestor::footnote}

and then apply a processor to these entries. That would be a good 
solution for the time being.


Would you contribute the complete solution to the wiki?
I find the case quite interesting.

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: more register questions!

2024-05-03 Thread Thomas A. Schmitz

Hi Massi,

yes, that was a very good idea! I can detect if the element  
occurs within a footnote by testing


\xmldoiftext {#1} {ancestor::footnote}

and then apply a processor to these entries. That would be a good 
solution for the time being.


Thanks and all best

Thomas

On 5/2/24 17:55, mf wrote:


I did something like that, with a processor that added a "n" after the 
occurrence page number.


Since you typeset XML, maybe you can detect that an index (register) 
reference happens inside a note from the DOM element you are typesetting.


Then you use a command like this:

\index[NoteProcessor->sortkey]{index term}

where NoteProcessor is defined like this:

\defineprocessor[NoteProcessor][right={\itx n}]

In this case I'm adding a smaller "n" to the right of the page number of 
the occurrence.


Adding the \high style is not difficult:

\defineprocessor[NoteProcessor][right=\high{n}]

but replacing a fixed "n" with the footnote number is quite challenging.

The second argument of \defineprocessor has a "command=\...##1" option 
that could be exploited, but I don't know exactly what gets passed to 
that custom command as ##1; maybe the page number of the occurrence.


In that case, I'd look for a way to store the association between that 
occurrence and the footnote number, and retrieve that in the custom 
command.


Massi


--
Prof. Dr. Thomas A. Schmitz
Institut für Klassische und Romanische Philologie
Universität Bonn
Rabinstr. 8
53111 Bonn
http://www.philologie.uni-bonn.de/de/personal/schmitz

___
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: more register questions!

2024-05-03 Thread Wolfgang Schuster

Thomas A. Schmitz schrieb am 02.05.2024 um 17:01:

Hi,

making wonderful progress on my registers and translating from xml. 
There is one thing I can't figure out (and I or some other good soul 
may have asked in the past...). Is it possible to mark occurrences in 
footnotes? Ideally, the entry in the register would look like


p. 100\high{20}

to show that the term occurs in note 20 on p. 100. But if that's 
asking too much, I would be content with applying a processor (say, 
italic) to these register entries. From the looks of the tuc file, 
Context doesn't appear to "know" that a register entry is within a 
footnote. But Hans never ceases to amaze me, so maybe there is a way 
(short of applying special markup to these notes in the source)?


You can play with the following example, the main point use to use the 
\setregisterentry command and pass the footnote counter with the third 
(optional) argument.


\def\IndexPageCommand#1%
  {#1\doifsomething
 {\currentregisterpageuserdata{footnote}}
 {\high{\currentregisterpageuserdata{footnote

\setupregister[index][pagecommand=\IndexPageCommand]

\starttext

\dorecurse{200}
{\samplefile{lorem}\expanded{\setregisterentry[index][entries=\recurselevel]}%
\samplefile{lorem}\footnote{xxx\expanded{\setregisterentry[index][entries=\recurselevel][footnote={\rawcountervalue[footnote]}]}}%
   \samplefile{lorem}}

\page \placeindex

\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: more register questions!

2024-05-02 Thread mf



Il 02/05/24 17:01, Thomas A. Schmitz ha scritto:

Hi,

making wonderful progress on my registers and translating from xml. 
There is one thing I can't figure out (and I or some other good soul may 
have asked in the past...). Is it possible to mark occurrences in 
footnotes? Ideally, the entry in the register would look like


p. 100\high{20}

to show that the term occurs in note 20 on p. 100. But if that's asking 
too much, I would be content with applying a processor (say, italic) to 
these register entries. From the looks of the tuc file, Context doesn't 
appear to "know" that a register entry is within a footnote. But Hans 
never ceases to amaze me, so maybe there is a way (short of applying 
special markup to these notes in the source)?




I did something like that, with a processor that added a "n" after the 
occurrence page number.


Since you typeset XML, maybe you can detect that an index (register) 
reference happens inside a note from the DOM element you are typesetting.


Then you use a command like this:

\index[NoteProcessor->sortkey]{index term}

where NoteProcessor is defined like this:

\defineprocessor[NoteProcessor][right={\itx n}]

In this case I'm adding a smaller "n" to the right of the page number of 
the occurrence.


Adding the \high style is not difficult:

\defineprocessor[NoteProcessor][right=\high{n}]

but replacing a fixed "n" with the footnote number is quite challenging.

The second argument of \defineprocessor has a "command=\...##1" option 
that could be exploited, but I don't know exactly what gets passed to 
that custom command as ##1; maybe the page number of the occurrence.


In that case, I'd look for a way to store the association between that 
occurrence and the footnote number, and retrieve that in the custom command.


Massi
___
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: \par and \startlines

2024-05-01 Thread Wolfgang Schuster

denisma...@mailbox.org schrieb am 30.04.2024 um 14:28:

-Ursprüngliche Nachricht-
Von: Wolfgang Schuster 
Gesendet: Samstag, 27. April 2024 07:40
An: Denis Maier 
Cc: mailing list for ConTeXt users 
Betreff: Re: [NTG-context] Re: \par and \startlines

Denis Maier schrieb am 26.04.2024 um 19:52:


I see. But there's no command that could be used to simulate an empty line?
If not, me should I perhaps try to replicate the wrapper structure
from the XML source in context? (I'll also look into the format module
of
course.) What do you think?

Below is a different solution to your problem with works without \startlines
because you already mark up each individual line in the poem which make it
possible to add a linebreak in the output.

With \blank options (samepage) you can avoid pagebreaks between stanzas.

\startxmlsetups xml:test
  \xmlsetsetup{#1}{*}{-}
  \xmlsetsetup{#1}{doc|poem|stanza|line}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

\startxmlsetups xml:doc
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:poem
  \blank[line]
  \xmlflush{#1}
  \blank[back,line]
\stopxmlsetups

\startxmlsetups xml:stanza
 \xmlflush{#1}\blank[preference,line]
\stopxmlsetups

\startxmlsetups xml:line
  \xmlflush{#1}\blank[samepage,none]
\stopxmlsetups

\startbuffer[test]




The
lines
are
there!


The
lines
are
there!


The
lines
are
there!



\stopbuffer

\starttext

\samplefile{lorem}

\xmlprocessbuffer{test}{test}{}

\samplefile{lorem}

\stoptext

Thanks for this solution. I've had a quick look, and it seems to do exactly 
what I need. My requirements are rather simple at the moment, but that should 
be sufficient, but to repeat Hraban's question: What would be the advantage of 
using the format module?


The module provides features like

    - alignment of the verse lines
    - numbering of the lines (which isn't supported by \startlines 
unless you add the normal linenumbering mechanism)
    - support for lines which don't fit on a single page where the 
consecutive lines are indented


but the module is outdated and relies on an old mkii style code base.

A big difference between the \startlines environment and the format 
module is that the first treats
each line in the input file as a separate line in the output while the 
format module requires begin/end

tags for each line which works better for xml input.

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] Re: \par and \startlines

2024-04-30 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: Wolfgang Schuster 
> Gesendet: Samstag, 27. April 2024 07:40
> An: Denis Maier 
> Cc: mailing list for ConTeXt users 
> Betreff: Re: [NTG-context] Re: \par and \startlines
> 
> Denis Maier schrieb am 26.04.2024 um 19:52:
> 
> > I see. But there's no command that could be used to simulate an empty line?
> > If not, me should I perhaps try to replicate the wrapper structure
> > from the XML source in context? (I'll also look into the format module
> > of
> > course.) What do you think?
> 
> Below is a different solution to your problem with works without \startlines
> because you already mark up each individual line in the poem which make it
> possible to add a linebreak in the output.
> 
> With \blank options (samepage) you can avoid pagebreaks between stanzas.
> 
> \startxmlsetups xml:test
>  \xmlsetsetup{#1}{*}{-}
>  \xmlsetsetup{#1}{doc|poem|stanza|line}{xml:*}
> \stopxmlsetups
> 
> \xmlregistersetup{xml:test}
> 
> \startxmlsetups xml:doc
>  \xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:poem
>  \blank[line]
>  \xmlflush{#1}
>  \blank[back,line]
> \stopxmlsetups
> 
> \startxmlsetups xml:stanza
> \xmlflush{#1}\blank[preference,line]
> \stopxmlsetups
> 
> \startxmlsetups xml:line
>  \xmlflush{#1}\blank[samepage,none]
> \stopxmlsetups
> 
> \startbuffer[test]
> 
> 
> 
> 
> The
> lines
> are
> there!
> 
> 
> The
> lines
> are
> there!
> 
> 
> The
> lines
> are
> there!
> 
> 
> 
> \stopbuffer
> 
> \starttext
> 
> \samplefile{lorem}
> 
> \xmlprocessbuffer{test}{test}{}
> 
> \samplefile{lorem}
> 
> \stoptext

Thanks for this solution. I've had a quick look, and it seems to do exactly 
what I need. My requirements are rather simple at the moment, but that should 
be sufficient, but to repeat Hraban's question: What would be the advantage of 
using the format module? 

Thanks again for your help,
Denis


___
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] 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: Why Difference Between \placefloat and \definefloat

2024-04-29 Thread Wolfgang Schuster

urba...@ca.rr.com schrieb am 28.04.2024 um 19:54:
I swear I used to understand this stuff.  I plead old age.   Why do I 
get two different results from the float placements here:


\definefloat[mysidebar][mysidebars]
\setupfloat[mysidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none]


1. You can't pass assignments and keywords to the same argument.

2. The \setupfloat command accepts only assignments as arguments, this 
means "outer" and "none" are ignored.


To set a default location for the float use 
\setupfloat[...][default={outer,none}]



\defineframedtext [sidebartext]
[width=.4\textwidth,bodyfont=small,corner=round,background=color,backgroundcolor=lightgray,align=flushleft]

\starttext
This is a bit of text
\placefloat[sidebar][leftmargindistance=-.25in,rightmargindistance=-.25in,outer,none]{}{


1. You're again passing assignments and keywords with a single argument.

2. The \placefloat commands accepts only keywords and ignores all 
assignments, this means your distance settings have no effect.


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: unprotecting when defining in Lua

2024-04-29 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 29.04.2024 um 17:22:

Dear list,

I have the following sample:

   \starttext
   \startluacode
 function document.test(str)
   context(str)
 end

 interfaces.definecommand {
   name = "testing",
   protected = false,
   macro = document.test,
 }
   \stopluacode

   \meaningfull\testing

   \def\test#1{#1}

   \meaningfull\test
   \stoptext

Which is the right way to use "interfaces.definecommand" to get a simple
command as in standard TeX?

I mean, no a non \permanent or non \protected command.


You can't create unprotected command with interfaces.definecommand but 
this not a problem
because you can just use interfaces.implement to create your command 
which is then unprotected
by default. Using implement instead of definecommand doesn't matter 
because definecommand
is just a wrapper for the implement function with the option to create a 
environment.


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] unprotecting when defining in Lua

2024-04-29 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \starttext
  \startluacode
function document.test(str)
  context(str)
end

interfaces.definecommand {
  name = "testing",
  protected = false,
  macro = document.test,
}
  \stopluacode

  \meaningfull\testing

  \def\test#1{#1}

  \meaningfull\test
  \stoptext

Which is the right way to use "interfaces.definecommand" to get a simple
command as in standard TeX?

I mean, no a non \permanent or non \protected command.

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: QR Code

2024-04-29 Thread Henning Hraban Ramm

Hi Ben,

I’m not sure if this is your issue, but the zint library’s API used to 
change with every version, so that ConTeXt supports only the “latest” 
few, and probably that’s still 2.10 to 2.12.


I still have 2.12 via MacPorts on MacOS 10.15, and it works.
Can you try an older zint version?

And just for information, MkIV used to call the zint binary, while LMTX 
uses the library to create the structures and converts them via MP into 
PDF objects (no additional files).


Hraban

Am 29.04.24 um 05:03 schrieb Benjamin Buchmuller:

Catching up on an earlier thread by Ursula and Hraban,

I'm also experienceing problems with \usemodule[zint] while \usemodule[t-zint] 
works fine.

Running on macOS (ConTeXt  ver: 2024.04.01 08:59 LMTX  fmt: 2024.4.28).

The issue seems somewhat unrelated to ConTeXt on first glance (??) if this is 
helpful. My code stopped working after I updated the OS (to Sonoma) and my 
homebrew cellar (to zint 2.13.0) while keeping a ConTeXt version from 2022 
which compiled the barcodes perfectly fine before these updates. This being 
said, the newer ConTeXt version doesn't resolve the issue.

Observations:

1) Zint (and Inkscape) is in my PATH and correctly sym-linked as specified in the 
wiki (~/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so 
<http://libzint.so/>). However, the library was (still) not fount after mtxrun 
--generate

[This seems an odd, but unrelated problem]

2) So, I hardcoded libfile in libs-impzint.lmt to

local libfile = "/usr/local/Cellar/zint/2.13.0/lib/libzint.dylib"

3) Running the wiki example:

   \usemodule[m-zint]
\starttext
\barcode[alternative=isbnx, text=9783865419026, width=4cm]
\barcode[alternative=qrcode, text={https://wiki.contextgarden.net},
width=3cm]
\barcode[alternative=maxicode, text={test}, width=3cm]
\stoptext

* With \usemodule[m-zint], I correctly get:

zint --barcode=qrcode  --output="zint-qrcode-495165e08dbc5ce650aaaf13caa2229f.eps" 
--input="zint-qrcode-495165e08dbc5ce650aaaf13caa2229f.tmp"
zint --barcode=maxicode  --output="zint-maxicode-098f6bcd4621d373cade4e832627b4f6.eps" 
--input="zint-maxicode-098f6bcd4621d373cade4e832627b4f6.tmp"

[Barcodes show up as expected]

* With \usemodule[zint], no success:

optional> using library 
'/usr/local/Cellar/zint/2.13.0/lib/libzint.dylib'
zint> something went wrong: invalid result vector
zint> something went wrong: invalid result
zint> something went wrong: invalid result vector

Maybe this is helpful to pinpoint the issue?


___
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: QR Code

2024-04-28 Thread Benjamin Buchmuller
Catching up on an earlier thread by Ursula and Hraban,

I'm also experienceing problems with \usemodule[zint] while \usemodule[t-zint] 
works fine. 

Running on macOS (ConTeXt  ver: 2024.04.01 08:59 LMTX  fmt: 2024.4.28).

The issue seems somewhat unrelated to ConTeXt on first glance (??) if this is 
helpful. My code stopped working after I updated the OS (to Sonoma) and my 
homebrew cellar (to zint 2.13.0) while keeping a ConTeXt version from 2022 
which compiled the barcodes perfectly fine before these updates. This being 
said, the newer ConTeXt version doesn't resolve the issue.

Observations:

1) Zint (and Inkscape) is in my PATH and correctly sym-linked as specified in 
the wiki (~/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so 
<http://libzint.so/>). However, the library was (still) not fount after mtxrun 
--generate

[This seems an odd, but unrelated problem]

2) So, I hardcoded libfile in libs-impzint.lmt to

local libfile = "/usr/local/Cellar/zint/2.13.0/lib/libzint.dylib"

3) Running the wiki example:

  \usemodule[m-zint]
   \starttext
   \barcode[alternative=isbnx, text=9783865419026, width=4cm]
   \barcode[alternative=qrcode, text={https://wiki.contextgarden.net}, 
   width=3cm]
   \barcode[alternative=maxicode, text={test}, width=3cm]
   \stoptext

* With \usemodule[m-zint], I correctly get:

zint --barcode=qrcode  
--output="zint-qrcode-495165e08dbc5ce650aaaf13caa2229f.eps" 
--input="zint-qrcode-495165e08dbc5ce650aaaf13caa2229f.tmp"
zint --barcode=maxicode  
--output="zint-maxicode-098f6bcd4621d373cade4e832627b4f6.eps" 
--input="zint-maxicode-098f6bcd4621d373cade4e832627b4f6.tmp"

[Barcodes show up as expected]

* With \usemodule[zint], no success:

optional> using library 
'/usr/local/Cellar/zint/2.13.0/lib/libzint.dylib'
zint> something went wrong: invalid result vector
zint> something went wrong: invalid result
zint> something went wrong: invalid result vector

Maybe this is helpful to pinpoint the issue?

Best


Ben
___
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 make superscript text match footnote mark formatting?

2024-04-27 Thread Joel via ntg-context
 Thank you! --Joel

On Saturday, April 27, 2024 at 12:08:13 PM MDT, Wolfgang Schuster 
 wrote:  
 
 Joel via ntg-context schrieb am 27.04.2024 um 19:16:
> \starttext
>   test\high{1}test\footnote{some text}
> \stoptext
> 
> How can I create a superscript number that has exactly the same 
> formatting as a footnote, but which won't create a footnote. I tried 
> \high{}, which I believe should be the way to superscript text, but if 
> you compile this, you can see the first "1" and second "1" have entirely 
> different formatting. How do I make the first one have the same exact 
> formtating as the real footnote?

Footnotes apply the \tx style to the number in the running text and to 
get the same text size with \high you need \tx before the argument.

Another solution is to create your own \high command where you set the 
text size as default value but now you have to pass \txx as value 
because by default \high already uses style=\tx. When you now combine 
the default \tx from \high and the \tx from the footnote you get the 
\txx size (which is used in the custom \high command).

 begin example
\definehigh[fakenotesymbol][style=\txx]

\starttext

\startlines
test\footnote{\unknown}
test\high{\tx 1}
test\fakenotesymbol{1}
\stoplines

\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: How to make superscript text match footnote mark formatting?

2024-04-27 Thread Wolfgang Schuster

Joel via ntg-context schrieb am 27.04.2024 um 19:16:

\starttext
  test\high{1}test\footnote{some text}
\stoptext

How can I create a superscript number that has exactly the same 
formatting as a footnote, but which won't create a footnote. I tried 
\high{}, which I believe should be the way to superscript text, but if 
you compile this, you can see the first "1" and second "1" have entirely 
different formatting. How do I make the first one have the same exact 
formtating as the real footnote?


Footnotes apply the \tx style to the number in the running text and to 
get the same text size with \high you need \tx before the argument.


Another solution is to create your own \high command where you set the 
text size as default value but now you have to pass \txx as value 
because by default \high already uses style=\tx. When you now combine 
the default \tx from \high and the \tx from the footnote you get the 
\txx size (which is used in the custom \high command).


 begin example
\definehigh[fakenotesymbol][style=\txx]

\starttext

\startlines
test\footnote{\unknown}
test\high{\tx 1}
test\fakenotesymbol{1}
\stoplines

\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 make superscript text match footnote mark formatting?

2024-04-27 Thread Joel via ntg-context
\starttext
 test\high{1}test\footnote{some text}
\stoptext
How can I create a superscript number that has exactly the same formatting as a 
footnote, but which won't create a footnote. I tried \high{}, which I believe 
should be the way to superscript text, but if you compile this, you can see the 
first "1" and second "1" have entirely different formatting. How do I make the 
first one have the same exact formtating as the real footnote?
--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: \par and \startlines

2024-04-26 Thread Wolfgang Schuster

Denis Maier schrieb am 26.04.2024 um 19:52:


I see. But there's no command that could be used to simulate an empty line?
If not, me should I perhaps try to replicate the wrapper structure from 
the XML source in context? (I'll also look into the format module of 
course.) What do you think?


Below is a different solution to your problem with works without 
\startlines because you already mark up each individual line in the poem 
which make it possible to add a linebreak in the output.


With \blank options (samepage) you can avoid pagebreaks between stanzas.

\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{doc|poem|stanza|line}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

\startxmlsetups xml:doc
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:poem
\blank[line]
\xmlflush{#1}
\blank[back,line]
\stopxmlsetups

\startxmlsetups xml:stanza
   \xmlflush{#1}\blank[preference,line]
\stopxmlsetups

\startxmlsetups xml:line
\xmlflush{#1}\blank[samepage,none]
\stopxmlsetups

\startbuffer[test]




The
lines
are
there!


The
lines
are
there!


The
lines
are
there!



\stopbuffer

\starttext

\samplefile{lorem}

\xmlprocessbuffer{test}{test}{}

\samplefile{lorem}

\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: Define a new command that inherits from multiple other command options

2024-04-26 Thread Bruce Horrocks


> On 25 Apr 2024, at 09:24, ai2472206...@yeah.net wrote:
> 
> But what I don't know is how to get it to inherit the options of other 
> commands and perform these features correctly.

Your example didn't work for me - none of the Chinese|Japanese[1] characters 
showed.

AFAIK there is no way to "inherit" functionality.

You still need to write \setupsidenote to call \setupcounter, \setupframed at 
the right points to achieve the right effects.

What you can do is have \setupsidenote accept all options in one big long list 
and then pass the ones that apply to setupcounter to each use of \setupcounter, 
pass on the ones that apply to setupframed to each use of \setupframed and so 
on.

Thsi is releatively easy in Lua where you could define a list of all possible 
commands and which macro they apply to then loop through it looking to see if 
that option had been supplied and building a set of parameters for 
\setupframed, \setupcounter etc.

Hope this makes sense.

But I feel there's probably a better way - it's a lot of effort to go to in 
order to have a single "does it all macro" instead of calling two or three 
macros each time.

Regards,

[1] Apologies for my ignorance.
—
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: wrong spacing after command with optional arguments

2024-04-26 Thread Pablo Rodriguez via ntg-context
On 4/26/24 19:50, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 26.04.2024 um 19:04:
>> I tried this approach (I hope it isn’t wrong):
>>
>>\starttext
>>\expanded\tolerant\def\MyCommand#_#,#_#,#_#,#_{%
>
> The \expanded modifier is wrong (I guess you meant \unexpanded) but
> which check for the number of arguments you use doesn't matter in a
> document.

You are right, I meant \unexpanded.

> The LMTX version of the \iffourthargument etc. checks is the
> \ifarguments commands where you use \or to set a case for the number of
> argument passed.

Many thanks for explaining this too.

>> But what are these "#_" (which don’t seem to come from TeX)?
>
> Hans added many additions to command parameters in Luametatex and #_
> means the argument to a commands has to be enclosed in braces while #1
> allows you to pass text without it.

I get it now.

> You can find a list with all new command parameters in lowlevel-macros.pdf.

An interesting reading for the weekend.

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: \par and \startlines

2024-04-26 Thread Denis Maier via ntg-context


 
 
  
    
   
   
   
Wolfgang Schuster  hat am 26.04.2024 19:29 CEST geschrieben:

   
 

   
 
Denis Maier schrieb am 26.04.2024 um 19:18:



  
 
 
 
  Wolfgang Schuster  hat am 26.04.2024 18:24 CEST geschrieben:
  
 
   
  
 
   
  Denis Maier via ntg-context schrieb am 26.04.2024 um 18:10: 
  
  
   
   
Pablo Rodriguez via ntg-context <ntg-context@ntg.nl> hat am 26.04.2024 17:25 CEST geschrieben:

   
 

   
 

   
On 4/26/24 15:33, denis.ma...@unibe.ch wrote:



 Hi,
 



 I’m trying to typeset a poem from XML, but I can’t figure out how to
 

 make the inbetween key working here.
 



 As the source is XML, I cannot just add an empty line to start a new
 

 group of lines inside \startlines…\stoplines. I guess, there must be a
 

 command to do that, but \par seems to have no effect here.
 



 How can this be done?
 

   
Hi Denis,

   
 

   
I must confess I don’t get which is your actual question.

   
 

   
\blank works here and you know that (since you included it in your code).

   
 

   
MkIV with \par works in your sample and LMTX with \par doesn’t.

   
 

   
I wonder whether this might be a bug in LMTX.

   
 

   
Just in case it might help,

   
  
    
   
  
   Thanks for your answer and sorry for not being clearer. I was just wondering why the \par seems to have no effect. (I first guessed that it might be related to XML, to but then realized it happens with context markup as well. Usually, you won't run into this because an empty line works, but with XML that's not am option.) As you've said, it looks like a bug then.
   
  
 The lines environment treats each line of the input as paragraph by adding \par at the end of it and adding another \par makes no difference here. 
 
 BTW: ConTeXt has a module for poems which can be loaded with \usemodule[format]. 
 
 Wolfgang 
 
 
 

 Ok. I'll have a look at this module. Just two questions:
 

 1. so did this behavior change? 
 

 2. What is inbetween referring to then? If each line is a paragraph, what's this group of paragraphs then? Can you manually switch to the next one?
 

   The inbetween setting works because ConTeXt checks at the start of each line whether it's empty (in this case the value is used) or not.
   
   When you add a \par you just end the current line/paragraph and it doesn't matter how many \par's you use because TeX just ignores them.
   
   Wolfgang
   
  
    
   
  
   I see. But there's no command that could be used to simulate an empty line?
   
  
   If not, me should I perhaps try to replicate the wrapper structure from the XML source in context? (I'll also look into the format module of course.) What do you think?
   
  
    
   
  
   Thank you so much for your help.
   
  
   Best,
   
  
   Denis 
  
 

___
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: wrong spacing after command with optional arguments

2024-04-26 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 26.04.2024 um 19:04:

On 4/26/24 18:18, Wolfgang Schuster wrote:

Pablo Rodriguez via ntg-context schrieb am 26.04.2024 um 17:29:

What is wrong in my definition above?


There is nothing wrong, this is just a side effect of the scanner used
with the \do...groupempty commands. To have more control about this
behavior use the \tolerant modifier for \def to change it.


Many thanks for your reply, Wolfgang.

I tried this approach (I hope it isn’t wrong):

   \starttext
   \expanded\tolerant\def\MyCommand#_#,#_#,#_#,#_{%
 \doiftextelse{#4}%
   {#4}
   {\doiftextelse{#3}
 {#3}
 {#2}}}


The \expanded modifier is wrong (I guess you meant \unexpanded) but 
which check for the number of arguments you use doesn't matter in a 
document.


The LMTX version of the \iffourthargument etc. checks is the 
\ifarguments commands where you use \or to set a case for the number of 
argument passed.


\protected\tolerant\def\MyCommand#_#,#_#,#_#,#_%
  {\ifarguments
 % no arguments are passed
   \or
 #1% one argument is passed
   \or
 #2% two arguments are passed
   \or
 #3% three arguments are passed
   \or
 #4% four arguments are passed
   \fi}



   \MyCommand{}{second}{third}{fourth},\\
   \MyCommand{}{second}{third}{fourth} e,\\

   \MyCommand{}{second}{third},\\
   \MyCommand{}{second}{third} e,\\

   \MyCommand{}{second},\\
   \MyCommand{}{second} e,\\
   \stoptext

BTW, this is the first time I see #_ instead of #1.

There is no way to search for "#_" in the wiki.

Grepping the source, "#_" seems to be used for optional arguments
(mainly in syst-aux.mkxl).

But what are these "#_" (which don’t seem to come from TeX)?


Hans added many additions to command parameters in Luametatex and #_ 
means the argument to a commands has to be enclosed in braces while #1

allows you to pass text without it.

In the following example \CommandA take in the first case "a" as 
argument while CommandB ignores it and would only accept "{a}" with 
braces around it.


 begin example
 \def\CommandA#1{(#1)}
\tolerant\def\CommandB#_{(#1)}

\starttext

\CommandA abc\par
\CommandB abc\blank

\CommandA {ab}c\par
\CommandB {ab}c\blank

\stoptext
 end example

You can find a list with all new command parameters in lowlevel-macros.pdf.

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: \par and \startlines

2024-04-26 Thread Wolfgang Schuster

Denis Maier schrieb am 26.04.2024 um 19:18:
Wolfgang Schuster  hat am 
26.04.2024 18:24 CEST geschrieben:

Denis Maier via ntg-context schrieb am 26.04.2024 um 18:10:
Pablo Rodriguez via ntg-context <mailto:ntg-context@ntg.nl>> hat am 26.04.2024 17:25 CEST geschrieben:
On 4/26/24 15:33, denis.ma...@unibe.ch 
<mailto:denis.ma...@unibe.ch> wrote:
Hi, 
I’m trying to typeset a poem from XML, but I can’t figure out how to
make the inbetween key working here. 
As the source is XML, I cannot just add an empty line to start a new
group of lines inside \startlines…\stoplines. I guess, there must 
be a
command to do that, but \par seems to have no effect here. 
How can this be done? 

Hi Denis,
I must confess I don’t get which is your actual question.
\blank works here and you know that (since you included it in your 
code).

MkIV with \par works in your sample and LMTX with \par doesn’t.
I wonder whether this might be a bug in LMTX.
Just in case it might help, 
Thanks for your answer and sorry for not being clearer. I was just 
wondering why the \par seems to have no effect. (I first guessed 
that it might be related to XML, to but then realized it happens 
with context markup as well. Usually, you won't run into this 
because an empty line works, but with XML that's not am option.) As 
you've said, it looks like a bug then. 


The lines environment treats each line of the input as paragraph by 
adding \par at the end of it and adding another \par makes no 
difference here.


BTW: ConTeXt has a module for poems which can be loaded with 
\usemodule[format].


Wolfgang


Ok. I'll have a look at this module. Just two questions:
1. so did this behavior change?
2. What is inbetween referring to then? If each line is a paragraph, 
what's this group of paragraphs then? Can you manually switch to the 
next one?


The inbetween setting works because ConTeXt checks at the start of each 
line whether it's empty (in this case the value is used) or not.


When you add a \par you just end the current line/paragraph and it 
doesn't matter how many \par's you use because TeX just ignores them.


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: \par and \startlines

2024-04-26 Thread Denis Maier via ntg-context


 
 
  
    
   
   
   
Wolfgang Schuster  hat am 26.04.2024 18:24 CEST geschrieben:

   
 

   
 
Denis Maier via ntg-context schrieb am 26.04.2024 um 18:10:

   
  
 
 
  Pablo Rodriguez via ntg-context <ntg-context@ntg.nl> hat am 26.04.2024 17:25 CEST geschrieben:
  
 
   
  
 
   
  
 
  On 4/26/24 15:33, denis.ma...@unibe.ch wrote:
  
  
  
   Hi,
   
  
  
  
   I’m trying to typeset a poem from XML, but I can’t figure out how to
   
  
   make the inbetween key working here.
   
  
  
  
   As the source is XML, I cannot just add an empty line to start a new
   
  
   group of lines inside \startlines…\stoplines. I guess, there must be a
   
  
   command to do that, but \par seems to have no effect here.
   
  
  
  
   How can this be done?
   
  
 
  Hi Denis,
  
 
   
  
 
  I must confess I don’t get which is your actual question.
  
 
   
  
 
  \blank works here and you know that (since you included it in your code).
  
 
   
  
 
  MkIV with \par works in your sample and LMTX with \par doesn’t.
  
 
   
  
 
  I wonder whether this might be a bug in LMTX.
  
 
   
  
 
  Just in case it might help,
  
 

  
 

 Thanks for your answer and sorry for not being clearer. I was just wondering why the \par seems to have no effect. (I first guessed that it might be related to XML, to but then realized it happens with context markup as well. Usually, you won't run into this because an empty line works, but with XML that's not am option.) As you've said, it looks like a bug then.
  

   The lines environment treats each line of the input as paragraph by adding \par at the end of it and adding another \par makes no difference here.
   
   BTW: ConTeXt has a module for poems which can be loaded with \usemodule[format].
   
   Wolfgang
   
   
   
   
   
  
   Ok. I'll have a look at this module. Just two questions:
   
  
   1. so did this behavior change? 
   
  
   2. What is inbetween referring to then? If each line is a paragraph, what's this group of paragraphs then? Can you manually switch to the next one?
   
  
    
   
  
   Best,
   
  
   Denis 
  
 

___
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: wrong spacing after command with optional arguments

2024-04-26 Thread Pablo Rodriguez via ntg-context
On 4/26/24 18:18, Wolfgang Schuster wrote:
> Pablo Rodriguez via ntg-context schrieb am 26.04.2024 um 17:29:
>> What is wrong in my definition above?
>
> There is nothing wrong, this is just a side effect of the scanner used
> with the \do...groupempty commands. To have more control about this
> behavior use the \tolerant modifier for \def to change it.

Many thanks for your reply, Wolfgang.

I tried this approach (I hope it isn’t wrong):

  \starttext
  \expanded\tolerant\def\MyCommand#_#,#_#,#_#,#_{%
\doiftextelse{#4}%
  {#4}
  {\doiftextelse{#3}
{#3}
{#2}}}

  \MyCommand{}{second}{third}{fourth},\\
  \MyCommand{}{second}{third}{fourth} e,\\

  \MyCommand{}{second}{third},\\
  \MyCommand{}{second}{third} e,\\

  \MyCommand{}{second},\\
  \MyCommand{}{second} e,\\
  \stoptext

BTW, this is the first time I see #_ instead of #1.

There is no way to search for "#_" in the wiki.

Grepping the source, "#_" seems to be used for optional arguments
(mainly in syst-aux.mkxl).

But what are these "#_" (which don’t seem to come from TeX)?

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: wrong spacing after command with optional arguments

2024-04-26 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 26.04.2024 um 17:29:

Dear list,

I have the following sample:

   \starttext
   \def\MyCommand{\doquadruplegroupempty\doMyCommand}

   \def\doMyCommand#1#2#3#4{%
 \iffourthargument
   #4%
 \orelse\ifthirdargument
   #3%
 \else
   #2%
 \fi}

   \MyCommand{}{second}{third}{fourth},\\
   \MyCommand{}{second}{third}{fourth} e,\\

   \MyCommand{}{second}{third},\\
   \MyCommand{}{second}{third} e,\\

   \MyCommand{}{second},\\
   \MyCommand{}{second} e,\\
   \stoptext

I don‘t know why only the command gets the space after right only when
the four arguments are provided.

What is wrong in my definition above?


There is nothing wrong, this is just a side effect of the scanner used 
with the \do...groupempty commands. To have more control about this 
behavior use the \tolerant modifier for \def to change it.


 begin example
\tolerant\def\CommandA#_#*#_#*#_#*#_{(#1)(#2)(#3)(#4)}
\tolerant\def\CommandB#_#,#_#,#_#,#_{(#1)(#2)(#3)(#4)}

\starttext

A: \CommandA{a}  xxx\par
B: \CommandB{a}  xxx\blank

A: \CommandA{a}{b}   xxx\par
B: \CommandB{a}{b}   xxx\blank

A: \CommandA{a}{b}{c}xxx\par
B: \CommandB{a}{b}{c}xxx\blank

A: \CommandA{a}{b}{c}{d} xxx\par
B: \CommandB{a}{b}{c}{d} xxx\blank

\stoptext
 end example

Another way to avoid this is to create a command with a key-value list.

 begin example
\tolerant\def\Command[#1]%
  {\begingroup
   \getdummyparameters[#1]%
   \doifsomething{\dummyparameter{a}}{(\dummyparameter{a})}%
   \doifsomething{\dummyparameter{b}}{(\dummyparameter{b})}%
   \doifsomething{\dummyparameter{c}}{(\dummyparameter{c})}%
   \doifsomething{\dummyparameter{d}}{(\dummyparameter{d})}%
   \endgroup}

\starttext

\Command[a=1,b=2,c=3,d=4] xxx\par
\Command[a=1,c=3] xxx\par

\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] wrong spacing after command with optional arguments

2024-04-26 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \starttext
  \def\MyCommand{\doquadruplegroupempty\doMyCommand}

  \def\doMyCommand#1#2#3#4{%
\iffourthargument
  #4%
\orelse\ifthirdargument
  #3%
\else
  #2%
\fi}

  \MyCommand{}{second}{third}{fourth},\\
  \MyCommand{}{second}{third}{fourth} e,\\

  \MyCommand{}{second}{third},\\
  \MyCommand{}{second}{third} e,\\

  \MyCommand{}{second},\\
  \MyCommand{}{second} e,\\
  \stoptext

I don‘t know why only the command gets the space after right only when
the four arguments are provided.

What is wrong in my definition above?

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] \par and \startlines

2024-04-26 Thread denis.maier
Hi,

I'm trying to typeset a poem from XML, but I can't figure out how to make the 
inbetween key working here.
As the source is XML, I cannot just add an empty line to start a new group of 
lines inside \startlines...\stoplines. I guess, there must be a command to do 
that, but \par seems to have no effect here.
How can this be done?

Best,
Denis

%%%
\setuplines[before={\blank},after={\blank},inbetween={ARE WE INBETWEEN?\blank}]

% XML Nodes auswählen
\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{doc|poem|stanza|line}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

\startxmlsetups xml:doc
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:poem
\startlines
   \xmlflush{#1}
\stoplines
\stopxmlsetups

\startxmlsetups xml:stanza
   \xmlflushlinewise{#1}\par %this has no effect
\stopxmlsetups

\startxmlsetups xml:line
\xmlflush{#1}
\stopxmlsetups

\startbuffer[test]




The
lines
are
there!


The
lines
are
there!



\stopbuffer


\starttext

This works:

\startlines
The
lines
are
there!

The
lines
are
there!
\stoplines

Apparently, \type{\par} has no effect here:

\startlines
The
lines
are
there!\par% \par has no effect here
The
lines
are
there!
\stoplines

For background, this is what I'm actually trying to do:

\xmlprocessbuffer{test}{test}{}

\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: The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
Hi,
Here is the code that interferes with the graph from the last chapter but
why ?

 \startMPcode
 pickup pencircle xscaled 1;
 defaultfont  := "texgyrepagella-regular*default" ;
 defaultscale := 0.8 ;
 path circle, p, q, b;

 circle = fullcircle xscaled 5cm yscaled 3.5cm;
 p = (point 2 of circle .. (-0.15cm,1.5cm)
..(0,0)..(0.15cm,-1.5cm).. point 6 of circle);
 q = (subpath(0,2) of circle -- p -- subpath(6,8) of circle
--cycle);
 b = (reverse p -- subpath(2,6) of circle -- cycle);

 definecolor [ name = "mp:red", r = 1 ];
 definecolor [ name = "mp:blue", r = 0.54, g = 0.17, b = 0.89 ];

 fill q withcolor "mp:red" withtransparency(1,0.4) ;
 fill b withcolor "mp:blue" withtransparency(1,0.4) ;
 draw circle;
 draw p;

 label("$\overline{\text{A}}$",( 1.5cm,0));
 label("$\text{A}$",(-1.5cm,0));
 label.top("E",(0,1.85cm));
   \stopMPcode

Le jeu. 25 avr. 2024 à 16:55, Fabrice Couvreur 
a écrit :

> Hi Hans and Taco,
> @Hans, I compiled by commenting and uncommenting one component at a time;
> it is component 5 which interferes with the metapost code of component 14
> All I have to do now is find out what the cause is.
> Fabrice
>
> Le jeu. 25 avr. 2024 à 16:40, Taco Hoekwater  a écrit :
>
>>
>>
>> > On 25 Apr 2024, at 16:08, Fabrice Couvreur 
>> wrote:
>> >
>> > Hi Taco,
>> > I knew I wouldn't be able to explain what was happening.
>> > The code works perfectly and the figure is clearly visible in the
>> component chapter-14 :
>>
>> It is probably not related to the figure itself. Something may be
>> different in this component compared to the other ones. I cannot really
>> say, of course. Still, using external image instead of inline metapost may
>> be fix it. Not elegant, but if it works it works!
>>
>> Good luck,
>> Taco
>>
>>
>> >
>> > \startcomponent[chapter-14]
>> > \startMPpage
>> > ...
>> > \stopMPpage
>> > \stopcomponent
>> >
>> > But if I compile my project, it disappears !!
>> >
>> > \startproduct[terminale-manual]
>> >  \startbodymatter
>> >   \component[chapter-1]
>> >   \component[chapter-2]
>> >   \component[chapter-3]
>> >   \component[chapter-4]
>> >   \component[chapter-5]
>> >   \component[chapter-6]
>> >   \component[chapter-7]
>> >   \component[chapter-8]
>> >   \component[chapter-9]
>> >   \component[chapter-10]
>> >   \component[chapter-11]
>> >   \component[chapter-12]
>> >   \component[chapter-13]
>> >   \component[chapter-14]
>> > \stopbodymatter
>> > \stopproduct
>>
>> —
>> 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: 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
ril 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]
> > > > 
> > > > \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: The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
Hi Hans and Taco,
@Hans, I compiled by commenting and uncommenting one component at a time;
it is component 5 which interferes with the metapost code of component 14
All I have to do now is find out what the cause is.
Fabrice

Le jeu. 25 avr. 2024 à 16:40, Taco Hoekwater  a écrit :

>
>
> > On 25 Apr 2024, at 16:08, Fabrice Couvreur 
> wrote:
> >
> > Hi Taco,
> > I knew I wouldn't be able to explain what was happening.
> > The code works perfectly and the figure is clearly visible in the
> component chapter-14 :
>
> It is probably not related to the figure itself. Something may be
> different in this component compared to the other ones. I cannot really
> say, of course. Still, using external image instead of inline metapost may
> be fix it. Not elegant, but if it works it works!
>
> Good luck,
> Taco
>
>
> >
> > \startcomponent[chapter-14]
> > \startMPpage
> > ...
> > \stopMPpage
> > \stopcomponent
> >
> > But if I compile my project, it disappears !!
> >
> > \startproduct[terminale-manual]
> >  \startbodymatter
> >   \component[chapter-1]
> >   \component[chapter-2]
> >   \component[chapter-3]
> >   \component[chapter-4]
> >   \component[chapter-5]
> >   \component[chapter-6]
> >   \component[chapter-7]
> >   \component[chapter-8]
> >   \component[chapter-9]
> >   \component[chapter-10]
> >   \component[chapter-11]
> >   \component[chapter-12]
> >   \component[chapter-13]
> >   \component[chapter-14]
> > \stopbodymatter
> > \stopproduct
>
> —
> 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: The graph is not visible.

2024-04-25 Thread Taco Hoekwater


> On 25 Apr 2024, at 16:08, Fabrice Couvreur  
> wrote:
> 
> Hi Taco,
> I knew I wouldn't be able to explain what was happening.
> The code works perfectly and the figure is clearly visible in the component 
> chapter-14 :

It is probably not related to the figure itself. Something may be different in 
this component compared to the other ones. I cannot really say, of course. 
Still, using external image instead of inline metapost may be fix it. Not 
elegant, but if it works it works!

Good luck,
Taco


> 
> \startcomponent[chapter-14]
> \startMPpage
> ...
> \stopMPpage
> \stopcomponent
> 
> But if I compile my project, it disappears !!
> 
> \startproduct[terminale-manual]
>  \startbodymatter
>   \component[chapter-1]
>   \component[chapter-2]
>   \component[chapter-3]
>   \component[chapter-4]
>   \component[chapter-5]
>   \component[chapter-6]
>   \component[chapter-7]
>   \component[chapter-8]
>   \component[chapter-9]
>   \component[chapter-10]
>   \component[chapter-11]
>   \component[chapter-12]
>   \component[chapter-13]
>   \component[chapter-14]
> \stopbodymatter
> \stopproduct

— 
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] Re: The graph is not visible.

2024-04-25 Thread Hans Hagen

On 4/25/2024 4:08 PM, Fabrice Couvreur wrote:

Hi Taco,
I knew I wouldn't be able to explain what was happening.
The code works perfectly and the figure is clearly visible in the 
component chapter-14 :


\startcomponent[chapter-14]
\startMPpage
...
\stopMPpage
\stopcomponent

But if I compile my project, it disappears !!

\startproduct[terminale-manual]
  \startbodymatter
       \component[chapter-1]
       \component[chapter-2]
       \component[chapter-3]
       \component[chapter-4]
       \component[chapter-5]
       \component[chapter-6]
       \component[chapter-7]
       \component[chapter-8]
       \component[chapter-9]
       \component[chapter-10]
       \component[chapter-11]
       \component[chapter-12]
       \component[chapter-13]
       \component[chapter-14]
     \stopbodymatter
\stopproduct

-- compile with specific preceding chapters commented
-- when the interfering one is found, make a copy and strip till the 
problem is gone


it might be that you redefine something metapost

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] Re: The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
Hi Taco,
I knew I wouldn't be able to explain what was happening.
The code works perfectly and the figure is clearly visible in the component
chapter-14 :

\startcomponent[chapter-14]
\startMPpage
...
\stopMPpage
\stopcomponent

But if I compile my project, it disappears !!

\startproduct[terminale-manual]
 \startbodymatter
  \component[chapter-1]
  \component[chapter-2]
  \component[chapter-3]
  \component[chapter-4]
  \component[chapter-5]
  \component[chapter-6]
  \component[chapter-7]
  \component[chapter-8]
  \component[chapter-9]
  \component[chapter-10]
  \component[chapter-11]
  \component[chapter-12]
  \component[chapter-13]
  \component[chapter-14]
\stopbodymatter
\stopproduct

Le jeu. 25 avr. 2024 à 13:36, Taco Hoekwater  a écrit :

> H Fabrice,
>
> You did not provide a good minimum test because the graph by itself
> renders fine:
>
>
>
> Best wishes,
> Taco
> (if all else fails, you can replace \startMPcode with \startMPpage and
> generate a standalone graph that way)
>
> > On 25 Apr 2024, at 12:27, Fabrice Couvreur 
> wrote:
> >
> > Hi,
> > I don't know if I can explain the problem I'm having. I made a project
> with 14 chapters. In each of them, there are graphics embedding metapost
> code. I proceed as follows : I compile each chapter alone with lmtx then I
> compile the project containing the 14 chapters. I didn't encounter any
> problems except with a graphic from the last chapter. It is indeed in
> chapter 14 but not in the project ! I give the code for this graph.
> > Thanks.
> > Fabrice
> >
> > \startMPcode
> >
> >interim linejoin := mitered;
> >interim ahangle := 30;
> >numeric u, pi;
> >
> >pi = 3.141592653589793;
> >u = 1.5cm;
> >
> >vardef graph_of_function (suffix f) (expr xmin, xmax,
> xsep) =
> >   for x = xmin step xsep until xmax: (x, f(x)) .. endfor
> (xmax, f(xmax))
> >enddef ;
> >
> >vardef vline (suffix f, g) (expr x) = (x, min(f(x),
> g(x))) -- (x, max(f(x),g(x))) enddef;
> >
> >vardef area_between_functions (suffix f, g)(expr a, b,
> xsep) =
> >   buildcycle(graph_of_function(f, a, b, xsep), vline(f,
> g, b),
> >   reverse graph_of_function(g, a, b, xsep), reverse
> vline(f, g, a))
> >enddef;
> >
> >vardef xaxis (expr xmin, xmax) = (xmin, 0) -- (xmax, 0)
> enddef ;
> >    vardef yaxis (expr ymin, ymax) = (0, ymin) -- (0, ymax)
> enddef ;
> >
> >
> >xmin:=-pi/2; xmax := 3*pi/2;
> >ymin := -1.5; ymax := 5;
> >
> >
> >vardef f(expr x)= exp(-x)*(-cos(x)+sin(x)+1) enddef;
> >vardef g(expr x)=-exp(-x)*cos(x) enddef;
> >path C_f, C_g;
> >C_f = graph_of_function(f,xmin, xmax, .1);
> >C_g = graph_of_function(g, xmin, xmax, .1);
> >
> >a := xpart(C_f intersectionpoint C_g);
> >b := xpart(reverse C_f intersectionpoint reverse C_g);
> >
> >fill (area_between_functions(f, g, a, b, 0.1)) scaled u
> withcolor 0.4[white, blue];
> >draw C_f scaled u withcolor blue;
> >draw C_g scaled u withcolor blue;
> >
> >
> >\stopMPcode
> >
> ___
> > 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] Re: The graph is not visible.

2024-04-25 Thread Taco Hoekwater
H Fabrice,

You did not provide a good minimum test because the graph by itself renders 
fine:



fabr.pdf
Description: Adobe PDF document


Best wishes,
Taco
(if all else fails, you can replace \startMPcode with \startMPpage and generate 
a standalone graph that way)

> On 25 Apr 2024, at 12:27, Fabrice Couvreur  
> wrote:
> 
> Hi,
> I don't know if I can explain the problem I'm having. I made a project with 
> 14 chapters. In each of them, there are graphics embedding metapost code. I 
> proceed as follows : I compile each chapter alone with lmtx then I compile 
> the project containing the 14 chapters. I didn't encounter any problems 
> except with a graphic from the last chapter. It is indeed in chapter 14 but 
> not in the project ! I give the code for this graph.
> Thanks.
> Fabrice
> 
> \startMPcode
> 
>interim linejoin := mitered;
>interim ahangle := 30;
>numeric u, pi;
>  
>pi = 3.141592653589793;
>u = 1.5cm;
>  
>vardef graph_of_function (suffix f) (expr xmin, xmax, xsep) =
>   for x = xmin step xsep until xmax: (x, f(x)) .. endfor 
> (xmax, f(xmax))
>enddef ;
> 
>vardef vline (suffix f, g) (expr x) = (x, min(f(x), g(x))) -- 
> (x, max(f(x),g(x))) enddef;
> 
>vardef area_between_functions (suffix f, g)(expr a, b, xsep) =
>   buildcycle(graph_of_function(f, a, b, xsep), vline(f, g, 
> b), 
>   reverse graph_of_function(g, a, b, xsep), reverse vline(f, 
> g, a))
>enddef;
> 
>vardef xaxis (expr xmin, xmax) = (xmin, 0) -- (xmax, 0) enddef 
> ;
>vardef yaxis (expr ymin, ymax) = (0, ymin) -- (0, ymax) enddef 
> ;
> 
>  
>xmin:=-pi/2; xmax := 3*pi/2; 
>ymin := -1.5; ymax := 5;
>   
> 
>vardef f(expr x)= exp(-x)*(-cos(x)+sin(x)+1) enddef;
>vardef g(expr x)=-exp(-x)*cos(x) enddef;
>path C_f, C_g;
>C_f = graph_of_function(f,xmin, xmax, .1);
>C_g = graph_of_function(g, xmin, xmax, .1);
> 
>a := xpart(C_f intersectionpoint C_g); 
>b := xpart(reverse C_f intersectionpoint reverse C_g);
> 
>fill (area_between_functions(f, g, a, b, 0.1)) scaled u 
> withcolor 0.4[white, blue];
>draw C_f scaled u withcolor blue;
>draw C_g scaled u withcolor blue;
>   
>   
>\stopMPcode
> ___
> 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] The graph is not visible.

2024-04-25 Thread Fabrice Couvreur
Hi,
I don't know if I can explain the problem I'm having. I made a project with
14 chapters. In each of them, there are graphics embedding metapost code. I
proceed as follows : I compile each chapter alone with lmtx then I compile
the project containing the 14 chapters. I didn't encounter any problems
except with a graphic from the last chapter. It is indeed in chapter 14 but
not in the project ! I give the code for this graph.
Thanks.
Fabrice

\startMPcode

   interim linejoin := mitered;
   interim ahangle := 30;
   numeric u, pi;

   pi = 3.141592653589793;
   u = 1.5cm;

   vardef graph_of_function (suffix f) (expr xmin, xmax, xsep) =
  for x = xmin step xsep until xmax: (x, f(x)) .. endfor
(xmax, f(xmax))
   enddef ;

   vardef vline (suffix f, g) (expr x) = (x, min(f(x), g(x)))
-- (x, max(f(x),g(x))) enddef;

   vardef area_between_functions (suffix f, g)(expr a, b, xsep)
=
  buildcycle(graph_of_function(f, a, b, xsep), vline(f, g,
b),
  reverse graph_of_function(g, a, b, xsep), reverse
vline(f, g, a))
   enddef;

   vardef xaxis (expr xmin, xmax) = (xmin, 0) -- (xmax, 0)
enddef ;
   vardef yaxis (expr ymin, ymax) = (0, ymin) -- (0, ymax)
enddef ;


   xmin:=-pi/2; xmax := 3*pi/2;
   ymin := -1.5; ymax := 5;


   vardef f(expr x)= exp(-x)*(-cos(x)+sin(x)+1) enddef;
   vardef g(expr x)=-exp(-x)*cos(x) enddef;
   path C_f, C_g;
   C_f = graph_of_function(f,xmin, xmax, .1);
   C_g = graph_of_function(g, xmin, xmax, .1);

   a := xpart(C_f intersectionpoint C_g);
   b := xpart(reverse C_f intersectionpoint reverse C_g);

   fill (area_between_functions(f, g, a, b, 0.1)) scaled u
withcolor 0.4[white, blue];
   draw C_f scaled u withcolor blue;
   draw C_g scaled u withcolor blue;


   \stopMPcode
___
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] Define a new command that inherits from multiple other command options

2024-04-25 Thread ai2472206007
hi!

I'm new to ConTeXt. I want to define a command with sidenote function. This 
[setupsidenote] command inherits the options of [setupmargindata], 
[setupcounter] and [setupframed]. just like [setupenumeration] inherits the 
option of [setupcounter].

I've defined the following sidenote command by searching, and I know how to 
define a new option for it. But what I don't know is how to get it to inherit 
the options of other commands and perform these features correctly.

Any clue is warmly welcome.

```
% macros=mkvi
\unprotect
\installnamespace  {sidenote}
\installcommandhandler \sidenote  {sidenote}  \sidenote
\setupsidenote[
   align=,
   conversion=n,
   way=bytext,
   style=,
]

\definecounter[SidenoteMarkNumber] [prefix=no]
\definemargindata [SidenoteContent][outer]
  [margin=margin,width=\outermarginwidth]
\setupmargindata  [SidenoteContent][stack=yes,style=\it]
\def\sidenotemark{\rawcountervalue[SidenoteMarkNumber]}
\def\convertsidenotemark#1{\high{\convertnumber{#1}{\sidenotemark}}}
\def\sidenote{\dosingleempty\dosidenote}
\def\dosidenote[#1]#2{%
\getparameters[SMsidenote]
  [align=\sidenoteparameter{align},
  conversion=\sidenoteparameter{conversion},
  way=\sidenoteparameter{way},
   #1]%
 \setupcounter[SidenoteMarkNumber] [#1]
 \incrementcounter[SidenoteMarkNumber]
 \convertsidenotemark{\SMsidenoteconversion}% mark in text
 \SidenoteContent[#1]{\setscript[hanzi]\setup[\SMsidenotealign]%
  \convertsidenotemark{\SMsidenoteconversion}% mark with 
note
  #2
}}
\protect
\starttext
天地玄黄,宇宙洪荒。日月盈昃,辰宿列张。寒来暑往,秋收冬\sidenote[align=flushleft] {天地玄黄,宇宙洪荒。}
\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: what are the interaction between \showframe and \realpageno in \startuseMPgraphic ?

2024-04-24 Thread Wolfgang Schuster

garu...@azules.eu schrieb am 20.04.2024 um 23:00:

I can not figure out why this progress bar only works when \showframe is 
activated.
When you comment on \showframe, it's as if \realpageno is at zero.
(current version: 2024.04.01 08:59)

\showframe

\startuseMPgraphic{MonGraphisme_MP}
   numeric n ; n := \number\realpageno ;
   numeric m ; m := \number\lastpageno ;
   numeric h ; h := \overlayheight ;
   numeric w ; w := \overlaywidth ;
   numeric e ; e := 3mm;
   numeric r ; r := (((n-1)/(m-1))*w);
   fill fullsquare xscaled w yscaled e shifted (w/2, h/2) withcolor darkblue ;
   fill fullsquare xscaled r yscaled e shifted (r/2, h/2) withcolor darkred;
\stopuseMPgraphic

\defineoverlay [MonGraphisme_OL] [\useMPgraphic{MonGraphisme_MP}]

\setupbackgrounds [footer] [rightmargin] [background={MonGraphisme_OL}]

\starttext
\dorecurse{10}{\input tufte\page}
\stoptext

Any clue is warmly welcome


You need

    \setupbackgrounds[state=repeat]

which is set when you use \showframe.

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 don't footnotes appear in floats or figures?

2024-04-23 Thread Joel via ntg-context
 Okay, I've been trying many things with this \startpostponing code--if I 
understand what's happening, its moving the figures to a later page. I'm not 
sure that's quite ideal, its not fully working with my actual documents, and 
leaves lots of empty white space, when I'm already in a situation where I need 
to reduce page count.
So I thought an alternative route:
(1) have a code that checks "what is current footnote number?" that sets that 
as a variable
\def\currentfoodnote{\somevariableincontextthatgetsfoodnotenumber}
(2) adjust my placefigure macro such that the footnote is outside the 
placefigure, but color it white so its invisible:
\define\showafigure{

\cite[author2019]<--somehow hide this invisible
 
\placefigure{Caption\superscript{\currentfootnote}}}{\externalfigure[cow][width=\textwidth]}
 <--this places a superscript number inside the caption, but it isn't the true 
marker(3) in the caption, place a superscript number with value to 
\currentfootnoteIts basically a fake footnote, just a superscript number of the 
same value as the real footnote.


Shouldn't this result work? Any idea how I can get current footnote value?
--Joel

   On Monday, April 22, 2024 at 07:22:24 AM MDT, vm via ntg-context 
 wrote:  
 
 

On 22/04/2024 14:38, Joel via ntg-context wrote:
> 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



double stop ?

___
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] 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: 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] 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] floats re-ordering and numbering

2024-04-22 Thread denis.maier
Hi,

I've found that occasionally the order of floats change, but the numbering 
still reflects the order in the input file. Is that the intended behaviour? Is 
there a way to number to floats according to their order in the (visual) output?

Best,
Denis

%%%
\setupexternalfigures
[location={local,global,default}]

\setupfloats[compress=no]
\setupfloat[figure][default=top]

\starttext

\input knuth

\placefigure{Cow 1}{\externalfigure[cow][
width=.5\textwidth,
]}
\placefigure{Cow 2}{\externalfigure[cow][
width=.8\textwidth,
]}

\placefigure{Cow 3}{\externalfigure[cow][
width=.7\textwidth,
]}

\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 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] Why don't footnotes appear in floats or figures?

2024-04-21 Thread Joel via ntg-context
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 message2 message3 message5 message6 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.
--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] what are the interaction between \showframe and \realpageno in \startuseMPgraphic ?

2024-04-20 Thread garulfo
I can not figure out why this progress bar only works when \showframe is 
activated.
When you comment on \showframe, it's as if \realpageno is at zero.
(current version: 2024.04.01 08:59)

\showframe

\startuseMPgraphic{MonGraphisme_MP}
  numeric n ; n := \number\realpageno ;
  numeric m ; m := \number\lastpageno ;
  numeric h ; h := \overlayheight ;
  numeric w ; w := \overlaywidth ;
  numeric e ; e := 3mm;
  numeric r ; r := (((n-1)/(m-1))*w);
  fill fullsquare xscaled w yscaled e shifted (w/2, h/2) withcolor darkblue ;
  fill fullsquare xscaled r yscaled e shifted (r/2, h/2) withcolor darkred;
\stopuseMPgraphic

\defineoverlay [MonGraphisme_OL] [\useMPgraphic{MonGraphisme_MP}]

\setupbackgrounds [footer] [rightmargin] [background={MonGraphisme_OL}]

\starttext
\dorecurse{10}{\input tufte\page}
\stoptext

Any clue is warmly welcome
___
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 isolate serious errors from warnings?

2024-04-20 Thread Bruce Horrocks


> On 18 Apr 2024, at 01:09, Joel via ntg-context  wrote:
...
> Or maybe to use > to send the errors to another file for careful study? 
> (using Linux if that matters)

You can run the job from the command line and redirect to a file:

  $ context file.tex > output.log 2>&1

but that is essentially the same as the .log file that is produced by default 
when you run from the command line.

As your book is large you could try adding \writestatus commands at suitable 
points so that when your messages appear in the log you know that processing 
reached that far in the book.

Also you could use \writestatus to output messages before and after known 
problem areas so you can look to see if there is any telltale output in the log 
and then search for that elsewhere.

HTH
—
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: How to isolate serious errors from warnings?

2024-04-19 Thread Hans Hagen

On 4/18/2024 8:26 AM, Henning Hraban Ramm wrote:

Am 18.04.24 um 02:09 schrieb Joel via ntg-context:
I'm about to have a lengthy (2,000+ page) document published. Normally 
if it compiles and looks okay, I regard that as meaning no errors 
appeared, but I've noticed that sometimes ConTeXt will still compile, 
even if something isn't displayed on screen as it should:


(1) I tried placing a table inside a startitemize environment, as 
instead of it not compiling, it left a message in the document warning 
that wasn't supported.


(2) In another case, I had an image that ConTeXt couldn't find, as I 
mispelled the filenmame, and it fully compiled and made a PDF, without 
me noticing.


(3) Or maybe in some case, a font couldn't be found for a specific 
character, so a single character in the file isn't displaying.


Those are just some examples; I intended for something to be printed 
on the PDF, but it isn't showing there.


Since a document of this size will have a lot of messages, is there a 
way to adjust the settings, from "show everything" to "show some" to 
"show only serious errors"? Or maybe to use > to send the errors to 
another file for careful study? (using Linux if that matters)


You can enable trackers like

\enabletrackers[figures.*]

But that just gives more log messages for debugging.

You get the list of all trackers with:

context --global m-trackers.mkiv


For your use case, directives are more helpful, like

\enabledirectives[logs.errors=*] (i.e. break at every error)

AFAIK that just handles missing characters, references and modules ATM, 
but this information might be outdated.


You get all directives with

context --global m-directives.mkiv


often the log files has some summaries at the end



-
  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] 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: How to isolate serious errors from warnings?

2024-04-18 Thread Henning Hraban Ramm

Am 18.04.24 um 02:09 schrieb Joel via ntg-context:
I'm about to have a lengthy (2,000+ page) document published. Normally 
if it compiles and looks okay, I regard that as meaning no errors 
appeared, but I've noticed that sometimes ConTeXt will still compile, 
even if something isn't displayed on screen as it should:


(1) I tried placing a table inside a startitemize environment, as 
instead of it not compiling, it left a message in the document warning 
that wasn't supported.


(2) In another case, I had an image that ConTeXt couldn't find, as I 
mispelled the filenmame, and it fully compiled and made a PDF, without 
me noticing.


(3) Or maybe in some case, a font couldn't be found for a specific 
character, so a single character in the file isn't displaying.


Those are just some examples; I intended for something to be printed on 
the PDF, but it isn't showing there.


Since a document of this size will have a lot of messages, is there a 
way to adjust the settings, from "show everything" to "show some" to 
"show only serious errors"? Or maybe to use > to send the errors to 
another file for careful study? (using Linux if that matters)


You can enable trackers like

\enabletrackers[figures.*]

But that just gives more log messages for debugging.

You get the list of all trackers with:

context --global m-trackers.mkiv


For your use case, directives are more helpful, like

\enabledirectives[logs.errors=*] (i.e. break at every error)

AFAIK that just handles missing characters, references and modules ATM, 
but this information might be outdated.


You get all directives with

context --global m-directives.mkiv


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] How to isolate serious errors from warnings?

2024-04-17 Thread Joel via ntg-context
I'm about to have a lengthy (2,000+ page) document published. Normally if it 
compiles and looks okay, I regard that as meaning no errors appeared, but I've 
noticed that sometimes ConTeXt will still compile, even if something isn't 
displayed on screen as it should:

(1) I tried placing a table inside a startitemize environment, as instead of it 
not compiling, it left a message in the document warning that wasn't supported.
(2) In another case, I had an image that ConTeXt couldn't find, as I mispelled 
the filenmame, and it fully compiled and made a PDF, without me noticing.
(3) Or maybe in some case, a font couldn't be found for a specific character, 
so a single character in the file isn't displaying.
Those are just some examples; I intended for something to be printed on the 
PDF, but it isn't showing there.

Since a document of this size will have a lot of messages, is there a way to 
adjust the settings, from "show everything" to "show some" to "show only 
serious errors"? Or maybe to use > to send the errors to another file for 
careful study? (using Linux if that matters)

--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: 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] Re: Most recent context doesn't like synctex?

2024-04-15 Thread Jim
Hi Mikael (and other synctex users),

On Sat, Apr 13, 2024 at 22:28 (+0200), Mikael Sundqvist wrote:

> Hi,

> On Sat, Apr 13, 2024 at 7:54 PM Jim  wrote:

>> Thanks for the quick reply.

>> On Sat, Apr 13, 2024 at 09:18 (+0200), Hans Hagen wrote:

>>> On 4/13/2024 12:39 AM, Jim wrote:
>>>> Hi,

>>>> I have both TeXlive 2024 and the stand-alone ConTeXt distribution on my
>>>> system.

>>>> Recently, the stand-alone ConTeXt distribution seems to not create a
>>>> synctex file any more.  Specifically,

>>>>  /usr/local/context/tex/texmf-linux-64/bin/context --once --texutil 
>>>> --synctex=1 --nonstop file.tex

>>>> does not create a .synctex file (and deletes it, if it is there), whereas
>>>> the TeXlive version

>>>>  /usr/local/texlive/2024/bin/x86_64-linux/context --once --texutil 
>>>> --synctex=1 --nonstop nwg_newsletter_2024_04.tex

>>>> does create the .synctex file.


>>>> The ConTeXt distribution version *does* create the file if --nonstop is
>>>> *not* used.  Knowing that, I can work around this for now, although
>>>> emacs+auctex probably won't be happy without --nonstop.

>>>> I updated the stand-alone ConTeXt a few minutes ago, so I'm up to date on
>>>> that.

>>>> Is this a bug introduced by some recent change?

>>> it's more a feature

>> I guess one person's bug is another person's feature.  :-)

>>> - Mikael S and i spend some time with editor/viewer combinations on linux in
>>> order to find ways around the different synctex libs that they use

>>> - as a result we could make most work ok

>> Are these recent changes?  And should emacs+auctex+PDFview work now?

> What will work will depend on the viewers.  We noticed a few weeks ago
> that synctex (pdf -> editor) was not working in a few viewers (okular)
> while it was working in others.  After some debugging, our conclusion
> was that different versions of the library/application were used, or
> different approaches.  We found a way to generate the stuff in the pdf
> to make it work for the failing viewers we had.  Hans did then not
> replace this with the old approach, since then the previously working
> viewers might break.  He therefore added repeat as a key, so
> \setupsynctex[state=repeat] will use the new approach.

Thanks for that clarification.


>>> - we assume that synctex is set up in the document with

>>> \setupsynctex[state=start]
>>> \setupsynctex[state=repeat] % less efficient but gets around issue

>> I haven't been using either of those, since auctex does The Right Thing for
>> me.  Or, at least, it used to.

>>> - when context is run 'headless' (on a server) it's often done in
>>> batchmode because one knows that the style works and in that case synctex
>>> makes no sense so we disable it; this avoids the need to patch the style

>> I (think I) see what you are saying, but if one explicitly uses --synctex
>> on the command line, should that not over-ride the over-ride?  Or, put
>> another way, would the following not make sense:
>> if --synctex is used on the command line
>> create synctex file
>> else if --nonstop is used on the command line
>> do not create the synctex file
>> else if \setupsynctex[...] is used in the source file
>> create the synctex file
>> else
>> do not create the synctex file

>>> - the manual has been updates

> workflows-synctex.tex now suggests:

> "When your viewer doesn't return to the editor, you can try

> \starttyping
> \setupsynctex[state=repeat]
> \stoptyping

> or

> \starttyping
> context --synctex=repeat somefile.tex
> \stoptyping

> This will give a bit larger file that tries to fool the areas resolver in the
> library that the viewer uses."

Looking at two synctex files, it would seem that the state=repeat version
creates a synctex file that has syntax matching the "original" synctex
format.  And you are right, the file is bigger.

In any case, now that I know what is going on, I have convinced auctex to
play nicely with the new way of doing things, and so all is now good.


Question for anyone who made it down this far:
Is there a mailing list or other way that a ConTeXt user can find out about
non-backward-compatible changes like this?  I wasted a fair amount of time
tracking this problem down (*), and if there is some other mailing list I
should be subscribed to, I'd love to know about it.

(*) Unfortunately, this change to ConTeXt happened around the same time I
upgraded emacs from 27.2 to 29.3, and when things didn't work I upgraded
auctex from 13.

[NTG-context] Re: Most recent context doesn't like synctex?

2024-04-15 Thread Jim
Hraban and any emacs users:

On Sun, Apr 14, 2024 at 11:56 (+0200), Henning Hraban Ramm wrote:

> Am 13.04.24 um 22:28 schrieb Mikael Sundqvist:
>> What will work will depend on the viewers. We noticed a few weeks ago
>> that synctex (pdf -> editor) was not working in a few viewers (okular)
>> while it was working in others.

> Could you please tell us which combinations of viewers and editors you
> checked and how to configure them to make it work?

The --synctex=repeat option outputs a synctex file that works with auctex'
epdfinfo program, so (at least when using PDFview) forward and backward
search now work with emacs+auctex, at least when you
(a) put
(setq ConTeXt-texexec-option-nonstop "")
in your ConTeXt mode hook (or some other sensible place), and
(b) edit the ConTeXt-expand-options defun in auctex' context.el
(or redefine the function in some hook) to replace
--synctex=1
with
--synctex=repeat

I have submitted a bug report to auctex about (b) and another item, but I
have no idea if/when the fixes will make it into a new release of auctex.

Jim
___
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] [ using horizontal table lines ]

2024-04-15 Thread vm via ntg-context

I'm probably using the \starttable incorrectly:

with this code I only get only *one* horizontal line in the header

\starttable[|r|r|r|r|r|r|r|l|r|r|r|r|][bodyfont=9pt]
\NC step\NC frac\NC ival\NC  \NC\Use{4}[cI]{freq 
(Hz)}\NC~\NC\Use{4}[cI]{wavelength (m)}\AR

\NC\DC\DC\DC\DL[4]\DL[4]\AR
\NC 0 \NC 0.00 \NC 0.000 \NC 12.50\NC 13.75\NC 15.00\NC 12.25\NC A\ \NC 
27.20\NC 24.73\NC 22.67\NC 27.76\AR
\NC 1 \NC 0.08 \NC 0.115 \NC 13.94\NC 15.34\NC 16.73\NC 13.66\NC A\#\NC 
24.38\NC 22.17\NC 20.32\NC 24.88\AR
\NC 2 \NC 0.17 \NC 0.222 \NC 15.28\NC 16.81\NC18.34\NC14.97\NC 
B\ \NC 22.25\NC 20.23\NC 18.54\NC 22.71\AR

\stoptable




with this code I get two horizontal lines, but the second is too short.

\starttable[|r|r|r|r|r|r|r|l|r|r|r|r|][bodyfont=9pt]
\NC step\NC frac\NC ival\NC  \NC\Use{4}[cI]{freq 
(Hz)}\NC~\NC\Use{4}[cI]{wavelength (m)}\AR

\NC\DC\DC\DC\DL[4]\DL[3]\AR
\NC 0 \NC 0.00 \NC 0.000 \NC 12.50\NC 13.75\NC 15.00\NC 12.25\NC A\ \NC 
27.20\NC 24.73\NC 22.67\NC 27.76\AR
\NC 1 \NC 0.08 \NC 0.115 \NC 13.94\NC 15.34\NC 16.73\NC 13.66\NC A\#\NC 
24.38\NC 22.17\NC 20.32\NC 24.88\AR
\NC 2 \NC 0.17 \NC 0.222 \NC 15.28\NC 16.81\NC18.34\NC14.97\NC 
B\ \NC 22.25\NC 20.23\NC 18.54\NC 22.71\AR

\stoptable


with this code I get two horizontal lines, with correct length, but 
above the wrong columns


\starttable[|r|r|r|r|r|r|r|l|r|r|r|r|][bodyfont=9pt]
\NC step\NC frac\NC ival\NC  \NC\Use{4}[cI]{freq 
(Hz)}\NC~\NC\Use{4}[cI]{wavelength (m)}\AR

\NC\DC\DC\DL[4]\DL[4]\AR
\NC 0 \NC 0.00 \NC 0.000 \NC 12.50\NC 13.75\NC 15.00\NC 12.25\NC A\ \NC 
27.20\NC 24.73\NC 22.67\NC 27.76\AR
\NC 1 \NC 0.08 \NC 0.115 \NC 13.94\NC 15.34\NC 16.73\NC 13.66\NC A\#\NC 
24.38\NC 22.17\NC 20.32\NC 24.88\AR
\NC 2 \NC 0.17 \NC 0.222 \NC 15.28\NC 16.81\NC18.34\NC14.97\NC 
B\ \NC 22.25\NC 20.23\NC 18.54\NC 22.71\AR

\stoptable


diff:
\NC\DC\DC\DC\DL[4]\DL[4]\AR
\NC\DC\DC\DC\DL[4]\DL[3]\AR
\NC\DC\DC\DL[4]\DL[4]\AR


There is (probably) a correct way to solve this.

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


  1   2   3   4   5   6   7   8   9   10   >