[NTG-context] Re: Specify separator within setupbtx for custom bibliography rendering

2024-06-21 Thread Gerion Entrup
Am Samstag, 1. Juni 2024, 16:16:38 MESZ schrieb Gerion Entrup:
> Hi,
> 
> according to the section "Custom citation renderings" in the bibliography 
> manual, I have specified an own setup for citation rendering.
> However, this seems only to work for single citations (of one source). I want 
> to also specify the separator but did not get it to run.
> 
> Here is a minimal example:
> ```
> \setupinteraction[state=start]
> 
> \startbuffer[testdata]
> @Book{knuth1,
>   author = {Donald E. Knuth},
>   title = {TEX and METAFONT. New directions in typesetting},
>   year = {1979},
>   publisher = {Addison-Wesley},
> }
> @Article{someother,
>   author = {Some Person and Some Otherperson},
>   title = {Another title},
>   year = {1900},
> }
> \stopbuffer
> 
> % enable tracing
> \enabletrackers[publications, publications.crossref, publications.details, 
> publications.cite, publications.strings]
> 
> \usebtxdataset[main][testdata.buffer]
> \usebtxdefinitions[aps]
> \setupbtx[dataset=main]
> \definebtxrendering[bibrendering][aps][dataset=main, numbering=short]
> \setupbtxlist[aps][
>   alternative=b,
>   distance=.5em,
> ]
> 
> \definebtx[aps:cite:special][aps:cite][
>   left={((},
>   right={))},
>   separator:2={sfd},
>   separator:3={sfd},
>   separator:4={sfd},
> ]
> 
> \startsetups btx:aps:cite:special
>   % just a dummy
>   \btxcitereference
>   \currentbtxtag
> \stopsetups
> 
> \setupbtx[aps:cite][
>   alternative=special,
> ]
> 
> \starttext
> 
> Both said something~\cite[knuth1, someother].
> 
> \placelistofpublications[bibrendering]
> 
> \stoptext
> ```
> 
> The output of this is:
> 
> > Both said something ((knuth1someother)).
> 
> How can I get the separator to work? My expectation would be:
> 
> > Both said something ((knuth1sfdsomeother)).
> 
> or
> 
> > Both said something ((knuth1sfd someother)).

I got some understanding of the underlying code now.
This setup solves the above issue:

```
\startsetups btx:aps:cite:special
% just a dummy
\fastsetup{btx:cite:concat}
\btxcitereference
\currentbtxtag
\stopsetups
```

Gerion


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: \brokenpenalties query

2024-06-20 Thread Mikael Sundqvist
Hi again,

in fact, the \brokenpenalties is new. So using \setpenalties on it in
the past did not do anything, since \ifdefined#1 would never be
true...

/Mikael

On Wed, Jun 19, 2024 at 4:45 PM Hans Hagen via ntg-context
 wrote:
>
> On 6/19/2024 4:06 PM, Mikael Sundqvist wrote:
> > Hi,
> >
> > On Wed, Jun 19, 2024 at 3:40 PM Alan Bowen  > <mailto:bowenala...@gmail.com>> wrote:
> >
> > I have in the past relied on
> >  \setpenalties\brokenpenalties{1}{1}\
> > to set the penalty for a page break after a hyphen. But with the
> > latest LMTX, when I run the file, I get the error message
> > Error count has to be 1 for \brokenpenalties
> >
> > Any advice on how to fix the file would be most welcome.
> >
> > Alan
> >
> >
> > Probably only Hans (or Wolfgang) can give a complete answer here. But
> >
> > \startsetups [*default]
> >\directsetup{*reset}
> >\frozen\brokenpenalties 1 1\relax
> > \stopsetups
> >
> > works here.
> >
> > /Mikael
> currently \brokenpenalties only takes one setting
>
> \permanent\protected\def\setpenalties#1#2#3%
>{\ifdefined#1%
>   \frozen#1\ifx#1\brokenpenalties
> \plusone#3\relax
>   \else
> \numexpr#2+\plusone\relax\space\expandedrepeat\numexpr#2\relax
>   { #3}\zerocount\relax
>   \fi
> \fi}
>
> > PS
> >
> > An interesting new feature is the possibility to set penalties depending
> > on left and right page, by using options. For example
> >
> > \startsetups [*default]
> >\directsetup{*reset}
> >\frozen\clubpenalties   3 options 4 1500 3000 250 500 0 0 \relax
> > \stopsetups
> >
> > sets club club penalties 1500 for first line and 250 for second for
> > going from left page to right page (and then 0 for the rest) and 3000
> > for first line and 500 for second (and rest 0) for going from right page
> > to left page.
> >
> > I hope this helps a bit.
> >
> > ___
> > 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
> > ___
>
> --
>
> -
>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: \brokenpenalties query

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

On 6/19/2024 4:06 PM, Mikael Sundqvist wrote:

Hi,

On Wed, Jun 19, 2024 at 3:40 PM Alan Bowen <mailto:bowenala...@gmail.com>> wrote:


I have in the past relied on
     \setpenalties\brokenpenalties{1}{1}\
to set the penalty for a page break after a hyphen. But with the
latest LMTX, when I run the file, I get the error message
Error   count has to be 1 for \brokenpenalties

Any advice on how to fix the file would be most welcome.

Alan


Probably only Hans (or Wolfgang) can give a complete answer here. But

\startsetups [*default]
   \directsetup{*reset}
   \frozen\brokenpenalties 1 1\relax
\stopsetups

works here.

/Mikael

currently \brokenpenalties only takes one setting

\permanent\protected\def\setpenalties#1#2#3%
  {\ifdefined#1%
 \frozen#1\ifx#1\brokenpenalties
   \plusone#3\relax
 \else
   \numexpr#2+\plusone\relax\space\expandedrepeat\numexpr#2\relax
 { #3}\zerocount\relax
 \fi
   \fi}


PS

An interesting new feature is the possibility to set penalties depending 
on left and right page, by using options. For example


\startsetups [*default]
   \directsetup{*reset}
   \frozen\clubpenalties   3 options 4 1500 3000 250 500 0 0 \relax
\stopsetups

sets club club penalties 1500 for first line and 250 for second for 
going from left page to right page (and then 0 for the rest) and 3000 
for first line and 500 for second (and rest 0) for going from right page 
to left page.


I hope this helps a bit.

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


--

-
  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: \brokenpenalties query

2024-06-19 Thread Mikael Sundqvist
Hi,

On Wed, Jun 19, 2024 at 3:40 PM Alan Bowen  wrote:

> I have in the past relied on
> \setpenalties\brokenpenalties{1}{1}\
> to set the penalty for a page break after a hyphen. But with the latest
> LMTX, when I run the file, I get the error message
> Errorcount has to be 1 for \brokenpenalties
> Any advice on how to fix the file would be most welcome.
>
> Alan
>

Probably only Hans (or Wolfgang) can give a complete answer here. But

\startsetups [*default]
  \directsetup{*reset}
  \frozen\brokenpenalties 1 1\relax
\stopsetups

works here.

/Mikael

PS

An interesting new feature is the possibility to set penalties depending on
left and right page, by using options. For example

\startsetups [*default]
  \directsetup{*reset}
  \frozen\clubpenalties   3 options 4 1500 3000 250 500 0 0 \relax
\stopsetups

sets club club penalties 1500 for first line and 250 for second for going
from left page to right page (and then 0 for the rest) and 3000 for first
line and 500 for second (and rest 0) for going from right page to left page.

I hope this helps a bit.
___
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 \setupdelimitedtext with an author (define custom variable?)

2024-06-18 Thread Gerion Entrup
Am Montag, 17. Juni 2024, 21:20:19 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 17.06.2024 um 13:04:
> > Am Donnerstag, 6. Juni 2024, 16:34:03 MESZ schrieb Wolfgang Schuster:
> >> [...]
> >>
> >> Wolfgang
> >>
> > 
> > I tried to combine this with the code of the mail thread: "setuphead in 
> > connection with the command argument" but had not luck.
> > ConTeXt always stops with:
> > ```
> > close source> level 1, order 2, name './mwe.tex'
> > tex error   > runaway error: end of file encountered
> > mtx-context | fatal error: return code: 1
> > ```
> > 
> > Here is the MWE:
> > ```
> > [...]
> > 
> > \startsetups[my_chapter]
> > \startlocalheadsetup
> > \startframed[chapter_frame]
> > \blank[2cm]
> > \startfont[Serif sa 8]
> > \color[darkgray]{\headnumbercontent}
> > \stopfont
> > \blank[5mm]
> > \startfont[SerifBold sa 2]
> > \color[m-indigo-800]{\headtextcontent}
> > \stopfont
> > \blank[1cm]
> > \startfont[SerifBold sa 1.5]
> > 
> > \color[m-indigo-800]{\structureuservariable{subtitle}}
> > \stopfont
> > \blank[3cm]
> > 
> > \startextract[author={\structureuservariable{quoteauthor}}]
> > \structureuservariable{quote}
> > \stopextract
> > \stopframed
> > \stoplocalheadsetup
> > \stopsetups
> 
> The userdata environment uses the buffer mechanism of Context which has 
> a few limitations where you can use it, e.g. putting the environment in 
> the arguments of other commands (like the setup-environment above) 
> fails. One way to avoid this is to replace the \startextract ... 
> \stopextract in this case with the code for the quoted text, another way 
> is to put all content in a buffer and just load the buffer in the 
> setups-environment.
> 
> \startbuffer[my_chapter]
>   \startlocalheadsetup
>   \startframed[chapter_frame]
>   ...
>   \stopframed
>   \stoplocalheadsetup
> \stopbuffer
> 
> \startsetups[my_chapter]
>\getbuffer[my_chapter]
> \stopsetups
> 
> Wolfgang
> 

Thanks, I solved it by embedding the extract code directly (more less).

Gerion


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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-17 Thread Wolfgang Schuster

Gerion Entrup schrieb am 17.06.2024 um 13:04:

Am Donnerstag, 6. Juni 2024, 16:34:03 MESZ schrieb Wolfgang Schuster:

[...]

Wolfgang



I tried to combine this with the code of the mail thread: "setuphead in connection 
with the command argument" but had not luck.
ConTeXt always stops with:
```
close source> level 1, order 2, name './mwe.tex'
tex error   > runaway error: end of file encountered
mtx-context | fatal error: return code: 1
```

Here is the MWE:
```
[...]

\startsetups[my_chapter]
\startlocalheadsetup
\startframed[chapter_frame]
\blank[2cm]
\startfont[Serif sa 8]
\color[darkgray]{\headnumbercontent}
\stopfont
\blank[5mm]
\startfont[SerifBold sa 2]
\color[m-indigo-800]{\headtextcontent}
\stopfont
\blank[1cm]
\startfont[SerifBold sa 1.5]

\color[m-indigo-800]{\structureuservariable{subtitle}}
\stopfont
\blank[3cm]

\startextract[author={\structureuservariable{quoteauthor}}]
\structureuservariable{quote}
\stopextract
\stopframed
\stoplocalheadsetup
\stopsetups


The userdata environment uses the buffer mechanism of Context which has 
a few limitations where you can use it, e.g. putting the environment in 
the arguments of other commands (like the setup-environment above) 
fails. One way to avoid this is to replace the \startextract ... 
\stopextract in this case with the code for the quoted text, another way 
is to put all content in a buffer and just load the buffer in the 
setups-environment.


\startbuffer[my_chapter]
\startlocalheadsetup
\startframed[chapter_frame]
...
\stopframed
\stoplocalheadsetup
\stopbuffer

\startsetups[my_chapter]
  \getbuffer[my_chapter]
\stopsetups

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

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


[NTG-context] Re: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-17 Thread Gerion Entrup
Am Donnerstag, 6. Juni 2024, 16:34:03 MESZ schrieb Wolfgang Schuster:
> \startsetups [userdata:extract]
>  \startnarrower
>  \setupindenting[next]
>  \getuserdata
>  \hairline
>  \dontleavehmode\wordright{\itx\userdataparameter{author}}
>  \stopnarrower
> \stopsetups
> 
> \defineuserdataalternative
>[extract]
>[renderingsetup=userdata:extract]
> 
> \defineuserdata
>[extract]
>[style=italic,
> alternative=extract]
> 
> \starttext
> 
> \startextract[author=René Descartes]
>  Cogito ergo sum.
> \stopextract
> 
> \stoptext
> 
> Wolfgang
> 

I tried to combine this with the code of the mail thread: "setuphead in 
connection with the command argument" but had not luck.
ConTeXt always stops with:
```
close source> level 1, order 2, name './mwe.tex'
tex error   > runaway error: end of file encountered
mtx-context | fatal error: return code: 1
```

Here is the MWE:
```
\startsetups [userdata:extract]
\getuserdata
\hairline
\itx\userdataparameter{author}
\stopsetups

% original definition (also does not work)
% \startsetups [userdata:extract]
%  \startnarrower
%  \setupindenting[next]
%  \getuserdata
%  \hairline
%  \dontleavehmode\wordright{\itx\userdataparameter{author}}
%  \stopnarrower
% \stopsetups

\defineuserdataalternative
   [extract]
   [renderingsetup=userdata:extract]

\defineuserdata
   [extract]
   [style=italic,
alternative=extract]

\defineframed[chapter_frame][
    width=\textwidth,
align=flushright,
offset=0pt,
rulethickness=0pt
]

\startsetups[my_chapter]
\startlocalheadsetup
\startframed[chapter_frame]
\blank[2cm]
\startfont[Serif sa 8]
\color[darkgray]{\headnumbercontent}
\stopfont
\blank[5mm]
\startfont[SerifBold sa 2]
\color[m-indigo-800]{\headtextcontent}
\stopfont
\blank[1cm]
\startfont[SerifBold sa 1.5]

\color[m-indigo-800]{\structureuservariable{subtitle}}
\stopfont
\blank[3cm]

\startextract[author={\structureuservariable{quoteauthor}}]
\structureuservariable{quote}
\stopextract
\stopframed
\stoplocalheadsetup
\stopsetups

\defineheadalternative[chap][renderingsetup=my_chapter]

\setuphead[title, chapter][
alternative=chap,
after={\page[yes]},
sectionsegments=2:2,
header=high,
footer=high,
style=
]

\starttext

% embedded startextract into startchapter does not work
\startchapter[title=Foo][subtitle=bla, quoteauthor={René Descartes}, quote={%
Cogito ergo sum.
}]
\stopchapter

\startextract[author=René Descartes]
Cogito ergo sum.
\stopextract

\stoptext
```



I also tried to combine it less interleaved, but it fails with the same error:
```
\startsetups [userdata:extract]
\getuserdata
\hairline
\itx\userdataparameter{author}
\stopsetups

% original definition (also does not work)
% \startsetups [userdata:extract]
%  \startnarrower
%  \setupindenting[next]
%  \getuserdata
%  \hairline
%  \dontleavehmode\wordright{\itx\userdataparameter{author}}
%  \stopnarrower
% \stopsetups

\defineuserdataalternative
   [extract]
   [renderingsetup=userdata:extract]

\defineuserdata
   [extract]
   [style=italic,
alternative=extract]

\defineframed[chapter_frame][
width=\textwidth,
align=flushright,
offset=0pt,
rulethickness=0pt
]
\defineframed[chapter_quote][
    width=\textwidth,
align=flushright,
offset=0pt,
rulethickness=0pt
]

\startsetups[my_chapter]
\startlocalheadsetup
\startframed[chapter_frame]
\blank[2cm]
\startfont[Serif sa 8]
\color[darkgray]{\headnumbercontent}
\stopfont
\blank[5mm]
\startfont[SerifBold sa 2]
\color[m-indigo-800]{\headtextcontent}
\stopfont
\blank[1cm]
\startfont[SerifBold sa 1.5]

\color[m-indigo-800]{\structureuservariable{subtitle}}
\stopfont
\blank[3cm]
\startframed[chapter_quote]
\structureuservariable{quote}
\stopfra

[NTG-context] Pocket Diary Photo Calendar: how to specify on which day the week begins?

2024-06-15 Thread Michael Guravage
Hi,

I am trying to use the Pocket Diary
<https://ctan.org/pkg/context-pocketdiary> module to create a photo
calendar as described in the Calendar Examples
<https://ctan.org/pkg/context-calendar-examples>. The examples work fine.
By default weeks begin on Monday. Does anyone know how to specify that
weeks begin on Sunday? I have searched through all the setvariable
assignments, but nothing seems applicable.

I have attached an example file so you needn't retrieve all the examples.
Any help would be appreciated.

-- 
With kind regards,

Michael


<http://literatesolutions.com>
\usemodule[pocketdiary]

%D Choose and setup the font to be used
\setupbodyfont[ibmplex,ss,12pt]

% Supported languages: EN,DE,NL,FR,IT,ES
\mainlanguage[nl]

% Switch off the page numbering
\setuppagenumbering[location=]

% Setup the paper size
\setuppapersize[A4,portrait][A4,portrait]

% Adjust the layout of the page
\setuplayout
  [topspace=20mm,
  backspace=8.6mm,
  header=0pt,
  footer=0pt,
  height=middle,
  width=middle]

% Setup the path where to find the calendar pictures
\setupexternalfigures [directory={., ./graphics, ../graphics, ./MyPhotoDirectory}]
\setupexternalfigures [location={local,global,default}]

\def\testimage {cow} % dolly.png
% Give pictures symbolic names for using in a loop
\useexternalfigure [1] [\testimage]
\useexternalfigure [2] [\testimage]
\useexternalfigure [3] [\testimage]
\useexternalfigure [4] [\testimage]
\useexternalfigure [5] [\testimage]
\useexternalfigure [6] [\testimage]
\useexternalfigure [7] [\testimage]
\useexternalfigure [8] [\testimage]
\useexternalfigure [9] [\testimage]
\useexternalfigure [10] [\testimage]
\useexternalfigure [11] [\testimage]
\useexternalfigure [12] [\testimage]
\useexternalfigure [13] [\testimage]

% Setup the variables for the Pocket diary, only year is used for the calculations.
\setvariables
  [PocketDiary]
  [Year=2025]

% Let the header and the footer be empty:
\setupheadertexts[][]
\setupfootertexts[][]

% Add some label texts for the international interfaces:
\setuplabeltext[en][fotocal={Photo Calendar}]
\setuplabeltext[nl][fotocal=Fotokalender]
\setuplabeltext[de][fotocal=Fotokalender]
\setuplabeltext[fr][fotocal={Calendrier photo}]
\setuplabeltext[it][fotocal={Calendario fotografico}]
\setuplabeltext[es][fotocal={Calendario fotográfico}]

%D Let lua is perform the magic:
\startluacode
  local report = logs.reporter("Photo calendar")

  function thirddata.calendar.Photo_calendar_page(y)

report("Working in function: calendar.Foto_calendar_page")

local year = y
--local path = file.dirname("./Fotokalender-fotos/")
for i = 1,12 do

  local monthname = string.lower(os.date("%B",
os.time{year=year,month=i,day=1}))

  context.startplacefigure({number="",title=""})
 context.externalfigure({i}, {width = "0.8\\textwidth"})
  context.stopplacefigure()
  context.strut()
  context("\\vfill")
  context.startalign({"middle"})
context("\\bfa")
context.labeltext(monthname)
context("~")
context(year)
  context.stopalign()
  context.blank()

  thirddata.diary.monthtableH(i,year)

  context.page()
end
  end
\stopluacode


% Setup of the month table
\startsetups table:month
   \setupTABLE[c]
  [each]
  [width=\dimexpr\textwidth/7,
   frame=on,
   style=\tfa]
   \setupTABLE[r][each][height=1.8\lineheight,align={center,lohi}]
   \setupTABLE[c][7][foregroundcolor=red]
\stopsetups

% Define the macro for calling lua
\define[1]\Photocalendarpages
  {\ctxlua{thirddata.calendar.Photo_calendar_page(#1)}}

% Setup the \TEX\ side of the document
\starttext

  % Add a title page
  \startstandardmakeup[page=yes,doublesided=yes]
\startplacefigure
  [location=middle,
   title=,
   number=]
  {\externalfigure[13][width=\paperwidth]}
\stopplacefigure
\midaligned{\bfc \labeltext{fotocal}~\getvariable{PocketDiary}{Year}}
  \stopstandardmakeup

  % Call the defined macro
  \Photocalendarpages{\getvariable{PocketDiary}{Year}}

\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: Prefix the text in an enumeration.

2024-06-14 Thread Gerion Entrup
Am Freitag, 14. Juni 2024, 11:51:28 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 14.06.2024 um 11:01:
> > Am Donnerstag, 13. Juni 2024, 16:31:58 MESZ schrieb Wolfgang Schuster:
> >> \startsetups[question:intro]
> >> \setupparagraphintro[first][\bold{Answer:} ]
> >> \blank
> >> \stopsetups
> >>
> >> \defineenumeration[question][
> >>  alternative=top,
> >>  text=Question,
> >>  title=yes,
> >>  titleleft=,
> >>  titleright=,
> >>  right={:},
> >>  headstyle=bold,
> >> inbetween=\setup{question:intro},
> >> ]
> >>
> >> \starttext
> >>
> >> Some text:
> >>
> >> \startquestion[title={How long does a loop last?}]
> >> For a while.
> >> \stopquestion
> >>
> >> \stoptext
> > 
> > Thank you. That works well for this case.
> > 
> > I have a follow up question. I tried to additionally set a titledistance 
> > and reproduce that for the "Answer:"-part.
> > ConTeXt then introduces a mysterious newline.
> > 
> > See this example:
> > 
> > \definehspace[dist][1em]
> > \startsetups[question:intro]
> > \setupparagraphintro[first][\bold{Answer:}\hspace[1em]]
> > \blank
> > \stopsetups
> 
> You need 2 changes for \setupparagraphintro:
> 
> 1. Change the argument of \hspace to "dist" because the commands accepts 
> only keywords and everything else (even a valid length) is ignored and 
> results in a horizontal skip of 0pt.

Hrmm, this was a typo.

> 
> 2. You have to add curly braces around the content when the content 
> includes square brackets because nesting of optional arguments isn't 
> supported yet.

Thanks for the help, that was the missing part.

> 
> The correct version of the one above is:
> 
> \startsetups[question:intro]
> \setupparagraphintro[first][{\bold{Answer:}\hspace[dist]}]
> \blank
> \stopsetups
> 
> Wolfgang
> 

Gerion



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: Prefix the text in an enumeration.

2024-06-14 Thread Wolfgang Schuster

Gerion Entrup schrieb am 14.06.2024 um 11:01:

Am Donnerstag, 13. Juni 2024, 16:31:58 MESZ schrieb Wolfgang Schuster:

\startsetups[question:intro]
\setupparagraphintro[first][\bold{Answer:} ]
\blank
\stopsetups

\defineenumeration[question][
 alternative=top,
 text=Question,
 title=yes,
 titleleft=,
 titleright=,
 right={:},
 headstyle=bold,
inbetween=\setup{question:intro},
]

\starttext

Some text:

\startquestion[title={How long does a loop last?}]
For a while.
\stopquestion

\stoptext


Thank you. That works well for this case.

I have a follow up question. I tried to additionally set a titledistance and reproduce 
that for the "Answer:"-part.
ConTeXt then introduces a mysterious newline.

See this example:

\definehspace[dist][1em]
\startsetups[question:intro]
\setupparagraphintro[first][\bold{Answer:}\hspace[1em]]
\blank
\stopsetups


You need 2 changes for \setupparagraphintro:

1. Change the argument of \hspace to "dist" because the commands accepts 
only keywords and everything else (even a valid length) is ignored and 
results in a horizontal skip of 0pt.


2. You have to add curly braces around the content when the content 
includes square brackets because nesting of optional arguments isn't 
supported yet.


The correct version of the one above is:

\startsetups[question:intro]
   \setupparagraphintro[first][{\bold{Answer:}\hspace[dist]}]
   \blank
\stopsetups

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: Prefix the text in an enumeration.

2024-06-14 Thread Gerion Entrup
Am Donnerstag, 13. Juni 2024, 16:31:58 MESZ schrieb Wolfgang Schuster:
> \startsetups[question:intro]
>\setupparagraphintro[first][\bold{Answer:} ]
>\blank
> \stopsetups
> 
> \defineenumeration[question][
> alternative=top,
> text=Question,
> title=yes,
> titleleft=,
> titleright=,
> right={:},
> headstyle=bold,
>inbetween=\setup{question:intro},
> ]
> 
> \starttext
> 
> Some text:
> 
> \startquestion[title={How long does a loop last?}]
> For a while.
> \stopquestion
> 
> \stoptext

Thank you. That works well for this case.

I have a follow up question. I tried to additionally set a titledistance and 
reproduce that for the "Answer:"-part.
ConTeXt then introduces a mysterious newline.

See this example:
```
\definehspace[dist][1em]
\startsetups[question:intro]
   \setupparagraphintro[first][\bold{Answer:}\hspace[1em]]
   \blank
\stopsetups

\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titledistance=1em,
titleright=,
right={:},
headstyle=bold,
   inbetween=\setup{question:intro},
]

\starttext

Some text:

\startquestion[title={How long does a loop last?}]
For a while.
\stopquestion

\stoptext
```

Gerion

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: Prefix the text in an enumeration.

2024-06-13 Thread Wolfgang Schuster

Gerion Entrup schrieb am 13.06.2024 um 13:41:

Hi,

is there a way to automatically prefix the text body in an enumeration?

Consider this example:
```
\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titleright=,
right={:},
headstyle=bold,
]

\starttext

Some text:

\startquestion[title={How long does a loop last?}]
\bold{Answer:} For a while.
\stopquestion

\stoptext
```

I'd like to have the `\bold{Answer:}` automatically. So for example something 
like this:
```
\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titleright=,
right={:},
headstyle=bold,
prefix={\bold{Answer:}},
]

\starttext

Some text:

\startquestion[title={How long does a loop last?}]
For a while.
\stopquestion

\stoptext
```

I tried to misuse `inbetween` for that but `alternative=top` seems to make a 
(not modifiable space) between the heading and the text body.


Use the \setupparagraphintro command to set the text which should appear 
at the start of the question.


 begin example
\startsetups[question:intro]
  \setupparagraphintro[first][\bold{Answer:} ]
  \blank
\stopsetups

\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titleright=,
right={:},
headstyle=bold,
  inbetween=\setup{question:intro},
]

\starttext

Some text:

\startquestion[title={How long does a loop last?}]
For a while.
\stopquestion

\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: Bibliography: separating different kinds of literature OR Sectioning bibliography by type

2024-06-09 Thread Ben Moon via ntg-context
Dear Alan,
Thank you very much for your reply. Unfortunately, I don’t get this working. 
Also, I don’t find the documentation for flushbtxrendering.
Here’s a minimal working example I’m trying:

\startbtxrenderingdefinitions[mybib]

\definebtx
  [mybib]
  [default=default,
   specification=mybib]

\definebtxrendering
  [mybib]
  [specification=mybib,
   numbering=yes]

\stopbtxrenderingdefinitions

\startsetups btx:mybib:list:link
   \btxdoifelse {title} {\btxflush{title}:\space} {No Title}
   \btxdoifelse {url}  {\btxflush{url};\space} {}
   \btxdoifelse {date}  {abgerufen \btxflush{date}.} {}
  \removeunwantedspaces
\stopsetups

\startsetups btx:mybib:list:imagelink
   \btxdoifelse {url}  {\btxflush{url};\space} {}
   \btxdoifelse {date}  {abgerufen \btxflush{date}.} {}
  \removeunwantedspaces
\stopsetups


\startbuffer[maindata]
@link{herbariumathome,
title={Herbarium At Home: A Beginner's Guide},
url={https://youtu.be/2kEbCaTe8XM},
date={04.04.2024}},

@imagelink{zooniverse_logo,
url={https://www.sciencelearn.org.nz/images/3873-zooniverse-logo},
date={04.06.2024}}
\stopbuffer
% enable tracing
\enabletrackers[publications, publications.crossref, publications.details, 
publications.cite, publications.strings]

\definebtxdataset[main]
\usebtxdataset[main][maindata.buffer]
%\definebtxdataset[bilder]
%\usebtxdataset[bilder][imagedata.buffer]
\usebtxdefinitions[mybib, aps] % aps for stuff which isn’t a link or image
\setupbtx[dataset=main]
\definebtxrendering[bibrendering][mybib, aps][dataset=main]

\starttext
\cite[herbariumathome]
\cite[zooniverse_logo]

\section{Quellen: Bilder}
%\placelistofpublications[bibrendering]
\flushbtxrendering [bibrendering]
[method=dataset,
 sorttype=index,
 filter=match(category:imagelink)]

\section{Quellen: Webseiten}
\flushbtxrendering [bibrendering]
[method=dataset,
 sorttype=index,
 filter=match(category:link)]
\stoptext

I would very much appreciate more ideas.

Thank you very much and kind regards

Ben

> On 9 Jun 2024, at 14:37, Alan Braslau via ntg-context  
> wrote:
> 
> Try something like:
> 
>  \flushbtxrendering [bibrendering]
>   [method=dataset,
>sorttype=index,
>filter=match(category:article)]
> 
> I have used the filtering mechanism to select fields, such as 
> filter=match(year:2023).
> 
> Alan
> 
> 
> 
> 
> On Tue, 4 Jun 2024 15:20:14 +0200
> Ben Moon via ntg-context  wrote:
> 
>> Hey there,
>> I would like to place a list of bibliography according to types
>> (article, book, in proceedings) in my document. Similar like here:
>> https://tex.stackexchange.com/questions/112874/sectioning-bibliography-by-type-with-multiple-types-per-section
>> Sectioning bibliography by type (with multiple types per section)
>> tex.stackexchange.com
>> 
>> and here:
>> https://www.mail-archive.com/ntg-context@ntg.nl/msg77056.html
>> The example provided by Hans doesn’t seem to properly work any more,
>> and I cannot make the suggestion work of using two different datasets
>> work as suggested in the same thread. So this is where I’m stuck:
>> 
>> \definebtxdataset[main]
>> \usebtxdataset[main][maindata.buffer]
>> \definebtxdataset[images]
>> \usebtxdataset[images][imagedata.buffer]
>> \usebtxdefinitions[mycustom, aps]
>> \setupbtx[dataset=main]
>> \definebtxrendering[bibrendering][mycustom, aps][dataset=main]
>> \definebtxrendering[bibimgrendering][mycustom, aps][dataset=images]
>> 
>> \placelistofpublications[bibrendering]
>> \placelistofpublications[bibimgrendering]
>> 
>> It would be much appreciated if someone could provide a working
>> example?
>> 
>> Thank you very much
>> 
>> 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
> ___

___
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 \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Gerion Entrup
Am Donnerstag, 6. Juni 2024, 13:51:53 MESZ schrieb Hans Hagen via ntg-context:
> On 6/6/2024 12:30 PM, Gerion Entrup wrote:
> > Hi,
> > 
> > I like to achieve something that looks like this:
> > ```
> > \definedelimitedtext[extract][blockquote]
> > \setupdelimitedtext
> >[extract]
> >[leftmargin=1.5pc,
> > style={\italic},
> > before={\setupindenting[next]},
> > after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
> > \tfx\italic{René Descartes} \stopalignment}]
> > 
> > \starttext
> > \startextract
> >  Cogito ergo sum.
> > \stopextract
> > \stoptext
> > ```
> > 
> > So it should setup a quotation and mentions the author.
> > However, here the author is hardcoded within the blockquote. I would like 
> > it to use like this:
> > ```
> > \definedelimitedtext[extract][blockquote]
> > \setupdelimitedtext
> >[extract]
> >[leftmargin=1.5pc,
> > style={\italic},
> > before={\setupindenting[next]},
> > after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
> > \tfx\italic{\getcustomvariable{author}} \stopalignment}]
> > 
> > \starttext
> > \startextract[author=René Descartes]
> >  Cogito ergo sum.
> > \stopextract
> > \stoptext
> > ```
> > 
> > Is there an easy way to achieve that?
> > I tried with \structureuservariable (like possible in \startchapter) but it 
> > does not work.
> 
> not all constructs hav ethese user variables (yet)
> 
> i'll add an option for arguments tostart/stop so that you can do
> 
> \starttext
> 
> \definedelimitedtext
>[dextract]
>[blockquote]
>[leftmargin=1.5pc,
> style=italic,
> before=\setupindenting[next],
> after=\setups{extract:whatever}]
> 
> \definestartstop
>[extract]
>[arguments=yes,
> before=\setups{extract:start},
> after=\setups{extract:stop}]
> 
> \startsetups extract:start
>  \startdextract
> \stopsetups
> 
> \startsetups extract:stop
>  \startstopparameter{author}
>  \stopdextract
>  \blank[1ex,samepage]
>  \hrule
>  \blank[1ex,samepage]
>  \dontleavehmode
>  \wordright{\itx\startstopparameter{author}}
> \stopsetups
> 
> \starttext
> 
> \startextract[author=René Descartes]
>  Cogito ergo sum.
> \stopextract
> 
> \stoptext
> 
> but first i want Wolfgang to check the patch,

For me, Wolfgang's answer fulfills all my needs.
So, from my point of view, this is not needed anymore.
Thank you for your effort anyway!

Gerion


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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Gerion Entrup
Am Donnerstag, 6. Juni 2024, 16:34:03 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 06.06.2024 um 12:30:
> > Hi,
> > 
> > I like to achieve something that looks like this:
> > ```
> > \definedelimitedtext[extract][blockquote]
> > \setupdelimitedtext
> >[extract]
> >[leftmargin=1.5pc,
> > style={\italic},
> > before={\setupindenting[next]},
> > after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
> > \tfx\italic{René Descartes} \stopalignment}]
> > 
> > \starttext
> > \startextract
> >  Cogito ergo sum.
> > \stopextract
> > \stoptext
> > ```
> > 
> > So it should setup a quotation and mentions the author.
> > However, here the author is hardcoded within the blockquote. I would like 
> > it to use like this:
> > ```
> > \definedelimitedtext[extract][blockquote]
> > \setupdelimitedtext
> >[extract]
> >[leftmargin=1.5pc,
> > style={\italic},
> > before={\setupindenting[next]},
> > after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
> > \tfx\italic{\getcustomvariable{author}} \stopalignment}]
> > 
> > \starttext
> > \startextract[author=René Descartes]
> >  Cogito ergo sum.
> > \stopextract
> > \stoptext
> > ```
> > 
> > Is there an easy way to achieve that?
> > I tried with \structureuservariable (like possible in \startchapter) but it 
> > does not work.
> 
> \startsetups [userdata:extract]
>  \startnarrower
>  \setupindenting[next]
>  \getuserdata
>  \hairline
>  \dontleavehmode\wordright{\itx\userdataparameter{author}}
>  \stopnarrower
> \stopsetups
> 
> \defineuserdataalternative
>[extract]
>[renderingsetup=userdata:extract]
> 
> \defineuserdata
>[extract]
>[style=italic,
> alternative=extract]
> 
> \starttext
> 
> \startextract[author=René Descartes]
>  Cogito ergo sum.
> \stopextract
> 
> \stoptext

Really cool! Thank you. If I see it right, this is completely generic,
so with this it is possible to define any start stop
with completely variable arguments.

Gerion

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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Hans Hagen via ntg-context

On 6/6/2024 4:34 PM, Wolfgang Schuster wrote:

Gerion Entrup schrieb am 06.06.2024 um 12:30:

Hi,

I like to achieve something that looks like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
    style={\italic},
    before={\setupindenting[next]},
    after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{René Descartes} \stopalignment}]


\starttext
\startextract
 Cogito ergo sum.
\stopextract
\stoptext
```

So it should setup a quotation and mentions the author.
However, here the author is hardcoded within the blockquote. I would 
like it to use like this:

```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
    style={\italic},
    before={\setupindenting[next]},
    after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{\getcustomvariable{author}} \stopalignment}]


\starttext
\startextract[author=René Descartes]
 Cogito ergo sum.
\stopextract
\stoptext
```

Is there an easy way to achieve that?
I tried with \structureuservariable (like possible in \startchapter) 
but it does not work.


\startsetups [userdata:extract]
     \startnarrower
     \setupindenting[next]
     \getuserdata
     \hairline
     \dontleavehmode\wordright{\itx\userdataparameter{author}}
     \stopnarrower
\stopsetups

\defineuserdataalternative
   [extract]
   [renderingsetup=userdata:extract]

\defineuserdata
   [extract]
   [style=italic,
    alternative=extract]

\starttext

\startextract[author=René Descartes]
     Cogito ergo sum.
\stopextract

\stoptext
ah, i start forgetting about these mechanisms ... i added this example 
to th etest suite


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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Wolfgang Schuster

Gerion Entrup schrieb am 06.06.2024 um 12:30:

Hi,

I like to achieve something that looks like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{René Descartes} \stopalignment}]

\starttext
\startextract
 Cogito ergo sum.
\stopextract
\stoptext
```

So it should setup a quotation and mentions the author.
However, here the author is hardcoded within the blockquote. I would like it to 
use like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{\getcustomvariable{author}} \stopalignment}]

\starttext
\startextract[author=René Descartes]
 Cogito ergo sum.
\stopextract
\stoptext
```

Is there an easy way to achieve that?
I tried with \structureuservariable (like possible in \startchapter) but it 
does not work.


\startsetups [userdata:extract]
\startnarrower
\setupindenting[next]
\getuserdata
\hairline
\dontleavehmode\wordright{\itx\userdataparameter{author}}
\stopnarrower
\stopsetups

\defineuserdataalternative
  [extract]
  [renderingsetup=userdata:extract]

\defineuserdata
  [extract]
  [style=italic,
   alternative=extract]

\starttext

\startextract[author=René Descartes]
Cogito ergo sum.
\stopextract

\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: Combine \setupdelimitedtext with an author (define custom variable?)

2024-06-06 Thread Hans Hagen via ntg-context

On 6/6/2024 12:30 PM, Gerion Entrup wrote:

Hi,

I like to achieve something that looks like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{René Descartes} \stopalignment}]

\starttext
\startextract
 Cogito ergo sum.
\stopextract
\stoptext
```

So it should setup a quotation and mentions the author.
However, here the author is hardcoded within the blockquote. I would like it to 
use like this:
```
\definedelimitedtext[extract][blockquote]
\setupdelimitedtext
   [extract]
   [leftmargin=1.5pc,
style={\italic},
before={\setupindenting[next]},
after={\blank[1ex] \hrule \blank[1ex] \startalignment[flushright] 
\tfx\italic{\getcustomvariable{author}} \stopalignment}]

\starttext
\startextract[author=René Descartes]
 Cogito ergo sum.
\stopextract
\stoptext
```

Is there an easy way to achieve that?
I tried with \structureuservariable (like possible in \startchapter) but it 
does not work.


not all constructs hav ethese user variables (yet)

i'll add an option for arguments tostart/stop so that you can do

\starttext

\definedelimitedtext
  [dextract]
  [blockquote]
  [leftmargin=1.5pc,
   style=italic,
   before=\setupindenting[next],
   after=\setups{extract:whatever}]

\definestartstop
  [extract]
  [arguments=yes,
   before=\setups{extract:start},
   after=\setups{extract:stop}]

\startsetups extract:start
\startdextract
\stopsetups

\startsetups extract:stop
\startstopparameter{author}
\stopdextract
\blank[1ex,samepage]
\hrule
\blank[1ex,samepage]
\dontleavehmode
\wordright{\itx\startstopparameter{author}}
\stopsetups

\starttext

\startextract[author=René Descartes]
Cogito ergo sum.
\stopextract

\stoptext

but first i want Wolfgang to check the patch,

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] Specify separator within setupbtx for custom bibliography rendering

2024-06-01 Thread Gerion Entrup
Hi,

according to the section "Custom citation renderings" in the bibliography 
manual, I have specified an own setup for citation rendering.
However, this seems only to work for single citations (of one source). I want 
to also specify the separator but did not get it to run.

Here is a minimal example:
```
\setupinteraction[state=start]

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

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

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

\definebtx[aps:cite:special][aps:cite][
left={((},
right={))},
separator:2={sfd},
separator:3={sfd},
separator:4={sfd},
]

\startsetups btx:aps:cite:special
% just a dummy
\btxcitereference
\currentbtxtag
\stopsetups

\setupbtx[aps:cite][
alternative=special,
]

\starttext

Both said something~\cite[knuth1, someother].

\placelistofpublications[bibrendering]

\stoptext
```

The output of this is:

> Both said something ((knuth1someother)).

How can I get the separator to work? My expectation would be:

> Both said something ((knuth1sfdsomeother)).

or

> Both said something ((knuth1sfd someother)).

Best,
Gerion

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: setuphead in connection with the command argument

2024-05-30 Thread Bruce Horrocks


> On 30 May 2024, at 23:25, Gerion Entrup  wrote:
> 
> Am Donnerstag, 30. Mai 2024, 18:49:08 MESZ schrieb Bruce Horrocks:
>> 
>>> On 30 May 2024, at 15:15, Gerion Entrup  wrote:
>>> 
>>> Let's begin with a minimal example:
>>> ```
>>> \define[2]\MyChapter{%
>>> #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
>>> }
>> 
>> Stop there!
>> 
>> Use \definehead to create your own variation of a heading - much more 
>> robust. Something like the following (untested):
>> 
>>  \startsetups PlaceSubTitleAndIntro
>>% Set font and and style etc for the subtitle here
>>\structureuservariable(subtitle)
>> 
>>% Set font and style etc for the intro text here
>>\structureuservariable(intro)
>>  \stopsetups
>> 
>>  \definehead [MyChapter] [chapter]
>>  \setuphead [MyChapter]
>>[ style={...}, % heading style
>>  after={\setup{PlaceSubTitleAndIntro}},
>>]
>> 
>>  \starttext
>>  \startMyChapter[title={Foo}]
>>[ subtitle={Bar},
>>  intro={Some explanation},
>>]
>>  The text of the chapter
>>  \stopMyChapter
>>  \stoptext
> 
> Thanks for the input. A comparable example is also listed in the wiki.
> I like the approach for placing subtitle and intro alone. However, I also 
> want to style chapter number and chapter title separately.

Any setuphead commands that apply to MyChapter also apply to chapter so you 
should be able to use exactly the same styling commands.

> I'm also not sure, if an extra heading (MyChapter) is needed, since all my 
> chapters are styled in this way.
> Isn't it possible to define "after" of chapter directly?

Yes, I think it is possible to just use \setuphead [chapter] instead of 
\setuphead [MyChapter] with the rest remaining the same.

The only reason I don't do it is that if something goes wrong, I know I have an 
original version of \chapter readily to hand to compare against for debugging.

Regards,
—
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: setuphead in connection with the command argument

2024-05-30 Thread Gerion Entrup
Am Donnerstag, 30. Mai 2024, 22:54:47 MESZ schrieb Wolfgang Schuster:
> Gerion Entrup schrieb am 30.05.2024 um 16:25:
> > The chapter format that I want to achieve in the end is nearly the one in 
> > the attachment (excerpt of Christian Dietrich's PhD thesis).
> 
> When you have a complex layout it is easier to use the 
> \defineheadalternative command to create it.
> 
> To change the font for each element disable the default settings with 
> \setuphead[style=] and use \startfont (or \definedfont) to apply a 
> different style for the number, title etc.
> 
>  begin example
> \defineframed
>[ChapterFrame]
>[width=\textwidth,
> align=flushright,
>     offset=0pt,
> rulethickness=0pt]
> 
> \startsetups [christian_dietrich]
>\startlocalheadsetup
>  \startframed[ChapterFrame]
>\blank[2cm]
>\startfont[Serif sa 8]
>  \color[darkgray]{\headnumbercontent}
>\stopfont
>\blank[5mm]
>\startfont[SerifBold sa 2]
>  \color[darkred]{\headtextcontent}
>\stopfont
>\blank[1cm]
>\startfont[SerifBold sa 1.5]
>  \color[darkred]{\structureuservariable{subtitle}}
>\stopfont
>  \stopframed
>\stoplocalheadsetup
> \stopsetups
> 
> \defineheadalternative
>[christian_dietrich]
>[renderingsetup=christian_dietrich]
> 
> \setuphead
>[chapter]
>[alternative=christian_dietrich,
> header=empty,
> style=]
> 
> \starttext
> 
> \startchapter[title=Chapter title][subtitle=Chapter subtitle]
> \samplefile{lorem}
> \stopchapter
> 
> \stoptext
>  end example

Thank you very much! That looks really clean. I will add it to the wiki.

Can you bring some clarification regarding "style=", "command=" and 
"alternative="?
What, if I define multiple of them? Is the system not made for this?

I just tested my initial example regarding font size with `command=\MyChapter, 
style=` and the font size was only affected by the code of \MyChapter.
What is the default style?

Best
Gerion



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: setuphead in connection with the command argument

2024-05-30 Thread Gerion Entrup
Am Donnerstag, 30. Mai 2024, 18:49:08 MESZ schrieb Bruce Horrocks:
> 
> > On 30 May 2024, at 15:15, Gerion Entrup  wrote:
> > 
> > Let's begin with a minimal example:
> > ```
> > \define[2]\MyChapter{%
> > #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> > }
> 
> Stop there!
> 
> Use \definehead to create your own variation of a heading - much more robust. 
> Something like the following (untested):
> 
>   \startsetups PlaceSubTitleAndIntro
> % Set font and and style etc for the subtitle here
> \structureuservariable(subtitle)
> 
> % Set font and style etc for the intro text here
> \structureuservariable(intro)
>   \stopsetups
> 
>   \definehead [MyChapter] [chapter]
>   \setuphead [MyChapter]
> [ style={...}, % heading style
>   after={\setup{PlaceSubTitleAndIntro}},
> ]
> 
>   \starttext
>   \startMyChapter[title={Foo}]
> [ subtitle={Bar},
>   intro={Some explanation},
> ]
>   The text of the chapter
>   \stopMyChapter
>   \stoptext

Thanks for the input. A comparable example is also listed in the wiki.
I like the approach for placing subtitle and intro alone. However, I also want 
to style chapter number and chapter title separately.
I'm also not sure, if an extra heading (MyChapter) is needed, since all my 
chapters are styled in this way.
Isn't it possible to define "after" of chapter directly?

Best
Gerion


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: setuphead in connection with the command argument

2024-05-30 Thread Wolfgang Schuster

Gerion Entrup schrieb am 30.05.2024 um 16:25:

The chapter format that I want to achieve in the end is nearly the one in the 
attachment (excerpt of Christian Dietrich's PhD thesis).


When you have a complex layout it is easier to use the 
\defineheadalternative command to create it.


To change the font for each element disable the default settings with 
\setuphead[style=] and use \startfont (or \definedfont) to apply a 
different style for the number, title etc.


 begin example
\defineframed
  [ChapterFrame]
  [width=\textwidth,
   align=flushright,
   offset=0pt,
   rulethickness=0pt]

\startsetups [christian_dietrich]
  \startlocalheadsetup
\startframed[ChapterFrame]
  \blank[2cm]
  \startfont[Serif sa 8]
\color[darkgray]{\headnumbercontent}
  \stopfont
  \blank[5mm]
  \startfont[SerifBold sa 2]
\color[darkred]{\headtextcontent}
  \stopfont
  \blank[1cm]
  \startfont[SerifBold sa 1.5]
\color[darkred]{\structureuservariable{subtitle}}
  \stopfont
\stopframed
  \stoplocalheadsetup
\stopsetups

\defineheadalternative
  [christian_dietrich]
  [renderingsetup=christian_dietrich]

\setuphead
  [chapter]
  [alternative=christian_dietrich,
   header=empty,
   style=]

\starttext

\startchapter[title=Chapter title][subtitle=Chapter subtitle]
\samplefile{lorem}
\stopchapter

\stoptext
 end example

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

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


[NTG-context] Re: setuphead in connection with the command argument

2024-05-30 Thread Bruce Horrocks


> On 30 May 2024, at 15:15, Gerion Entrup  wrote:
> 
> Let's begin with a minimal example:
> ```
> \define[2]\MyChapter{%
> #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> }

Stop there!

Use \definehead to create your own variation of a heading - much more robust. 
Something like the following (untested):

  \startsetups PlaceSubTitleAndIntro
% Set font and and style etc for the subtitle here
\structureuservariable(subtitle)

% Set font and style etc for the intro text here
\structureuservariable(intro)
  \stopsetups

  \definehead [MyChapter] [chapter]
  \setuphead [MyChapter]
[ style={...}, % heading style
  after={\setup{PlaceSubTitleAndIntro}},
]

  \starttext
  \startMyChapter[title={Foo}]
[ subtitle={Bar},
  intro={Some explanation},
]
  The text of the chapter
  \stopMyChapter
  \stoptext

—
Bruce Horrocks
Hampshire, UK

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

maillist : ntg-context@ntg.nl / 
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: simplify side by side Poems

2024-05-23 Thread Wolfgang Schuster

seyal.zav...@gmail.com schrieb am 23.05.2024 um 14:13:

Hi all,

i want to use tables for constructing poems structure
this snippet of code works well:

\startsetups tablepoem
\setupTABLE[column][each][width=5cm]
\stopsetups
\starttext
\bTABLE[setups=tablepoem]
\bTR \bTD One one ons ksl   \eTD \bTD  two gfjgfd oski kwo \eTD \eTR
\bTR \bTD One wer s dft tgf \eTD \bTD  two gfkdsjg dfs we  \eTD \eTR
\eTABLE
\stoptext

but when i use this code for simplifying of changing cells I get an error:

\startsetups tablepoem
\setupTABLE[column][each][width=5cm]
\stopsetups

\def\Poemstart{\bTABLE[setups=tablepoem] \bTR \bTD}
\def\Mesra{\eTD \bTD}
\def\nextBeyt{\eTD\eTR\bTR\bTD}
\def\Poemstop{\eTD\eTR\eTABLE}

\starttext
\Poemstart
One one ons ksl\Mesratwo gfjgfd oski kwo  \nextBeyt
One wer s dft tgf   \Mesratwo gfkdsjg dfs we
\Poemstop
\stoptext

what is the problem?


The table environment collects the content of the table cell-wise which 
means when TeX sees a \bTD in the input it reads the following text 
until it finds the corresponding \eTD. When you put the \eTD in the 
definition of another command the scanner will never find the end of a 
cell and you either run out of memory or reach the end of the file etc.


Below are a few alternative solutions to simplify the input, one of them 
is an alternative version of input (\startTABLE) for natural tables 
which uses the same commands to separate columns as tabulate does.


 begin example
\starttext

\startTABLE[width=5cm]
\NC One one ons ksl   \NC two gfjgfd oski kwo \NC\NR
\NC One wer s dft tgf \NC two gfkdsjg dfs we  \NC\NR
\stopTABLE

\starttabulate[|*{2}{k{0}lw(5cm)|}]
\NC One one ons ksl   \NC two gfjgfd oski kwo \NC\NR
\NC One wer s dft tgf \NC two gfkdsjg dfs we  \NC\NR
\stoptabulate

\defineparagraphs[poem][n=2,width=5cm]
\setupparagraphs[poem][each][width=5cm,distance=0pt]

\startpoem
  \startlines
  One one ons ksl
  One wer s dft tgf
  \stoplines
\nextpoem
  \startlines
  two gfjgfd oski kwo
  two gfkdsjg dfs we
  \stoplines
\stoppoem

\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] simplify side by side Poems

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

i want to use tables for constructing poems structure
this snippet of code works well:

\startsetups tablepoem
\setupTABLE[column][each][width=5cm]
\stopsetups
\starttext
\bTABLE[setups=tablepoem]
\bTR \bTD One one ons ksl   \eTD \bTD  two gfjgfd oski kwo \eTD \eTR
\bTR \bTD One wer s dft tgf \eTD \bTD  two gfkdsjg dfs we  \eTD \eTR
\eTABLE
\stoptext

but when i use this code for simplifying of changing cells I get an error:

\startsetups tablepoem
\setupTABLE[column][each][width=5cm]
\stopsetups

\def\Poemstart{\bTABLE[setups=tablepoem] \bTR \bTD}
\def\Mesra{\eTD \bTD}
\def\nextBeyt{\eTD\eTR\bTR\bTD}
\def\Poemstop{\eTD\eTR\eTABLE}

\starttext
\Poemstart
One one ons ksl\Mesratwo gfjgfd oski kwo  \nextBeyt
One wer s dft tgf   \Mesratwo gfkdsjg dfs we  
\Poemstop
\stoptext

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

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


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

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

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


```
\setupinteraction[state=start]

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

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

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

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

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

\starttext

\def\comma{,}

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

\placelistofpublications[bibrendering]

\stoptext
```

Gerion

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

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

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

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

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

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

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

\starttext

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

\placelistofpublications[bibrendering]

\stoptext
```

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

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


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

Gerion


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

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

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

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

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

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

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

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

\setuppagenumbering[location=footer]

\starttext

\startDatum[title={secA}]%

  \dorecurse{50}{aaa }

  \pagebreak
 
  \dorecurse{50}{aaa }

\stopDatum

\startDatum[title={secB}]%

  \dorecurse{630}{bbb }

\stopDatum

\startDatum[title={secC}]%

  \dorecurse{50}{ccc }

\stopDatum

\startDatum[title={secD}]%

  \dorecurse{50}{ddd }

\stopDatum

\startDatum[title={secE}]%

  \dorecurse{50}{eee }

\stopDatum


\stoptext
%==
%==


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

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

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

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

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

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

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

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

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

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

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


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


Thank you in advance, Matthias

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

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


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

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

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

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

If it helps: I currently have

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

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

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

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

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

All best,
Alan

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

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

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


[NTG-context] start/end pages in ToC

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

Many thanks in advance.

My minimalish working example:

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

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

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

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

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

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

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

\starttext

{\tfa\bf Contents}

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

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

\page[makeup]

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

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

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

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

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

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


[NTG-context] Re: Use of marking

2024-03-21 Thread Thomas Meyer

Hi Pablo and Bruce,

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

Greetings
Thomas

Am 21.03.24 um 16:34 schrieb Bruce Horrocks:

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

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

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

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


[NTG-context] Re: Use of marking

2024-03-21 Thread Bruce Horrocks


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

You can do the following:

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

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

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

Caveat: it needs an if...then test around the section number for when a section 
hasn't started.
—
Bruce Horrocks
Hampshire, UK

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

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


[NTG-context] multicolumn title and abstact (bachotex) using tugboat.mkxl

2024-03-07 Thread Damien Thiriet via ntg-context

Hello,


I am currently writing my paper for last year's BachoTeX proceedings.
I am using tugboat.mkxl module to design the layout.

In bachotex proceedings, the author's data and abstract are on a single 
column and the article is usually typeset on two columns.

Comments in tugboat.mkxl states:

%D We have several column mechanisms and they all serve a different 
purpose. Here we
%D use pagecolumns. They support much of what we can do in single 
columns, but of
%D course there are exceptions. Floats can go into columns of aremoved 
to the top or
%D bottom when there is no room. We don't span mid column. Notes can go 
in columns
%D or at the end. We can start with a single column (for titles and 
such).


I can't figure out which part of the file should be used/adapted to 
start with a single column.
What I did is to put datas and abstract in a frame and use \placefigure. 
As stated in pagecolumns
manual, everything is put on the top of next page. (BTW, there is a 
typo: «of aremoved»)


I don't know, whether this MWE helps is relevant, but just in case, here 
is what I did:


* copy tugboat.mkxl to a new file p-bachotex.mkxl
* changed p-bachotex.mkxl like this:

\startsetups bachotex:naglowek:columns
\defineframedtext [Dane]
\setupframedtext
[Dane]
[width=18cm ,
 align=normal,
 frame=no]
\definenarrower
[Streszczenia]
[2*middle]

\startplacefigure [location={here,none}]
{\startDane
{\tfa\getvariable{tugboat}{author}}\par
\getvariable{tugboat}{address}\par
{\tt\getvariable{tugboat}{email}}\par

\startStreszczenia
\doifelsebufferempty {abstract} {
% no abstract
} {
\blank[line]

\enforced\let\\\endgraf
\setups[tugboat:abstract:setup]
\startAbstracts[title={Abstract}]
\stopAbstracts
}
\stopStreszczenia
\stopDane}
\stopplacefigure
\stopsetups

\startsetups tugboat:article:start

  \starttext

\setups{tugboat:columns:presets}

\setups{tugboat:banner:setup:\getvariable{tugboat}{type}}

\setupheadertexts
[\setups{tugboat:banner:text:article}]
[pagenumber]

\setuppagenumber
[number=\getvariable{tugboat}{page}]

\startmode[columns]
\startpagecolumns
\stopmode

\setups[tugboat:introduction:article]
\doifmodeelse{columns}{
\setups{bachotex:naglowek:columns}
} {
\setups{bachotex:naglowek:nocolumns}
}

\stopsetups

My article begins so:

\enablemode [columns]
\usemodule [bachotex]

% skipped tugboat variables for this MWE

\StartAbstract
  \input tufte
\StopAbstract
\StartArticle
   \input knuth
\StopArticle

Thank you for your help

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

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


[NTG-context] Re: Japanese

2024-03-02 Thread Wolfgang Schuster

Emanuel Han schrieb am 01.03.2024 um 16:23:

Dear Wolfgang,

thank you for your valuable remarks. I integrated them, see corrected 
attached example.


Yes, correct layout examples exist. They're all showing vertical 
writing, but the rules and principles are exactly the same for 
horizontal writing.


 *
position of the headers and footers:
https://www.w3.org/TR/jlreq/#fig1_30


See my attached gongitsune.tex example how you can squeeze text in a 
very narrow header/footer.



 *
aligning lines to the text box: https://www.w3.org/TR/jlreq/#fig1_3


You can use the lines key for \setuplayout to let ConTeXt calculate the 
necessary value for the text height.



 *
protrusion of ruby: https://www.w3.org/TR/jlreq/#fig_ad1_6


You're getting this for free because ruby text doesn't take up vertical 
space, in case vertical text is working it would now stick into the 
margins as expected.


\starttext
\ruledhbox{a \ruby{x}{y} b}
\stoptext


In my previous mail, I wrote wrong amounts of lines. They should be 46 
lines on one page, while the actual example doesn't show the 46th line.


It would be important to identify the reason why only 24 characters 
are used to create a line when 25 could be used. Then we can develop a 
method to turn that mechanism off or circumvent it.

Quotation from https://www.w3.org/TR/jlreq:
/In principle, when composing a line with //ideographic (cl-19) 
<https://www.w3.org/TR/jlreq/#cl-19>//, //hiragana (cl-15) 
<https://www.w3.org/TR/jlreq/#cl-15>// and //katakana (cl-16) 
<https://www.w3.org/TR/jlreq/#cl-16>// characters, no extra spacing 
appears between their //character frame 
<https://www.w3.org/TR/jlreq/#term.character-frame>//. This is called 
solid setting (see //Figure 5 <https://www.w3.org/TR/jlreq/#fig1_8>//)./


1. ConTeXt has a mechanism to typeset Japanese texts.

2. There are flaws in the output it produces but this nothing which 
can't be fixed.


3. To fix the problems someone has to be passionate to fix them and 
we're willing to help here.


As you can see in my second example file japanese.tex there is a font 
feature to create half sized parentheses etc. which isn't supported yet 
by ConTeXt's mechanism for japanese and in case your willing to improve 
it this should be taken care of as well.


Wolfgang

\definefontfeature [halt] [halt=yes]

\starttext

\setscript[nihongo]

\begingroup \showmakeup[glyph,fontkern]

% \startfont[file:notosanscjkjpregular*default]「うわアぬすと狐め」と、どなりたてました。\stopfont
% 
% \startfont[file:notosanscjkjpregular*default]「「うわアぬすと狐め」と、「どなりたてました」。\stopfont
% 
% 
\startfont[file:notosanscjkjpregular*default,halt]「うわアぬすと狐め」と、どなりたてました。\stopfont
% 
% 
\startfont[file:notosanscjkjpregular*default,halt]「「うわアぬすと狐め」と、「どなりたてました」。\stopfont

\startfont[name:notosansjpregular*default]「うわアぬすと狐め」と、どなりたてました。\stopfont

\startfont[name:notosansjpregular*default]「「うわアぬすと狐め」と、「どなりたてました」。\stopfont

\startfont[name:notosansjpregular*default,halt]「うわアぬすと狐め」と、どなりたてました。\stopfont

\startfont[name:notosansjpregular*default,halt]「「うわアぬすと狐め」と、「どなりたてました」。\stopfont

\endgroup

\stoptext
% \definefontfeature [fixeddimensions] [dimensions={1,1.8,0}]
% 
% \definefontfamily [noto_japanese] [rm] [Noto Serif CJK JP] 
[features={default,fullprotrusion,fixeddimensions}]
% \definefontfamily [noto_japanese] [ss] [Noto Sans CJK JP]  
[features={default,fullprotrusion,fixeddimensions}]

% \definefontfamily [noto_japanese] [rm] [Noto Serif CJK JP] 
[features={default,fullprotrusion}]
% \definefontfamily [noto_japanese] [ss] [Noto Sans CJK JP]  
[features={default,fullprotrusion}]

\definefontfamily [noto_japanese] [rm] [Noto Serif JP] 
[features={default,fullprotrusion}]
\definefontfamily [noto_japanese] [ss] [Noto Sans JP]  
[features={default,fullprotrusion}]

\setupbodyfont
  [noto_japanese]

\setscript
  [nihongo]

\setupalign
  [hanging]

\setupindenting
  [yes,1em]

\setupinterlinespace
  [line=2\bodyfontsize,
   height=0.9,
   depth=0.1]

\setupruby
  [style={\switchtobodyfont[6pt]}]

\setuppagenumbering
  [alternative=doublesided,
   location=none]

\setuphead
  [title,subject]
  [align=middle]

\startsetups [header:rightpage]

  \startframed [
  frame=off,
  strut=no,
  height=\headerheight,
  offset=none,
  align=low,
  roffset=1em,
  ]

\getmarking[subject]

  \stopframed

\stopsetups

\startsetups [header:leftpage]

  \startframed [
  frame=off,
  strut=no,
  height=\headerheight,
  offset=none,
  align=low,
  loffset=1em,
  ]

\getmarking[title]

  \stopframed

\stopsetups

\startsetups [footer:rightpage]

  \startframed [
  frame=off,
  strut=no,
  height=\headerheight,
  offset=none,
  align=low,
  roffset=1em,
  ]

\prefixedpagenumber

  \stopframed

\stopsetups

\startsetups [footer:leftpage]

  \startframed [
  frame=off,
  strut=no,
  height=\headerheight,
  offset=none,
  align=low,
  loffset=1em,
  ]

\pre

[NTG-context] Re: \starttable questions

2024-01-25 Thread Jim
On Thu, Jan 25, 2024 at 22:22 (+0100), Wolfgang Schuster wrote:

> Jim schrieb am 25.01.2024 um 22:01:
>> Hi Henning,

>> On Thu, Jan 25, 2024 at 17:16 (+0100), Henning Hraban Ramm wrote:

>>> Am 25.01.24 um 16:12 schrieb Jim:
>>> > Hi, I was wondering if anyone here could help me with these three things:
>>> > For a long time I have been using Wichura's TaBle macros (i.e., what one
>>> > gets with
>>> >   \input table
>>> > in plain TeX) and would like to use what appears to be ConTeXt's version 
>>> > of
>>> > those (i.e., what one gets with \starttable ... \stoptable).

>>> > However, https://wiki.contextgarden.net/Command/starttable says
>>> > The environment \starttable ... \stoptable is and (sic) old and
>>> > nearly obsolete way to handle tabular material
>>> > Q1: are there plans to remove \starttable ... \endtable from ConTeXt any
>>> > time "soon", or is that wiki comment gratuitously pessimistic?

>>> Hans suggests to use tabulate as long as it fits.
>> I just gave that a try, using the same syntax as \starttable:

>> \starttable[|c|c|]
>> \HL
>> \VL \bf Year \VL \bf Citizens \VL\SR
>> \HL
>> \VL 1675 \VL ˜428 \VL\FR
>> \VL 1795 \VL 1124 \VL\MR
>> \VL 1880 \VL 2405 \VL\MR
>> \VL 1995 \VL 7408 \VL\LR
>> \HL
>> \stoptable

>> \starttabulate[|c|c|]
>> \HL
>> \VL \bf Year \VL \bf Citizens \VL\SR
>> \HL
>> \VL 1675 \VL ˜428 \VL\FR
>> \VL 1795 \VL 1124 \VL\MR
>> \VL 1880 \VL 2405 \VL\MR
>> \VL 1995 \VL 7408 \VL\LR
>> \HL
>> \stoptabulate

>> While tabulate produced a table with the above input, it needs some work to
>> make the table look good.  (The columns are too narrow, the vrules don't
>> meet the hrules, ...).

>> Perhaps these can be fixed with some tweaking, but I notice that in all of
>> https://wiki.contextgarden.net/Command/starttabulate
>> and
>> https://wiki.contextgarden.net/Tabulate
>> and
>> http://www.ntg.nl/maps/22/28.pdf
>> there is a conspicuous lack of examples with vrules.  And the tables in the
>> (at least) the starttabulate wiki page which use vrules don't use tabulate
>> to create the tables.

>> Coincidence?  I think not.  :-)

> Table which rely on rules to make the content readable have a serious
> problem
> (read Edward Tufte books how you can improve the visual style) but the
> better
> alternative in this case are either natural tables or extreme tables.

> Below is a example which uses the table like wrapper for natural tables
> which makes adding rules and changing the padding around text very
> simple because each table cell is a \framed block with all its options.

> \starttext

> \startsetups[ruledtable]
>   \setupTABLE [frame=off,align=middle,loffset=.5em,roffset=.5em]
>   \setupTABLE [column] [each]  [leftframe=on,rightframe=on]
>   \setupTABLE [row]    [first]
> [topframe=on,bottomframe=on,foregroundstyle=bold]
>   \setupTABLE [row]    [last]  [bottomframe=on]
> \stopsetups

> \startTABLE[setups=ruledtable]
> \NC Year \NC Citizens \NC\NR
> \NC 1675 \NC ˜428 \NC\NR
> \NC 1795 \NC 1124 \NC\NR
> \NC 1880 \NC 2405 \NC\NR
> \NC 1995 \NC 7408 \NC\NR
> \stopTABLE

> \stoptext

Wolfgang,

thanks for the response and the sample code.

[ Note to anyone else trying out this example: there are non-breakable
  spaces above, and depending on your system if you copy and paste them
  into a file, they will cause this code to fail.  ]


I won't argue with you about readability of tables, but if I am typesetting
something for someone and they want it a certain way, I don't want to get
into an argument about it with them either.  :-)


The nice thing about your setup above is that it is nice and structured.
But if a table calls for some row, column or cell to be treated
differently, I guess I am in for some more reading.

Cheers.
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] Re: \starttable questions

2024-01-25 Thread Wolfgang Schuster

Jim schrieb am 25.01.2024 um 22:01:

Hi Henning,

On Thu, Jan 25, 2024 at 17:16 (+0100), Henning Hraban Ramm wrote:


Am 25.01.24 um 16:12 schrieb Jim:

Hi, I was wondering if anyone here could help me with these three things:
For a long time I have been using Wichura's TaBle macros (i.e., what one
gets with
  \input table
in plain TeX) and would like to use what appears to be ConTeXt's version of
those (i.e., what one gets with \starttable ... \stoptable).



However, https://wiki.contextgarden.net/Command/starttable says
The environment \starttable ... \stoptable is and (sic) old and
nearly obsolete way to handle tabular material
Q1: are there plans to remove \starttable ... \endtable from ConTeXt any
time "soon", or is that wiki comment gratuitously pessimistic?



Hans suggests to use tabulate as long as it fits.

I just gave that a try, using the same syntax as \starttable:

\starttable[|c|c|]
\HL
\VL \bf Year \VL \bf Citizens \VL\SR
\HL
\VL 1675 \VL ˜428 \VL\FR
\VL 1795 \VL 1124 \VL\MR
\VL 1880 \VL 2405 \VL\MR
\VL 1995 \VL 7408 \VL\LR
\HL
\stoptable

\starttabulate[|c|c|]
\HL
\VL \bf Year \VL \bf Citizens \VL\SR
\HL
\VL 1675 \VL ˜428 \VL\FR
\VL 1795 \VL 1124 \VL\MR
\VL 1880 \VL 2405 \VL\MR
\VL 1995 \VL 7408 \VL\LR
\HL
\stoptabulate

While tabulate produced a table with the above input, it needs some work to
make the table look good.  (The columns are too narrow, the vrules don't
meet the hrules, ...).

Perhaps these can be fixed with some tweaking, but I notice that in all of
https://wiki.contextgarden.net/Command/starttabulate
and
https://wiki.contextgarden.net/Tabulate
and
http://www.ntg.nl/maps/22/28.pdf
there is a conspicuous lack of examples with vrules.  And the tables in the
(at least) the starttabulate wiki page which use vrules don't use tabulate
to create the tables.

Coincidence?  I think not.  :-)


Table which rely on rules to make the content readable have a serious 
problem
(read Edward Tufte books how you can improve the visual style) but the 
better

alternative in this case are either natural tables or extreme tables.

Below is a example which uses the table like wrapper for natural tables
which makes adding rules and changing the padding around text very
simple because each table cell is a \framed block with all its options.

\starttext

\startsetups[ruledtable]
  \setupTABLE [frame=off,align=middle,loffset=.5em,roffset=.5em]
  \setupTABLE [column] [each]  [leftframe=on,rightframe=on]
  \setupTABLE [row]    [first] 
[topframe=on,bottomframe=on,foregroundstyle=bold]

  \setupTABLE [row]    [last]  [bottomframe=on]
\stopsetups

\startTABLE[setups=ruledtable]
\NC Year \NC Citizens \NC\NR
\NC 1675 \NC ˜428 \NC\NR
\NC 1795 \NC 1124 \NC\NR
\NC 1880 \NC 2405 \NC\NR
\NC 1995 \NC 7408 \NC\NR
\stopTABLE

\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: \setupitemgroup for footnotes

2023-09-25 Thread Henning Hraban Ramm

Am 25.09.23 um 17:52 schrieb Pablo Rodriguez:

Dear list,

I have the following sample (with current latest from 2023.09.18 21:13):

 \setuppapersize[A6]
 \starttext
 \startsetups[forfootnote]
 \setupitemgroup
[itemize][1]
[   before={\endgraf{\ttbf[before]}\endgraf},
 after={\endgraf{\ttbf [after]}\endgraf}]
 \stopsetups

 \setupnote[footnote][setups=forfootnote]

 \footnote{\startitemize
  \startitem Choose the correct answer.
  \startitemize
  \item This one
  \stopitemize
  \stopitem
 \stopitemize}
 \stoptext

Excuse my ignorance, but which is the right way to get the itemize setup
only for footnotes?


I would use \defineitemgroup to define your own, like "footnoteitemize".

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

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] \setupitemgroup for footnotes

2023-09-25 Thread Pablo Rodriguez
Dear list,

I have the following sample (with current latest from 2023.09.18 21:13):

\setuppapersize[A6]
\starttext
\startsetups[forfootnote]
\setupitemgroup
   [itemize][1]
   [   before={\endgraf{\ttbf[before]}\endgraf},
after={\endgraf{\ttbf [after]}\endgraf}]
\stopsetups

\setupnote[footnote][setups=forfootnote]

\footnote{\startitemize
 \startitem Choose the correct answer.
 \startitemize
 \item This one
 \stopitemize
 \stopitem
\stopitemize}
\stoptext

Excuse my ignorance, but which is the right way to get the itemize setup
only for footnotes?

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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: how to define an environment with key=value arguments

2023-09-08 Thread Henning Hraban Ramm

Am 08.09.23 um 17:02 schrieb Henning Hraban Ramm:
We can discuss the details next week and you put the resulting 
template on the wiki.


Ah, I guess I understand the template mechanism. Yet again glorious 
setups. Will probably manage.


So far:

\definepageinjection[chapter:start][
  page=left,
  alternative=setups,
  setups=frontispiz,
  color=white,
  background=color,
  backgroundcolor=Eifel,
]

\startsetups[frontispiz]
\starttransparent[tlumi]%
\externalfigure[\structureuservariable{image}][
  width=\measure{MaxWidth},
]%
\stoptransparent%
\stopsetups

\setuphead[chapter][
  page=right,
  style=\ChapterFont,
  beforesection={\pageinjection[chapter:start]},
  command=\ChapterStart,
  before={\startcolumnset[Spalten]},
  after={\vskip-\lineheight}, % fix column start
  inbetween=,
  aftersection={\stopcolumnset},
]

\startchapter[title={Prolog 2: Reiseführer}][
  motto={(quotation.}}, % used in \ChapterStart
  image={00 Lavakeller Mendig g}, % wrong
  blank=2,
]


Not a MWE, I know.
Here’s a screenshot:
https://yemaya.fiee.net/s/G2NcwE8qQrLAx8B

(Funny, I never needed all of before, after, beforesection and 
aftersection so far.)


The injection is a frame, that’s great, because I can set the 
background, and \externalfigure starts at (0,0).


But it uses its own page size, I don’t understand why. I need the 
bleed/trim area.


If I use \setlayer in the setup, the content gets placed on the next 
page, i.e. under the text.


\structureuservariable{image} in the setup gets the value from the 
_next_ chapter. Maybe the approach in from the source with

\dummyparameter\c!name
would work better, but I don’t know how to transfer 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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] TOC with sections titles and page numbers like a paragraph beneath chapter

2023-09-04 Thread jbf
I am attempting to get a TOC that looks like the following (in other 
words with section titles and their relative page numbers in a block 
below the chapter):


Chapter 1 ...5

Section 1   5, Section 2  6, Section 3  7,

Section 4   8, Section 5   9 etc

Chapter 2 10

Section 1   10, Section 2  11, Section 3  12,

Section 4   13, Section 5   14 etc

As I really had no idea how to do this, I found 
https://wiki.contextgarden.net/Horizontal_Table_of_Contents thinking it 
might help, but none of it compiles (for me) in LMTX. So I tried 
something different, e.g.


\definelist[chapter]

\setuplist[chapter][label=yes,distance=1.5cm,alternative=c,style=normal,before=\blank] 



\definelist[section]

\setuplist[section] [textcommand=\setups{SecToc}]

\setupcombinedlist

[content]o

[list={chapter,section}]


\startsetups [SecToc]

\startframedtext [width=\textwidth, align=middle, frame=off]

\placelist [section]

[

criterium=chapter,

]

\stopframedtext

\stopsetups

While that produces a result, it is nothing like what I want above. Has 
anyone put together a TOC of this kind and might be able to give me a 
hint to follow?


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Better option for a macro with lots of arguments

2023-08-23 Thread Hans Hagen via ntg-context

On 8/23/2023 4:12 AM, Andres Conrado Montoya wrote:

I have been using the following macro to add a bunch of sections to the
start of chapters in a book, it works but I think is kind of weak:

%%%

\define[7]\metadatos{
   \startsection[title={Resumen}] #1 \stopsection
   \startsection[title={Palabras clave}] #2 \stopsection
   \start
   \language[en]
   \startsection[title={Abstract}] #3  \stopsection
   \startsection[title={Keywords}] #4 \stopsection
   \stop
   \startsection[title={¿Cómo citar este capítulo? / How to cite this book?}]
 \startsubsection[title={Apa}] #5 \stopsubsection
 \startsubsection[title={Chicago}] #6 \stopsubsection
 \startsubsection[title={MLA}] #7 \stopsubsection
\stopsection
}

\starttext
% Then I call the macro like this:
\metadatos{spanish abstract \input knuth}{some, comma, separated, keywords,
in, spanish}{english abstract \input knuth}{same, comma, separated,
keywords, in, english}{Apa citation style for this article}{Chicago
citation style for this article}{MLA citation style for this article}
\stoptext
%%%

I've been exploring different ways to do it better, but with not much luck,
I was thinking something based in key=value assignments? setups? datasets?
Not really sure, but If you know a better solution or point me in the
direction of something I can use to replace that macro, it would be greatly
appreciated.

\startsetups [document:start]
   \doifdocumentvariable {englishabstract} {
 \startsection[title={Resumen}]
   \documentvariable{englishabstract}
 \stopsection
   }
   \doifdocumentvariable {spanisabstract} {
 \startsection[title={Palabras clave}]
   \documentvariable{spanishabstract}
 \stopsection
   }
   ...
\stopsetups

\startbuffer english
   ...
\stopbuffer

\startbuffer spanish
   ...
\stopbuffer


\startsetups [document:stop]
   ...
\stopsetups


\startdocument
  [spanisabstract={\getbuffer[spanish]},
   ]

...

\stopdocument

untested, just keyed in


-
  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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Penalties and overprinting in tabulate

2023-08-21 Thread Hans Hagen

On 8/21/2023 10:24 AM, denis.ma...@unibe.ch wrote:

-Ursprüngliche Nachricht-
Von: Hans Hagen 
Gesendet: Freitag, 18. August 2023 17:10
An: ntg-context@ntg.nl
Betreff: [NTG-context] Re: Penalties and overprinting in tabulate

On 8/18/2023 4:36 PM, denis.ma...@unibe.ch wrote:

Dear list,

typesetting the example below results in lines printed above each other?

Without the penalties, this doesn't happen. What am I missing here? How I
can use the penalties without the not wanted overprinting?


Best,
Denis


\startsetups[mypenalties]
  \setdefaultpenalties
  \setpenalties\clubpenalties{1}{150}
  \setpenalties\widowpenalties{1}{1}
  \setpenalties\displaywidowpenalties{1}{1}
\stopsetups

\setuplayout[setups=mypenalties]

\starttext
\starttabulate[|p(.15\textwidth)|p|]
 \NC asdf \NC a asdf asdf asdf asdf asdf asdf 
sdf asdf asdf

asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf

  \NC \NR
  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf

asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf

  \NC \NR
  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf

asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf

  \NC \NR
  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf

asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf

  \NC \NR
  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf

asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf

  \NC \NR
\stoptabulate

\stoptext

\startsetups[nopenalties]
  \setdefaultpenalties
\stopsetups


% \setuptabulate[setups=nopenalties] % in next version

\setuptabulate[inner=\setups{nopenalties}]

or

\starttabulate[|p(.15\textwidth)s{nopenalties}|ps{nopenalties}|]

but i admit it needs some thought ... outer level only but that is also pretty
much an engine thing then (no big deal but ... needs pondering)


Thanks, I guess that should be added to this page: 
https://wiki.contextgarden.net/Tabulate
I'll add it to my list of todos..., but just to make sure the explanation will be 
correct: what exactly is happening here? The tabulate environment will 
"inherit" the outer environments setups, but why does this result in the 
overprinting?

that is catched in a next upoload

-
  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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Penalties and overprinting in tabulate

2023-08-21 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Freitag, 18. August 2023 17:10
> An: ntg-context@ntg.nl
> Betreff: [NTG-context] Re: Penalties and overprinting in tabulate
> 
> On 8/18/2023 4:36 PM, denis.ma...@unibe.ch wrote:
> > Dear list,
> >
> > typesetting the example below results in lines printed above each other?
> Without the penalties, this doesn't happen. What am I missing here? How I
> can use the penalties without the not wanted overprinting?
> >
> > Best,
> > Denis
> >
> >
> > \startsetups[mypenalties]
> >  \setdefaultpenalties
> >  \setpenalties\clubpenalties{1}{150}
> >  \setpenalties\widowpenalties{1}{1}
> >  \setpenalties\displaywidowpenalties{1}{1}
> > \stopsetups
> >
> > \setuplayout[setups=mypenalties]
> >
> > \starttext
> > \starttabulate[|p(.15\textwidth)|p|]
> > \NC asdf \NC a asdf asdf asdf asdf asdf 
> > asdf sdf asdf asdf
> asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
> >  \NC \NR
> >  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf 
> > asdf asdf
> asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
> >  \NC \NR
> >  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf 
> > asdf asdf
> asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
> >  \NC \NR
> >  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf 
> > asdf asdf
> asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
> >  \NC \NR
> >  \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf 
> > asdf asdf
> asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
> >  \NC \NR
> > \stoptabulate
> >
> > \stoptext
> \startsetups[nopenalties]
>  \setdefaultpenalties
> \stopsetups
> 
> 
> % \setuptabulate[setups=nopenalties] % in next version
> 
> \setuptabulate[inner=\setups{nopenalties}]
> 
> or
> 
> \starttabulate[|p(.15\textwidth)s{nopenalties}|ps{nopenalties}|]
> 
> but i admit it needs some thought ... outer level only but that is also pretty
> much an engine thing then (no big deal but ... needs pondering)

Thanks, I guess that should be added to this page: 
https://wiki.contextgarden.net/Tabulate 
I'll add it to my list of todos..., but just to make sure the explanation will 
be correct: what exactly is happening here? The tabulate environment will 
"inherit" the outer environments setups, but why does this result in the 
overprinting?

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Enable interaction on custom apa cite variant

2023-08-19 Thread Jethro Djan
Hi,

I would like a variant of cite per the APA specification that removes the
bracket when quoted in mathematical definitions, theorems, etc. I could of
course do it manually for reach using right= and left= but I didn't want to
do it every time. I have come up with this MWE:

\startbuffer[ref]
@book{burago2022course,
  title={A course in metric geometry},
  author={Burago, Dmitri and Burago, Yuri and Ivanov, Sergei},
  volume={33},
  year={2022},
  publisher={American Mathematical Society}
}
\stopbuffer

\setupinteraction[state=start, color=blue]
\setupcolors[state=start]

\usebtxdataset[ref.buffer]

\usebtxdefinitions[apa]
\definebtx
[apa:cite:theorem]
[apa:cite]
\startsetups btx:apa:cite:theorem
\btxflushauthorname{author}
\btxcomma
\btxflush{year}
\fastsetup{btx:cite:righttext}
\stopsetups

\setupenumeration[
  before={\blank[medium]},
  after={\blank[medium]},
  alternative=serried,
  right=,
  headcommand=\groupedcommand{}{.},
  distance=0.5em,
  width=fit,
  headstyle=bold,
  titlestyle=bold,
  way=bytext,
  conversion=numbers,
  prefix=chapter,
  list=all,
  title=yes,
  indentnext=no,
]

\defineenumeration[definition][
  text=Defintion,
  style=normal,
  number=no,
]

\starttext

\startdefinition{\cite[righttext={{ p.\nbsp 1}},
alternative=theorem][burago2022course]}

This is something

\stopdefinition

\startsubject[title={References}]
\placelistofpublications
\startsubject

\stoptext

The problem with this is that the citation is not interactive like it would
be if I used apa:cite:authoryear and just removed the parentheses in the
options. How do I get it to highlight blue and be interactive like the
default behaviour when you turn on interaction? Also this is probably
overkill so if there is a better way to achieve this...

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Penalties and overprinting in tabulate

2023-08-18 Thread Hans Hagen

On 8/18/2023 4:36 PM, denis.ma...@unibe.ch wrote:

Dear list,

typesetting the example below results in lines printed above each other? 
Without the penalties, this doesn't happen. What am I missing here? How I can 
use the penalties without the not wanted overprinting?

Best,
Denis


\startsetups[mypenalties]
 \setdefaultpenalties
 \setpenalties\clubpenalties{1}{150}
 \setpenalties\widowpenalties{1}{1}
 \setpenalties\displaywidowpenalties{1}{1}
\stopsetups

\setuplayout[setups=mypenalties]

\starttext
\starttabulate[|p(.15\textwidth)|p|]
\NC asdf \NC a asdf asdf asdf asdf asdf asdf 
sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
 \NC \NR
 \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
 \NC \NR
 \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
 \NC \NR
 \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
 \NC \NR
 \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
 \NC \NR
\stoptabulate

\stoptext

\unprotect
\c_tabl_tabulate_splitlinemode\plustwo
\protect

maybe in the meantime that should be default

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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Penalties and overprinting in tabulate

2023-08-18 Thread Hans Hagen

On 8/18/2023 4:36 PM, denis.ma...@unibe.ch wrote:

Dear list,

typesetting the example below results in lines printed above each other? 
Without the penalties, this doesn't happen. What am I missing here? How I can 
use the penalties without the not wanted overprinting?

Best,
Denis


\startsetups[mypenalties]
 \setdefaultpenalties
 \setpenalties\clubpenalties{1}{150}
 \setpenalties\widowpenalties{1}{1}
 \setpenalties\displaywidowpenalties{1}{1}
\stopsetups

\setuplayout[setups=mypenalties]

\starttext
\starttabulate[|p(.15\textwidth)|p|]
\NC asdf \NC a asdf asdf asdf asdf asdf asdf 
sdf asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
 \NC \NR
 \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
 \NC \NR
 \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
 \NC \NR
 \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
 \NC \NR
 \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
 \NC \NR
\stoptabulate

\stoptext

\startsetups[nopenalties]
\setdefaultpenalties
\stopsetups


% \setuptabulate[setups=nopenalties] % in next version

\setuptabulate[inner=\setups{nopenalties}]

or

\starttabulate[|p(.15\textwidth)s{nopenalties}|ps{nopenalties}|]

but i admit it needs some thought ... outer level only but that is also 
pretty much an engine thing then (no big deal but ... needs pondering)


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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Penalties and overprinting in tabulate

2023-08-18 Thread denis.maier
Dear list,

typesetting the example below results in lines printed above each other? 
Without the penalties, this doesn't happen. What am I missing here? How I can 
use the penalties without the not wanted overprinting?

Best,
Denis


\startsetups[mypenalties]
\setdefaultpenalties
\setpenalties\clubpenalties{1}{150}
\setpenalties\widowpenalties{1}{1}
\setpenalties\displaywidowpenalties{1}{1}
\stopsetups

\setuplayout[setups=mypenalties]

\starttext
\starttabulate[|p(.15\textwidth)|p|]
   \NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf 
asdf asdf asdf asdf asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
\NC \NR
\NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
\NC \NR
\NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
\NC \NR
\NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
\NC \NR
\NC asdf \NC a asdf asdf asdf asdf asdf asdf sdf asdf asdf asdf asdf 
asdf asdf asdf ashjkdf askldf askdlfjöaslkdfjaösdlf
\NC \NR
\stoptabulate

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: breakpoints in verbatim text

2023-08-18 Thread Hans Hagen

On 8/18/2023 1:02 PM, Wolfgang Schuster wrote:

Alex Leray schrieb am 18.08.2023 um 12:19:

Hello Wolfgang,

Le 17/08/23 à 18:56, Wolfgang Schuster a écrit :
Is it correct all your listing are HTML code and you need line breaks 
for the entries of the href attributes?


The content is from a dutch net-artist artist from the early days of 
the public web, and is often (volontary) mixing different natural nd 
machine langages. Not all snippets are HTML, but most of them are some 
sort of HTML pidgin.



I see, the typing environment is in this case the safest option to 
ensure special characters like % remain i the output.


For simple text without special characters you could have switched to 
the lines environment and use a monospaced but

I wouldn't trust it here (even when you enable \asciimode).



Syntax highlighting of the code listing isn't needed in your case.


No, I don't need syntax highlighting

My problem is solved using manual zero width spaces at the moment but 
I'd be interested to find a more structural solution.


Checking at the Context source code I would have thought that 
breakpoints were possible withing typing env. See


https://source.contextgarden.net/tex/context/base/mkiv/buff-ver.mkiv?search=typing#l51

It would be interesting to document on the wiki that behavior, which I 
can do later when my understanding is better.


The typing environment disables the breakpoint (and a few other) 
mechanism because they can lead to undesired
side effects but Hans suggestion to provide a hook which can be used to 
re-enable the feature, e.g.


     \startsetups [typing:mine]
         \setbreakpoints[compound]
     \stopsetups

     \setuptyping [CUSTOM] [setups=typing:mine]

The only flaw I can see in the suggestion is the use of the 
\everyinitializeverbatim register because it is used for
inline and display verbatim. A better place to add the option is 
\buff_verbatim_initialize_typing_two for \starttyping

and \buff_verbatim_initialize_type_two for \type.


ok

--

-
  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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: breakpoints in verbatim text

2023-08-17 Thread Alex Leray

Thanks,

Unfortunatly, it doesn't work (no difference in output with or without 
the `setups` parameter)


I'm not up-to-date, Should I update? Here is my version.

mtx-context | current version: 2023.03.10 12:15

Many thanks

Le 17/08/23 à 16:32, Hans Hagen a écrit :

On 8/17/2023 2:41 PM, Alex Leray wrote:

Hi,

I'd like to break lines in verbatim on certain characters like "/".

I can do it for normal texte, but not inside typing environment.

Is there a way to achieve this?


For now do this:

   \appendtoks
  \usesetupsparameter\typingparameter
   \to \everyinitializeverbatim

and then

   \startsetups typing:mine
   \setbreakpoints[compound]
   \stopsetups

with

   \starttyping[lines=yes,setups=typing:mine]

I need Wolfgang to check it for possible interferences.

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://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


--
Alexandre Leray
+32 487 947 030

Avez-vous pensé à (vous) offrir Médor ?
https://medor.coop/ideescadeau
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: breakpoints in verbatim text

2023-08-17 Thread Hans Hagen

On 8/17/2023 2:41 PM, Alex Leray wrote:

Hi,

I'd like to break lines in verbatim on certain characters like "/".

I can do it for normal texte, but not inside typing environment.

Is there a way to achieve this?


For now do this:

  \appendtoks
 \usesetupsparameter\typingparameter
  \to \everyinitializeverbatim

and then

  \startsetups typing:mine
  \setbreakpoints[compound]
  \stopsetups

with

  \starttyping[lines=yes,setups=typing:mine]

I need Wolfgang to check it for possible interferences.

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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Experiments with \doloopoverlist

2023-08-17 Thread Hans Hagen via ntg-context

On 8/17/2023 3:50 AM, Andres Conrado Montoya wrote:

Hello List.

I've been trying to typeset a somewhat complex list of authors for several
articles and a book.
My proof of concept seems to work fine, however, I know I am doing weird
things that I think could probably be done in a better way. I'm using
datasets and a recursion, kind of hacky but I can't find a better way of
handling it. Specifically I would like to know:
1. Is there a way of getting the length of a filled dataset? (how many
entries it contains)
2. Is it OK to use \startuserdata \stopuserdata without its inlineuserdata?
Is there an alternative that does not require inlineuserdata?


Weird is relative. Just use what you like most. One could for instance 
use the publication mechanism but you need to set up a bit more (see 
manual for example of usa as database).


Now datasets. It is not hard to add a size query so I added that. Your 
data is missins commas so let's fix that first


\definedataset[autores]

\setdataset[autores]
[
nombre={Angie Natalia Farfán Acevedo},

cvlac={https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002125949},
orcid={https://orcid.org/0009-0007-0765-4241},

gscholar={https://scholar.google.com/citations?user=GpYTTU0J=es=1},
]

\setdataset[autores]
[
nombre={Ivon Andrea Rodríguez Román},

cvlac={https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=027033},
orcid={https://orcid.org/0009-0001-1183-6829},

gscholar={https://scholar.google.com/citations?user=iz8SQNcJ=es},
]

\setdataset[autores]
[
  nombre={Angie Caterin Garzón González},

cvlac={https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002128501},
  orcid={https://orcid.org/0009-0009-0990-6902},

gscholar={https://scholar.google.com/citations?view_op=list_works=es=5WqcOeEJ},
]

\setdataset[autores]
[
  nombre={Heidy Paola Veira Tenorio},

cvlac={https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002127550},
  orcid={https://orcid.org/0009-0008-4076-7317},

gscholar={https://scholar.google.es/citations?view_op=new_profile=es=1},
]

\setdataset[autores]
[
nombre={Yerly Lorena Diaz Aldana},

cvlac={https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002127754},
orcid={https://orcid.org/0009-0008-1720-4057},

gscholar={https://scholar.google.com/citations?hl=es=0obyCwkJ_op=list_works=AOV7GLPWRTK-xooHNe0iQ3uubfcSbG__GY_Guy35FdaqDJA3OfLLtp01-E1kzjxUhltlsfj494MaoQFkk9U9hCFYSipoR8aX0Vu2E6sV},
]

There is no need to use userdata as intermediate:

% \startsetups[userdata:idautor]
%   \dontleavehmode
%   \imghref
% {\externalfigure[cvlac.pdf][logo]}
% {\datasetvariable{autores}{\recurselevel}{vclac}}
% \quad
%   \imghref
% {\externalfigure[orcid.pdf][logo]}
% {\datasetvariable{autores}{\recurselevel}{orcid}}
% \quad
%   \imghref
% {\externalfigure[gscholar.pdf][logo]}
% {\datasetvariable{autores}{\recurselevel}{nombre}}
% \quad
%   \datasetvariable{autores}{\recurselevel}{nombre}\par
% \stopsetups

Just loop over the set and call up the variables in the setup:

% \startdocument
%   \dorecurse{\datasetsize{autores}}{
% \setups[userdata:idautor]
%   }
% \stopdocument

However, i can provide a processor:

% \startsetups[userdata:idautor]
%   \dontleavehmode
%   \imghref
% {\externalfigure[cvlac.pdf][logo]}
% {\datasetvariable{autores}{\datasetindex}{vclac}}
% \quad
%   \imghref
% {\externalfigure[orcid.pdf][logo]}
% {\datasetvariable{autores}{\datasetindex}{orcid}}
% \quad
%   \imghref
% {\externalfigure[gscholar.pdf][logo]}
% {\datasetvariable{autores}{\datasetindex}{nombre}}
% \quad
%   \datasetvariable{autores}{\datasetindex}{nombre}\par
% \stopsetups

As we know what dataset we process:

\startsetups[userdata:idautor]
  \dontleavehmode
  \imghref
{\externalfigure[cvlac.pdf][logo]}
{\datasetentry{vclac}}
\quad
  \imghref
{\externalfigure[orcid.pdf][logo]}
{\datasetentry{orcid}}
\quad
  \imghref
{\externalfigure[gscholar.pdf][logo]}
{\datasetentry{nombre}}
\quad
  \datasetentry{nombre}
  \par
\stopsetups

We then end up with:

\startdocument
  \processdataset[autores][userdata:idautor]
\stopdocument

I'll mail you the patch. Copy it to the right place and remake the format.

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

[NTG-context] Experiments with \doloopoverlist

2023-08-16 Thread Andres Conrado Montoya
Hello List.

I've been trying to typeset a somewhat complex list of authors for several
articles and a book.
My proof of concept seems to work fine, however, I know I am doing weird
things that I think could probably be done in a better way. I'm using
datasets and a recursion, kind of hacky but I can't find a better way of
handling it. Specifically I would like to know:
1. Is there a way of getting the length of a filled dataset? (how many
entries it contains)
2. Is it OK to use \startuserdata \stopuserdata without its inlineuserdata?
Is there an alternative that does not require inlineuserdata?

%% MWE:
\setupinteraction[state=start]

\define[2]\imghref{\bgroup\goto{#1}[url(#2)]\egroup}
\defineexternalfigure[logo][height=1em]

\definedataset[autores]

\setdataset[autores][
  nombre={Angie Natalia Farfán Acevedo},
  cvlac={
https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002125949
},
  orcid={https://orcid.org/0009-0007-0765-4241},
  gscholar={
https://scholar.google.com/citations?user=GpYTTU0J=es=1},
]
\setdataset[autores][
  nombre={Ivon Andrea Rodríguez Román}
  cvlac={
https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=027033
}
  orcid={https://orcid.org/0009-0001-1183-6829}
  gscholar={https://scholar.google.com/citations?user=iz8SQNcJ=es}
]
\setdataset[autores][
  nombre={Angie Caterin Garzón González}
  cvlac={
https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002128501
}
  orcid={https://orcid.org/0009-0009-0990-6902}
  gscholar={
https://scholar.google.com/citations?view_op=list_works=es=5WqcOeEJ
}
]
\setdataset[autores][
  nombre={Heidy Paola Veira Tenorio}
  cvlac={
https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002127550
}
  orcid={https://orcid.org/0009-0008-4076-7317}
  gscholar={
https://scholar.google.es/citations?view_op=new_profile=es=1}
]
\setdataset[autores][
  nombre={Yerly Lorena Diaz Aldana}
  cvlac={
https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0002127754
}
  orcid={https://orcid.org/0009-0008-1720-4057}
  gscholar={
https://scholar.google.com/citations?hl=es=0obyCwkJ_op=list_works=AOV7GLPWRTK-xooHNe0iQ3uubfcSbG__GY_Guy35FdaqDJA3OfLLtp01-E1kzjxUhltlsfj494MaoQFkk9U9hCFYSipoR8aX0Vu2E6sV
}
]

\defineuserdataalternative[idautor][renderingsetup=userdata:idautor]

\startsetups[userdata:idautor]
  \dontleavehmode
  \imghref
{\externalfigure[cvlac.pdf][logo]}
{\userdataparameter{cvlac}}
\quad
  \imghref
{\externalfigure[orcid.pdf][logo]}
{\userdataparameter{orcid}}
\quad
  \imghref
{\externalfigure[gscholar.pdf][logo]}
{\userdataparameter{gscholar}}
\quad
  \userdataparameter{author}\par
\stopsetups

\defineuserdata[idautor][alternative=idautor]

\startdocument
  % I have to manually set the length of the dataset in the loop and use
recurselevel...
  % Maybe there is a way to use the length of the "autores" dataset? and
use indexes?
  \dorecurse{5}{
\startuserdata[idautor][
  author={\datasetvariable{autores}{\recurselevel}{nombre}},
  cvlac={\datasetvariable{autores}{\recurselevel}{cvlac}},
  orcid={\datasetvariable{autores}{\recurselevel}{orcid}},
  gscholar={\datasetvariable{autores}{\recurselevel}{gscholar}},
]\stopuserdata % My "inlineuserdata" is empty... no idea if this is
OK...
  }
\stopdocument
%% END MWE

Thank you in advance.

-- 
Andrés Conrado Montoya
Andi Kú
andresconr...@gmail.com
http://sesentaycuatro.com
http://messier87.com
http://chiquitico.org

Los fines no justifican los medios, porque la medida verdadera de nuestro
carácter está dada por los medios que estamos dispuestos a utilizar, no por
los fines que proclamamos.


“You develop an instant global consciousness, a people orientation, an
intense dissatisfaction with the state of the world, and a compulsion to do
something about it. From out there on the moon, international politics look
so petty. You want to grab a politician by the scruff of the neck and drag
him a quarter of a million miles out and say, ‘Look at that, you son of a
bitch.’” — Apollo 14 astronaut Edgar Mitchell
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: disable header for endnotes

2023-08-16 Thread Rik Kabel

On 8/16/2023 5:02 AM, jbf wrote:


I wonder if someone might be able to help me with this.

I have a book in three parts and the author wants endnotes. No 
problem. I can produce those with \setupfootnotes[location=text] and 
then \placefootnotes.


However, I would like the header to read 'Notes' on the recto page (or 
indeed be blank with no header), but I am currently getting the header 
that belongs to the main setup for headers, which happens to be:


\startsetups[middle]

\hfill

\getmarking[section]

\hfill

\stopsetups

\setupheadertexts

[{\hfill\documentvariable{metadata:title}\hfill}][]

[\setups{middle}][]

How do I deal with the \placefootnotes command so that it ignores this 
and either gives me no header, or perhaps a new header with 'Notes' in 
place of [section] (which is achieved in centered position with 
setups[middle])?


Julian


I use the following for a notes chapter at the end of a book. It 
produces headings that indicate the pages for which the notes apply. 
Perhaps you can adapt it to your needs:


   In the environment file:

   \definemarking [notePage] \startsetups noteHeadingsText {\em
   Notes for page
   \doifelse{\fetchmark[notePage][top]}{\fetchmark[notePage][bottom]}
   { \getmarking[notePage][top]} {s
   \getmarking[notePage][top]–\getmarking[notePage][bottom]}}
   \stopsetups \startsetups noteHeadings:on
   \setupheadertexts[][\setups{noteHeadingsText}]
   [\setups{noteHeadingsText}][] \stopsetups

   In the text:

   \startbackmatter \startchapter[reference={cha:notes},
   list={Notes}, % toc bookmark={Notes}, % pdf bookmark
   title={Notes}] % chapter head [Lettrine=no]
   \setups{noteHeadings:on} \placenotes[endnote] \stopchapter

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] disable header for endnotes

2023-08-16 Thread jbf

I wonder if someone might be able to help me with this.

I have a book in three parts and the author wants endnotes. No problem. 
I can produce those with \setupfootnotes[location=text] and then 
\placefootnotes.


However, I would like the header to read 'Notes' on the recto page (or 
indeed be blank with no header), but I am currently getting the header 
that belongs to the main setup for headers, which happens to be:


\startsetups[middle]

\hfill

\getmarking[section]

\hfill

\stopsetups

\setupheadertexts

[{\hfill\documentvariable{metadata:title}\hfill}][]

[\setups{middle}][]

How do I deal with the \placefootnotes command so that it ignores this 
and either gives me no header, or perhaps a new header with 'Notes' in 
place of [section] (which is achieved in centered position with 
setups[middle])?


Julian

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Scaling characters without font switching in CLD

2023-08-12 Thread Hamid,Idris
On Aug 12, 2023, 3:49 PM -0600, Hans Hagen , wrote:

> you'll figure it out, right?

I hope so and I'm working on it -- with your help -)

> the demo shows both: x/.y scaling and 90/180/270 rotation

Yes, here is what I have so far:

==
% % Hans' original template

% \startsetups glyph:iTee
 % \dontleavehmode\hpack\bgroup
 % \setbox\scratchbox \ruledhbox \bgroup
 % \glyphxscale 400
 % \glyphyscale 400
 % \getglyphstyled{Serif}{T}% choose a font here
 % \egroup
 % \scratchheight 2.75\ht\scratchbox
 % \boxyoffset\scratchbox\scratchheight
 % \boxorientation\scratchbox\plustwo
 % \ht\scratchbox\scratchheight
 % \box\scratchbox
 % \egroup
% \stopsetups

% \definesymbol
   % [iTee]
   % [\directsetup{glyph:iTee}]

% \startTEXpage [offset=1ts,width=2cm]
 % \ruledhbox {\tfx T \symbol{iTee}} \par
 % \ruledhbox {T  \symbol{iTee}} \par
 % \ruledhbox {\tfa T \symbol{iTee}} \par
 % \ruledhbox {\bfd T \symbol{iTee}}
% \stopTEXpage

\definefontsynonym[MinionRegular][MinionPro-Regular.otf*default]

\startsetups glyph:glottalhamzah
 \dontleavehmode\hpack\bgroup
 \setbox\scratchbox \ruledhbox \bgroup
 \glyphxscale 500
 \glyphyscale 500
 \getglyphstyled{MinionRegular}{c}% choose a font here
 \egroup
 \scratchheight 2.03\ht\scratchbox
 \boxyoffset\scratchbox\scratchheight
 \boxorientation\scratchbox\plustwo
 \ht\scratchbox\scratchheight
 \box\scratchbox
 \egroup
\stopsetups

\startsetups glyph:glottalayn
 \dontleavehmode\hpack\bgroup
 \setbox\scratchbox \ruledhbox \bgroup
 \glyphxscale 500
 \glyphyscale 500
 \getglyphstyled{MinionRegular}{c}% choose a font here
 \egroup
 \scratchheight 1.00\ht\scratchbox
 \boxyoffset\scratchbox\scratchheight
 % \boxorientation\scratchbox\plustwo
 \ht\scratchbox\scratchheight
 \box\scratchbox
 \egroup
\stopsetups

\definesymbol
   [glottalhamzah]
   [\directsetup{glyph:glottalhamzah}]

\definesymbol
   [glottalayn]
   [\directsetup{glyph:glottalayn}]

\definecolor [transparentgreen]  [g=1,t=.7,a=1]
\definecolor [transparentred][r=1,t=.7,a=1]
\definecolor [transparentyellow] [y=1,t=.7,a=1]

\startTEXpage [offset=1ts,width=2cm]
 \ruledhbox {\tfx  c\symbol{glottalhamzah}c} \par
 \ruledhbox   {c\symbol{glottalhamzah}c} \par
 \ruledhbox {\tfa  c\symbol{glottalhamzah}c} \par
 \ruledhbox {\bfd  c\symbol{glottalhamzah}c} \par

 \ruledhbox {\tfx  c\symbol{glottalayn}c} \par
 \ruledhbox   {c\symbol{glottalayn}c} \par
 \ruledhbox {\tfa  c\symbol{glottalayn}c} \par
 \ruledhbox {\bfd  c\symbol{glottalayn}c} \par

 \hbox{\rlap{\ruledhbox {\transparentgreen\tfx  c\symbol{glottalhamzah}c}}%
\hskip-.09em \ruledhbox {\transparentred
c\symbol{glottalhamzah}c}}

 \hbox{\rlap{\ruledhbox {\transparentgreen\tfx  c\symbol{glottalayn}c}}%
 \ruledhbox {\transparentredc\symbol{glottalayn}c}}
\stopTEXpage
==

Note the \rlap's (see attached pdf): we see that \tfx doesn't scale the 
\symbol, although \tfa and higher do work.

I guess fixing \tfx-symbol interaction will be part of your conversation with 
Wolfgang -)

> well, you wented symbols so

Ultimately I just want to be able to type the Unicode symbols for 02BE and 02BF 
-- ʾ and ʿ -- and get proper results. The overwhelming majority of hq fonts 
don't have them, and the few that do do them poorly, etc.

(So there is no substitute for full control of these transliteration 
characters.)

So even if we use symbols, would like to feed these setups to the CLD template 
you provided some days ago and feed the final result to \definefontfeature.
===

Best wishes
Idris
--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523


test-scaling-hans.pdf
Description: test-scaling-hans.pdf
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Scaling characters without font switching in CLD

2023-08-12 Thread Hans Hagen

On 8/12/2023 11:33 PM, Hamid,Idris wrote:

On Aug 12, 2023, 2:11 PM -0600, Hans Hagen via ntg-context 
, wrote:

impossible to reply as impossible to see what is your and mine text here


Hm.. This new/modern email client (forced to update by the university) supports 
inline replies, and I can see the levels, but the distinctions between levels 
of reply appears to get lost when filtered by the ntg-context list (looking at 
the archives). So here it is again, with levels of reply made explicit:

On Aug 12, 2023, 9:35 AM -0600, Hans Hagen , wrote:
** Caution: EXTERNAL Sender **

On 8/12/2023 4:03 PM, Hamid,Idris wrote:


\tfx causes a switch to computer modern.



Indeed. Something I need to discuss with Wolfgang as double checking is needed 
before I patch.


Ah.. ok.


But what if we want to scale independently of font switching?



There is no need to go lua here (esp when you have not done vf magick
before and i'm not going to debug code that i have little clue what it's
about to do).


Many thanks. Part of the context is that I have some updatable mission-critical 
documents that depended on \defineactivecharacter, which is apparently 
deprecated in LMTX. See earlier thread with that subject line.


i adapted some recently but anyway active chars are a bad idea


[BTW: Just this morning someone from the Persian Gulf asked for an updated 
version of a document whose compilation depended on \defineactivecharacter, so 
I need to get this working in the new regime -)]

Now the templates that you provided - many, many thanks! - have what is needed 
to care of everything except for two characters: 02BE and 02BF.


you'll figure it out, right?


For one of those two remaining characters we also need scaling, for the other 
we also need scaling + rotation. It is not clear to me whether the 
scaling/rotation commands should fall under the character function, e.g.,


the demo shows both: x/.y scaling and 90/180/270 rotation


===
-- ʿ ringhalfleft
local function ringhalfleft (characters,target,base,accent)
===

the initialize function

===
local function initialize(tfmdata,value)
===

or whether we just make a new function altogether

===
local function scale (ringhalfleft)  -- shooting in the dark here
===

So the reason I said CLD is best is because we already defined all of the 
needed characters that way -- using your template -- except for these two, for 
which we need to add scaling and or rotation.


The attached (linked in the previous email but attached here) gives us rotation 
but no scaling.
- we cheat here and yuse glyph scaled (I have to provide a relative to
current x/y scaling, don't use \glyphscale as that one is used by
context itself
- we use the style variant so that it adapts
- you have to replace "Serif" with "YourFont" and map that one onto a
file (YourFont YourFontBold etc)
- more about these box manipulations in the low level manual


Ok. Just discovered the 11 low-level manuals yesterday, not sure which one to 
focus on in this case -)


\startsetups glyph:iTee
\dontleavehmode\hpack\bgroup
\setbox\scratchbox \ruledhbox \bgroup
\glyphxscale 400
\glyphyscale 400
\getglyphstyled{Serif}{T}> choose a font here
\egroup
\scratchheight 2.75\ht\scratchbox
\boxyoffset \scratchbox\scratchheight
\boxorientation\scratchbox\plustwo
\ht \scratchbox\scratchheight
\box\scratchbox
\egroup
\stopsetups



\definesymbol
[iTee]
[\directsetup{glyph:iTee}]



\startTEXpage [offset=1ts,width=2cm]
\ruledhbox {\tfx T \symbol{iTee}} \par
\ruledhbox {T \symbol{iTee}} \par
\ruledhbox {\tfa T \symbol{iTee}} \par
\ruledhbox {\bfd T \symbol{iTee}}
\stopTEXpage


Great, will study this. The challenge (for me) will be integrating this 
approach into the lua definitions of the two needed characters. With 
\defineactivecharacter deprecated, there seems to be no way other than CLD to 
make and register the needed macro for \definefontfeature -- and we want to 
move forward with the new regime and not look back.


well, you wented symbols so ... why lua then (btw, no need for squeezine 
as there are virtual commands for scaling; not for rotating; an 
alternative is to define some chars in metapost (see 
meta-imp-gamesymbols) which gives you plenty freedom



With many thanks and much gratitude, Hans.

Best wishes
Idris
--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : ht

[NTG-context] Re: Scaling characters without font switching in CLD

2023-08-12 Thread Hamid,Idris
On Aug 12, 2023, 2:11 PM -0600, Hans Hagen via ntg-context 
, wrote:
> impossible to reply as impossible to see what is your and mine text here

Hm.. This new/modern email client (forced to update by the university) supports 
inline replies, and I can see the levels, but the distinctions between levels 
of reply appears to get lost when filtered by the ntg-context list (looking at 
the archives). So here it is again, with levels of reply made explicit:

On Aug 12, 2023, 9:35 AM -0600, Hans Hagen , wrote:
** Caution: EXTERNAL Sender **

On 8/12/2023 4:03 PM, Hamid,Idris wrote:

>> \tfx causes a switch to computer modern.

> Indeed. Something I need to discuss with Wolfgang as double checking is 
> needed before I patch.

Ah.. ok.

>> But what if we want to scale independently of font switching?

> There is no need to go lua here (esp when you have not done vf magick
> before and i'm not going to debug code that i have little clue what it's
> about to do).

Many thanks. Part of the context is that I have some updatable mission-critical 
documents that depended on \defineactivecharacter, which is apparently 
deprecated in LMTX. See earlier thread with that subject line.

[BTW: Just this morning someone from the Persian Gulf asked for an updated 
version of a document whose compilation depended on \defineactivecharacter, so 
I need to get this working in the new regime -)]

Now the templates that you provided - many, many thanks! - have what is needed 
to care of everything except for two characters: 02BE and 02BF.

For one of those two remaining characters we also need scaling, for the other 
we also need scaling + rotation. It is not clear to me whether the 
scaling/rotation commands should fall under the character function, e.g.,

===
-- ʿ ringhalfleft
local function ringhalfleft (characters,target,base,accent)
===

the initialize function

===
local function initialize(tfmdata,value)
===

or whether we just make a new function altogether

===
local function scale (ringhalfleft)  -- shooting in the dark here
===

So the reason I said CLD is best is because we already defined all of the 
needed characters that way -- using your template -- except for these two, for 
which we need to add scaling and or rotation.

> The attached (linked in the previous email but attached here) gives us 
> rotation but no scaling.
> - we cheat here and yuse glyph scaled (I have to provide a relative to
> current x/y scaling, don't use \glyphscale as that one is used by
> context itself
> - we use the style variant so that it adapts
> - you have to replace "Serif" with "YourFont" and map that one onto a
> file (YourFont YourFontBold etc)
> - more about these box manipulations in the low level manual

Ok. Just discovered the 11 low-level manuals yesterday, not sure which one to 
focus on in this case -)

> \startsetups glyph:iTee
> \dontleavehmode\hpack\bgroup
> \setbox\scratchbox \ruledhbox \bgroup
> \glyphxscale 400
> \glyphyscale 400
> \getglyphstyled{Serif}{T}> choose a font here
> \egroup
> \scratchheight 2.75\ht\scratchbox
> \boxyoffset \scratchbox\scratchheight
> \boxorientation\scratchbox\plustwo
> \ht \scratchbox\scratchheight
> \box\scratchbox
> \egroup
> \stopsetups

> \definesymbol
> [iTee]
> [\directsetup{glyph:iTee}]

> \startTEXpage [offset=1ts,width=2cm]
> \ruledhbox {\tfx T \symbol{iTee}} \par
> \ruledhbox {T \symbol{iTee}} \par
> \ruledhbox {\tfa T \symbol{iTee}} \par
> \ruledhbox {\bfd T \symbol{iTee}}
> \stopTEXpage

Great, will study this. The challenge (for me) will be integrating this 
approach into the lua definitions of the two needed characters. With 
\defineactivecharacter deprecated, there seems to be no way other than CLD to 
make and register the needed macro for \definefontfeature -- and we want to 
move forward with the new regime and not look back.

With many thanks and much gratitude, Hans.

Best wishes
Idris
--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Pass string into text background graphic

2023-08-12 Thread Hans Hagen via ntg-context

On 8/12/2023 7:19 PM, Thangalin wrote:

Thanks Hans.

The \newinteger approach would always increment the value, regardless of
conditionals within the MetaPost code (i.e., it was like legend :=
"\ConcurrentTextGet" would always invoke the macro just be referencing the
MPgraphic and nothing would prevent its execution). This meant that the Get
indexes would not correspond to the Set indexes. Switching to \definenumber
resolved the issue. There were a few other oddities, such as the "Get"
counter incrementing twice. Here's the code:


you could remove the \localcontrolled around the advance


\definenumber[ConcurrentTextSetCounter][prefix=no]
\definenumber[ConcurrentTextGetCounter][prefix=no]

\setnumber[ConcurrentTextSetCounter][0]
\setnumber[ConcurrentTextGetCounter][0]

% Map each label as global key/value pairs.
\def\ConcurrentTextSet#1{%
   \incrementnumber[ConcurrentTextSetCounter]%
   \setxvariable
 {concurrent}
 {text:\rawcountervalue[ConcurrentTextSetCounter]}
 {#1}}

% Account for the counter incrementing twice and the index being 1-based.
\def\ConcurrentTextGet{%
   \incrementnumber[ConcurrentTextGetCounter]%
   \getvariable
 {concurrent}


why twice ? you only have to typeset the text once, right?


{text:\number\numexpr1+\rawcountervalue[ConcurrentTextGetCounter]/2\relax}}

\startuseMPgraphic{GraphicConcurrent}
   numeric index;
   index := 1;

   % Differentiate between new text blocks and those crossing pages.
   if (multikind[ index ] = "single") or (multikind[ index ] = "first"):
 string legend;
 legend := "\ConcurrentTextGet";

 % For new text blocks, write the title.
 picture p;
 p := textext.rt( legend )
   shifted ulcorner multipars[ index ]
   shifted (1cm, 0);

 % Draw the horizontal rule only for the initial text block.
 draw
   ulcorner multipars[ index ] shifted (1mm + xpart lrcorner p, 0) --
   urcorner multipars[ index ];

 % Draw the vertical rule for the initial text block.
 draw
   llcorner multipars[ index ] --
   ulcorner multipars[ index ] --
   ulcorner multipars[ index ] shifted (9mm, 0);

 draw p;
   else:
 % Draw only the vertical rule only when crossing page boundaries.
 draw
   llcorner multipars[ index ] --
   ulcorner multipars[ index ];
   fi
\stopuseMPgraphic

\definetextbackground[TextConcurrentFrame][
   mp=GraphicConcurrent,
   frame=off,
   topoffset=1em,
   leftoffset=1em,
   before=\blank[2*big],
   after=\blank,
   location=paragraph,
]

\startsetups concurrent:before
   \ConcurrentTextSet{%
 % Be sure to format "a.m." and other special phrases.
 \expandafter\TextReplacement{%
   \xmlatt{\getvariable{div}{concurrent}}{data-title}%
 }
   }
   \startTextConcurrentFrame
\stopsetups

\startsetups concurrent:after
   \stopTextConcurrentFrame
\stopsetups

\definestartstop[concurrent][
   before=\directsetup{concurrent:before},
   after=\directsetup{concurrent:after}
]

This allows for typesetting a wider range of pandoc-style Markdown
annotations, such as:

::: {.concurrent title="Terminal Berth 5, 3:17 a.m."}
text goes here
:::

With these changes, the titles now only appear at the start of the
demarcated text, in any combination of "concurrent" annotation instances
spanning any number of pages.

Much appreciated.

Cheers!
P.S.
The following line requires KeenWrite themes:

\expandafter\TextReplacement{ ... }

For details, see:

-

https://github.com/DaveJarvis/keenwrite-themes/blob/main/xhtml/xml-blocks.tex
-
https://github.com/DaveJarvis/keenwrite-themes/blob/main/boschet/replace.tex


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Scaling characters without font switching in CLD

2023-08-12 Thread Hamid,Idris
On Aug 12, 2023, 9:35 AM -0600, Hans Hagen , wrote:
** Caution: EXTERNAL Sender **

On 8/12/2023 4:03 PM, Hamid,Idris wrote:

\tfx causes a switch to computer modern.

Indeed. Something I need to discuss with Wolfgang as double checking is needed 
before I patch.

Ah.. ok.

But what if we want to scale independently of font switching?
There is no need to go lua here (esp when you have not done vf magick
before and i'm not going to debug code that i have little clue what it's
about to do).

Many thanks. Part of the context is that I have some updatable mission-critical 
documents that depended on \defineactivecharacter, which is apparently 
deprecated in LMTX. See earlier thread with that subject line.

[BTW: Just this morning someone from the Persian Gulf asked for an updated 
version of a document whose compilation depended on \defineactivecharacter, so 
I need to get this working in the new regime -)]

Now the templates that you provided - many, many thanks! - have what is needed 
to care of everything except for two characters: 02BE and 02BF.

For one of those two remaining characters we also need scaling, for the other 
we also need scaling + rotation. It is not clear to me whether the 
scaling/rotation commands should fall under the character function, e.g.,

===
-- ʿ ringhalfleft
local function ringhalfleft (characters,target,base,accent)
===

the initialize function

===
local function initialize(tfmdata,value)
===

or whether we just make a new function altogether

===
local function scale (ringhalfleft)  -- shooting in the dark here
===

So the reason I said CLD is best is because we already defined all of the 
needed characters that way -- using your template -- except for these two, for 
which we need to add scaling and or rotation.

The attached (linked in the previous email but attached here) gives us rotation 
but no scaling.
- we cheat here and yuse glyph scaled (I have to provide a relative to
current x/y scaling, don't use \glyphscale as that one is used by
context itself
- we use the style variant so that it adapts
- you have to replace "Serif" with "YourFont" and map that one onto a
file (YourFont YourFontBold etc)
- more about these box manipulations in the low level manual

Ok. Just discovered the 11 low-level manuals yesterday, not sure which one to 
focus on in this case -)
\startsetups glyph:iTee
\dontleavehmode\hpack\bgroup
\setbox\scratchbox \ruledhbox \bgroup
\glyphxscale 400
\glyphyscale 400
\getglyphstyled{Serif}{T}% choose a font here
\egroup
\scratchheight 2.75\ht\scratchbox
\boxyoffset \scratchbox\scratchheight
\boxorientation\scratchbox\plustwo
\ht \scratchbox\scratchheight
\box\scratchbox
\egroup
\stopsetups

\definesymbol
[iTee]
[\directsetup{glyph:iTee}]

\startTEXpage [offset=1ts,width=2cm]
\ruledhbox {\tfx T \symbol{iTee}} \par
\ruledhbox {T \symbol{iTee}} \par
\ruledhbox {\tfa T \symbol{iTee}} \par
\ruledhbox {\bfd T \symbol{iTee}}
\stopTEXpage

Great, will study this. The challenge (for me) will be integrating this 
approach into the lua definitions of the two needed characters. With 
\defineactivecharacter deprecated, there seems to be no way other than CLD to 
make and register the needed macro for \definefontfeature -- and we want to 
move forward with the new regime and not look back.

With many thanks and much gratitude, Hans.

Best wishes
Idris

--
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523


transliteration--glottal-lua.pdf
Description: transliteration--glottal-lua.pdf


transliteration--glottal-lua.tex
Description: transliteration--glottal-lua.tex
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Pass string into text background graphic

2023-08-12 Thread Thangalin
Thanks Hans.

The \newinteger approach would always increment the value, regardless of
conditionals within the MetaPost code (i.e., it was like legend :=
"\ConcurrentTextGet" would always invoke the macro just be referencing the
MPgraphic and nothing would prevent its execution). This meant that the Get
indexes would not correspond to the Set indexes. Switching to \definenumber
resolved the issue. There were a few other oddities, such as the "Get"
counter incrementing twice. Here's the code:

\definenumber[ConcurrentTextSetCounter][prefix=no]
\definenumber[ConcurrentTextGetCounter][prefix=no]

\setnumber[ConcurrentTextSetCounter][0]
\setnumber[ConcurrentTextGetCounter][0]

% Map each label as global key/value pairs.
\def\ConcurrentTextSet#1{%
  \incrementnumber[ConcurrentTextSetCounter]%
  \setxvariable
{concurrent}
{text:\rawcountervalue[ConcurrentTextSetCounter]}
{#1}}

% Account for the counter incrementing twice and the index being 1-based.
\def\ConcurrentTextGet{%
  \incrementnumber[ConcurrentTextGetCounter]%
  \getvariable
{concurrent}

{text:\number\numexpr1+\rawcountervalue[ConcurrentTextGetCounter]/2\relax}}

\startuseMPgraphic{GraphicConcurrent}
  numeric index;
  index := 1;

  % Differentiate between new text blocks and those crossing pages.
  if (multikind[ index ] = "single") or (multikind[ index ] = "first"):
string legend;
legend := "\ConcurrentTextGet";

% For new text blocks, write the title.
picture p;
p := textext.rt( legend )
  shifted ulcorner multipars[ index ]
  shifted (1cm, 0);

% Draw the horizontal rule only for the initial text block.
draw
  ulcorner multipars[ index ] shifted (1mm + xpart lrcorner p, 0) --
  urcorner multipars[ index ];

% Draw the vertical rule for the initial text block.
draw
  llcorner multipars[ index ] --
  ulcorner multipars[ index ] --
  ulcorner multipars[ index ] shifted (9mm, 0);

draw p;
  else:
% Draw only the vertical rule only when crossing page boundaries.
draw
  llcorner multipars[ index ] --
  ulcorner multipars[ index ];
  fi
\stopuseMPgraphic

\definetextbackground[TextConcurrentFrame][
  mp=GraphicConcurrent,
  frame=off,
  topoffset=1em,
  leftoffset=1em,
  before=\blank[2*big],
  after=\blank,
  location=paragraph,
]

\startsetups concurrent:before
  \ConcurrentTextSet{%
% Be sure to format "a.m." and other special phrases.
\expandafter\TextReplacement{%
  \xmlatt{\getvariable{div}{concurrent}}{data-title}%
    }
  }
  \startTextConcurrentFrame
\stopsetups

\startsetups concurrent:after
  \stopTextConcurrentFrame
\stopsetups

\definestartstop[concurrent][
  before=\directsetup{concurrent:before},
  after=\directsetup{concurrent:after}
]

This allows for typesetting a wider range of pandoc-style Markdown
annotations, such as:

::: {.concurrent title="Terminal Berth 5, 3:17 a.m."}
text goes here
:::

With these changes, the titles now only appear at the start of the
demarcated text, in any combination of "concurrent" annotation instances
spanning any number of pages.

Much appreciated.

Cheers!
P.S.
The following line requires KeenWrite themes:

\expandafter\TextReplacement{ ... }

For details, see:

   -
   https://github.com/DaveJarvis/keenwrite-themes/blob/main/xhtml/xml-blocks.tex
   -
   https://github.com/DaveJarvis/keenwrite-themes/blob/main/boschet/replace.tex


concurrent.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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Scaling characters without font switching in CLD

2023-08-12 Thread Hans Hagen

On 8/12/2023 4:03 PM, Hamid,Idris wrote:


\tfx causes a switch to computer modern.


Indeed. Something I need to discuss with Wolfgang as double checking is 
needed before I patch.



But what if we want to scale independently of font switching?
There is no need to go lua here (esp when you have not done vf magick 
before and i'm not going to debug code that i have little clue what it's 
about to do).


- we cheat here and yuse glyph scaled (I have to provide a relative to 
current x/y scaling, don't use \glyphscale as that one is used by 
context itself

- we use the style variant so that it adapts
- you have to replace "Serif" with "YourFont" and map that one onto a 
file (YourFont YourFontBold etc)

- more about these box manipulations in the low level manual

\startsetups glyph:iTee
\dontleavehmode\hpack\bgroup
\setbox\scratchbox \ruledhbox \bgroup
\glyphxscale 400
\glyphyscale 400
\getglyphstyled{Serif}{T}% choose a font here
\egroup
\scratchheight 2.75\ht\scratchbox
\boxyoffset\scratchbox\scratchheight
\boxorientation\scratchbox\plustwo
\ht\scratchbox\scratchheight
\box\scratchbox
\egroup
\stopsetups

\definesymbol
  [iTee]
  [\directsetup{glyph:iTee}]

\startTEXpage [offset=1ts,width=2cm]
\ruledhbox {\tfx T \symbol{iTee}} \par
\ruledhbox {T  \symbol{iTee}} \par
\ruledhbox {\tfa T \symbol{iTee}} \par
\ruledhbox {\bfd T \symbol{iTee}}
\stopTEXpage

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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Pass string into text background graphic

2023-08-11 Thread Hans Hagen
stopuseMPgraphic

% Watch how i moved the before/after blanks here:

\definetextbackground
  [TextConcurrentFrame]
  [mp=GraphicConcurrent,
 % mp=mpos:region:draw,
   method=mpos:region,
   frame=off,
   topoffset=1em,
   leftoffset=1em,
   before=\blank[2*big],
   after=\blank,
   location=paragraph]

% And use setups to get a nicer definition:

\startsetups concurrent:before
\ConcurrentTextSet{\xmlatt{\getvariable{div}{concurrent}}{data-title}}
    \startTextConcurrentFrame
\stopsetups

\startsetups concurrent:after
\stopTextConcurrentFrame
\stopsetups

\definestartstop
  [concurrent]
  [before=\directsetup{concurrent:before},
   after=\directsetup{concurrent:after}]

One problem with variables is that currently we cannot bind a "current" 
value so I need to think a bit about it. Maybe the solution here, a bit 
more robust is one. One can actually pass variables with a graphic but 
again, these are then overwritten by a later one.


In lmtx we have a few better tex-mp communication tricks but these are 
not yet documented in the manual. Contrary to mkii (intermediate as well 
as runtime processing) and mkiv (runtime two pass in a run processing) 
we can make some interfaces a bit simpler in mkxl but that happens 
stepwise because we need to remain compatible. Much of the positional 
graphic trickery is stil a bit mkii-ish in nature (where we had more mem 
and runtime constraints).


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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: upload

2023-08-10 Thread Thangalin
Did arguments regress in 2023.08.10 02:59?

$ cat u.tex
\starttext
Feisty arguments
\stoptext
$ context u.tex
$  ls -la *.pdf
-rw-r--r-- 1 username username 6279 Aug 10 18:28 u.pdf
$ context --arguments=x=y u.tex | grep error
tex error   > tex error on line 13 in file : Use of \getrawparameters
doesn't match its definition
mtx-context | fatal error: return code: 1

This was working with the previous release.

On Wed, Aug 9, 2023 at 8:43 AM Hans Hagen  wrote:

> Hi,
>
> I uploaded a new lmtx. There are some new features that wil be revealed
> in the future (likely after the meeting) but here is one:
>
> \starttext
>
>  \defineoverlay
>[test]
>[\color
>   [blue]
>   {TEST
>\inframed
>  [foregroundcolor=red]
>  {xxx}
>TEST}]
>
>  \framed
>[background=test,
> foregroundstyle=\switchtobodyfont[small]]
>{test}
>
> \stoptext
>
>  From now on many commands accept (properly) nested [] inside commands
> that use [] as fences (like the setup commands) where it makes sense. It
> is up to the user to decide to use {} (as before) or not but it is less
> error prone.
>
> It is now also possible to nest setups as in
>
> \starttext
>
> \startsetups one
>  \startsetups [three]
>  HERE
>  \stopsetups
> \stopsetups
>
> \startsetups two
>  \startsetups [three]
>  THERE
>  \stopsetups
> \stopsetups
>
> \setups[one] \setups[three]
>
> \setups[two] \setups[three]
>
> \stoptext
>
> As part of the ongoing improvements on math rendering we added some
> classic lm/cm kerns (between upperacse and periods / commas) in the
> goodie files.
>
> Some lowlevel manuals have been extended, explaining experimental 'named
> cross macro nesting parameter referencing' and 'constrained cq. retained
> assignments', but that is only relevant for those interested in
> overcoming some limitations in the traditional engines.
>
> 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://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] upload

2023-08-09 Thread Hans Hagen

Hi,

I uploaded a new lmtx. There are some new features that wil be revealed 
in the future (likely after the meeting) but here is one:


\starttext

\defineoverlay
  [test]
  [\color
 [blue]
 {TEST
  \inframed
[foregroundcolor=red]
{xxx}
  TEST}]

\framed
  [background=test,
   foregroundstyle=\switchtobodyfont[small]]
  {test}

\stoptext

From now on many commands accept (properly) nested [] inside commands 
that use [] as fences (like the setup commands) where it makes sense. It 
is up to the user to decide to use {} (as before) or not but it is less 
error prone.


It is now also possible to nest setups as in

\starttext

\startsetups one
\startsetups [three]
HERE
\stopsetups
\stopsetups

\startsetups two
\startsetups [three]
THERE
\stopsetups
\stopsetups

\setups[one] \setups[three]

\setups[two] \setups[three]

\stoptext

As part of the ongoing improvements on math rendering we added some 
classic lm/cm kerns (between upperacse and periods / commas) in the 
goodie files.


Some lowlevel manuals have been extended, explaining experimental 'named 
cross macro nesting parameter referencing' and 'constrained cq. retained 
assignments', but that is only relevant for those interested in 
overcoming some limitations in the traditional engines.


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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Par Builder Tests

2023-07-28 Thread Keith McKay

Hi all!

Using the example below I have completed a test using a larger book. 
This time I downloaded War and Peace from the Gutenberg Project and 
extracted the individual xhtml files for Context.


I played around with the setups for the align:pass:test4 code below, as 
Hans suggested, and it was changing the \tolerance value which made the 
difference. Increasing the \tolerance value to 1000 eliminated all 
overfull hboxes but still left 79 underfull hboxes. I continued to 
increase the \tolerance value up to 6600 and was left with two overfull 
hboxes. One with a badness of 6641 (warAndPeace1.png) and one with a 
badness of 1097 (warAndPeace2.png). Above the \tolerance of 6600 only 
warAndPeace2.png was left with a badness of 1097. Both of these 
underfull hboxes were at the beginning of a paragraph - "To his Honor" 
in the first png and "Well, you see," in the second png. I not sure a 
reader would spot the second png badness but the first is noticeable to 
my eyes.


I'm very pleased how the book has turned out, all 1668 pages of it as an 
approximately 13cm by 20cm book. The pdf is 4MB and each run in ConTeXt 
takes about 10 seconds on my M1 mac mini.


I'm interested in seeing how \setupalignpass develops and learning more 
of how to use it.


Best Wishes

Keith McKay

On 21/07/2023 17:33, Keith McKay wrote:

Thanks Hans!

I'll have a play and keep an eye on updates

Best Wishes

Keith

On 21/07/2023 17:10, Hans Hagen via ntg-context wrote:

Hi Keith,

Here an example that Mikael made for such a book:

\showframe

% let's very strict

\startsetups [*default]

    \directsetup{*reset}

    \frozen\widowpenalty    1
    \frozen\clubpenalty 1
    \frozen\displaywidowpenalty 1
    \frozen\brokenpenalty   0 % \defaultbrokenpenalty

\stopsetups

% we enable the use of expansion (this feature might become preset
% because we now delay setting the vectors anyway so less overhead)

\definefontfeature
  [default]
  [default]
  [expansion=quality,
   protrusion=quality,
   itlc=yes]

% vertical expansion

\setuplayout
  [vz=2]

% for which we need:

% \setupalign[hanging,depth,stretch,granular]

\setupalign[depth,stretch,granular]

% here are the passes:

\startsetups align:pass:test4
    \pretolerance 100
    \tolerance    200
    \parpasses    4
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink    5
    adjustspacingstretch  10
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   10
    adjustspacingstretch  20
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   25
    adjustspacingstretch  50
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   50
    adjustspacingstretch 100
    \relax
\stopsetups

\setupalignpass[test4]

\starttext
    ...
\stoptext

(work in progress so keep an eye on updates)

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://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Par Builder Tests

2023-07-21 Thread Keith McKay

Thanks Hans!

I'll have a play and keep an eye on updates

Best Wishes

Keith

On 21/07/2023 17:10, Hans Hagen via ntg-context wrote:

Hi Keith,

Here an example that Mikael made for such a book:

\showframe

% let's very strict

\startsetups [*default]

    \directsetup{*reset}

    \frozen\widowpenalty    1
    \frozen\clubpenalty 1
    \frozen\displaywidowpenalty 1
    \frozen\brokenpenalty   0 % \defaultbrokenpenalty

\stopsetups

% we enable the use of expansion (this feature might become preset
% because we now delay setting the vectors anyway so less overhead)

\definefontfeature
  [default]
  [default]
  [expansion=quality,
   protrusion=quality,
   itlc=yes]

% vertical expansion

\setuplayout
  [vz=2]

% for which we need:

% \setupalign[hanging,depth,stretch,granular]

\setupalign[depth,stretch,granular]

% here are the passes:

\startsetups align:pass:test4
    \pretolerance 100
    \tolerance    200
    \parpasses    4
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink    5
    adjustspacingstretch  10
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   10
    adjustspacingstretch  20
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   25
    adjustspacingstretch  50
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   50
    adjustspacingstretch 100
    \relax
\stopsetups

\setupalignpass[test4]

\starttext
    ...
\stoptext

(work in progress so keep an eye on updates)

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://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Par Builder Tests

2023-07-21 Thread Hans Hagen via ntg-context

Hi Keith,

Here an example that Mikael made for such a book:

\showframe

% let's very strict

\startsetups [*default]

\directsetup{*reset}

\frozen\widowpenalty1
\frozen\clubpenalty 1
\frozen\displaywidowpenalty 1
\frozen\brokenpenalty   0 % \defaultbrokenpenalty

\stopsetups

% we enable the use of expansion (this feature might become preset
% because we now delay setting the vectors anyway so less overhead)

\definefontfeature
  [default]
  [default]
  [expansion=quality,
   protrusion=quality,
   itlc=yes]

% vertical expansion

\setuplayout
  [vz=2]

% for which we need:

% \setupalign[hanging,depth,stretch,granular]

\setupalign[depth,stretch,granular]

% here are the passes:

\startsetups align:pass:test4
\pretolerance 100
\tolerance200
\parpasses4
classes  \indecentparpassclasses
threshold0.025pt
adjustspacing  3
adjustspacingstep  1
adjustspacingshrink5
adjustspacingstretch  10
next
classes  \indecentparpassclasses
threshold0.025pt
adjustspacing  3
adjustspacingstep  1
adjustspacingshrink   10
adjustspacingstretch  20
next
classes  \indecentparpassclasses
threshold0.025pt
adjustspacing  3
adjustspacingstep  1
adjustspacingshrink   25
adjustspacingstretch  50
next
classes  \indecentparpassclasses
threshold0.025pt
adjustspacing  3
adjustspacingstep  1
adjustspacingshrink   50
adjustspacingstretch 100
\relax
\stopsetups

\setupalignpass[test4]

\starttext
...
\stoptext

(work in progress so keep an eye on updates)

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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Par Builder Tests

2023-07-21 Thread Hans Hagen

On 7/21/2023 5:34 PM, Keith McKay wrote:

Hi all,

At the end of June, Hans uploaded a new lmtx version which included 
improvements to par building which he and Mikael had been working on in 
math mode. Hans suggested in the online chat that these improvements may 
be useful in typesetting novels. I was keen to try these since I have 
typset novels in the past.


I have ran some tests on two novels which I downloaded from the 
Gutenberg Project site as epubs and extracted them to get the original 
xhtml files which I then typeset in context. I made very little in the 
way of changes to the files so that my setup for xml was very simple.


Here are my setups for the layout of the novels showing some trackers 
that were used as well:


\definepapersize[pagee][width=5.06in,height=7.81in]
\setuppapersize[pagee]
% XML setups here
\startsetups[grid][mypenalties]
\setdefaultpenalties
\setpenalties\widowpenalties{1}{150}
\setpenalties\clubpenalties {1}{150}
\stopsetups
\setuplayout[
width=10cm,
topspace=0.5in,
backspace=2.0cm,
header=7.5mm,
footer=0.25in,
location={middle,middle},
vs=2,
grid=yes,
setups=mypenalties
]
%\enabletrackers[makeup]
%\enabletrackers[builders.hpack.quality]
\enabletrackers[builders.hpack.overflow]
%\enabletrackers[layout.vz]
%\enabletrackers[paragraphs.passes]
\enabletrackers[paragraphs.passes=summary]
%\enabletrackers[paragraphs.passes=details]
\setupalign[granular]
%\setupalign[nothyphenated,hz,verytolerant]
%\setupalign[vertical,height]
%\setupalignpass[decent]
%\setupalignpass[quality]
%\setupalignpass[test1]
\setupalignpass[test2]
%\setupalignpass[test3]
%\setupalignpass[test4]
%\setupalignpass[test5]
%\setupalignpass[optional1]
%\setupalignpass[test2b]
\starttext
\setuppagenumbering[location={footer,middle},alternative=doublesided,state=start]
\setcounter[userpage][1]
%\showmakeup[vbox]
%\showlayout
\dostepwiserecurse{0}{30}{1}{
\xmlprocessfile{mysetups}{/path to xhtml 
files/4439720318703948998_84-h-\recurselevel.htm.xhtml}{}

}
\stoptext

Below are the result showing the number of overfull boxes for these 
novels using the setups in the file spac-imp-tests.mkxl . See the manual 
Low Level - Lines


Test    Novel1   Novel2
Test1    70    35
Test2    30    8
Test3    62    23
Test4    89    40
Test5    28    9
Optional1 55    19
Quality  74    32
Decent  39    11

 From these initial tests one can see that Test2 gave the lowest number 
of overfull boxes. So I edited test two, ran it, and the results are below.


Test    Novel1   Novel2

Test2b  11    0

My setup for test 2b is as follows:
\startsetups align:pass:test2b
     \pretolerance 100
     \tolerance    200
     \parpasses  3
     classes  \indecentparpassclasses
     threshold    0.025pt
     tolerance    800
     extrahyphenpenalty    50
   next
     threshold    0.025pt
     tolerance    900
     adjustspacing  3
     adjustspacingstep  1
     adjustspacingshrink   10
     adjustspacingstretch  15
     next
     threshold    0.025pt
     tolerance    1000
     adjustspacing  3
     adjustspacingstep  1
     adjustspacingshrink   20
     adjustspacingstretch  40
     emergencystretch .25\bodyfontsize
     \relax
% \linebreakpasses\plusone
\stopsetups
The only difference between test 2 and 2b are that I increased the 
tolerance in each of the three passes.
In novel 2 this was successful in eliminating the overfull boxes but not 
in Novel 1 although I noticed that majority of overfull boxes were above 
1pt with the largest about 12pt in Novel 1.


I am at the stage now where I need some kind of strategy to 
reduce/eliminate overfull boxes, other than changing the tolerance, and 
I'm hoping for some advice from the community. Suggestions for further 
reading particularly on the commands in \setupalignpass and their usage 
would be appreciated and on the best way to tackle overfull boxes.
you're too tolerant (stick to 200), you can even start out with 
pretolerance 50 and tolerance 150 and then in the passes 200


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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Par Builder Tests

2023-07-21 Thread Keith McKay

Hi all,

At the end of June, Hans uploaded a new lmtx version which included 
improvements to par building which he and Mikael had been working on in 
math mode. Hans suggested in the online chat that these improvements may 
be useful in typesetting novels. I was keen to try these since I have 
typset novels in the past.


I have ran some tests on two novels which I downloaded from the 
Gutenberg Project site as epubs and extracted them to get the original 
xhtml files which I then typeset in context. I made very little in the 
way of changes to the files so that my setup for xml was very simple.


Here are my setups for the layout of the novels showing some trackers 
that were used as well:


\definepapersize[pagee][width=5.06in,height=7.81in]
\setuppapersize[pagee]
% XML setups here
\startsetups[grid][mypenalties]
\setdefaultpenalties
\setpenalties\widowpenalties{1}{150}
\setpenalties\clubpenalties {1}{150}
\stopsetups
\setuplayout[
width=10cm,
topspace=0.5in,
backspace=2.0cm,
header=7.5mm,
footer=0.25in,
location={middle,middle},
vs=2,
grid=yes,
setups=mypenalties
]
%\enabletrackers[makeup]
%\enabletrackers[builders.hpack.quality]
\enabletrackers[builders.hpack.overflow]
%\enabletrackers[layout.vz]
%\enabletrackers[paragraphs.passes]
\enabletrackers[paragraphs.passes=summary]
%\enabletrackers[paragraphs.passes=details]
\setupalign[granular]
%\setupalign[nothyphenated,hz,verytolerant]
%\setupalign[vertical,height]
%\setupalignpass[decent]
%\setupalignpass[quality]
%\setupalignpass[test1]
\setupalignpass[test2]
%\setupalignpass[test3]
%\setupalignpass[test4]
%\setupalignpass[test5]
%\setupalignpass[optional1]
%\setupalignpass[test2b]
\starttext
\setuppagenumbering[location={footer,middle},alternative=doublesided,state=start]
\setcounter[userpage][1]
%\showmakeup[vbox]
%\showlayout
\dostepwiserecurse{0}{30}{1}{
\xmlprocessfile{mysetups}{/path to xhtml 
files/4439720318703948998_84-h-\recurselevel.htm.xhtml}{}

}
\stoptext

Below are the result showing the number of overfull boxes for these 
novels using the setups in the file spac-imp-tests.mkxl . See the manual 
Low Level - Lines


Test    Novel1   Novel2
Test1    70    35
Test2    30    8
Test3    62    23
Test4    89    40
Test5    28    9
Optional1 55    19
Quality  74    32
Decent  39    11

From these initial tests one can see that Test2 gave the lowest number 
of overfull boxes. So I edited test two, ran it, and the results are below.


Test    Novel1   Novel2

Test2b  11    0

My setup for test 2b is as follows:
\startsetups align:pass:test2b
    \pretolerance 100
    \tolerance    200
    \parpasses  3
    classes  \indecentparpassclasses
    threshold    0.025pt
    tolerance    800
    extrahyphenpenalty    50
  next
    threshold    0.025pt
    tolerance    900
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   10
    adjustspacingstretch  15
    next
    threshold    0.025pt
    tolerance    1000
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   20
    adjustspacingstretch  40
    emergencystretch .25\bodyfontsize
    \relax
% \linebreakpasses\plusone
\stopsetups
The only difference between test 2 and 2b are that I increased the 
tolerance in each of the three passes.
In novel 2 this was successful in eliminating the overfull boxes but not 
in Novel 1 although I noticed that majority of overfull boxes were above 
1pt with the largest about 12pt in Novel 1.


I am at the stage now where I need some kind of strategy to 
reduce/eliminate overfull boxes, other than changing the tolerance, and 
I'm hoping for some advice from the community. Suggestions for further 
reading particularly on the commands in \setupalignpass and their usage 
would be appreciated and on the best way to tackle overfull boxes.


Best Wishes

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] definedocument, begin & closing

2023-07-06 Thread Henning Hraban Ramm

Hi,
if I use \startdocument, the setups "document:start" and "document:stop" 
get inserted at the beginning and end. But if I define my own document, 
it doesn’t work. What’s wrong?


"""
\definedocument[presentation]

\startsetups[presentation:start]
{\bfd\documentvariable{title}}
\stopsetups

\startsetups[presentation:stop]
Thanks for all the fish.

\stopsetups


\startpresentation[title=Something]

anything

\stoppresentation
"""

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

Re: [NTG-context] right and left arrowfill

2023-06-23 Thread Carlos via ntg-context
On Fri, Jun 23, 2023 at 01:38:23PM +0200, Hans Hagen via ntg-context wrote:
> On 6/23/2023 12:43 PM, Carlos via ntg-context wrote:
> > On Thu, Jun 22, 2023 at 03:32:25PM +0200, Hans van der Meer via ntg-context 
> > wrote:
> > > \starttext
> > > x \rightarrowfill x
> > > 
> > > x \leftarrowfill x
> > > 
> > > hbox to 5cm:
> > > 
> > > y\hbox to5cm{\rightarrowfill}y
> > > 
> > > y\hbox to5cm{\leftarrowfill}y
> > > \stoptext
> > > 
> > > But obviously not in an dimensioned \hbox, whereas Knuth's version does 
> > > that too.
> > > 
> > > 
> > > 
> > > > On 22 Jun 2023, at 15:11, Hans Hagen via ntg-context 
> > > >  wrote:
> > > > 
> > > > x \rightarrowfill x
> > > > 
> > > > x \leftarrowfill x
> > > 
> > > yours sincerely
> > > dr. Hans van der Meer
> > > 
> > > 
> > 
> > I find this interesting. I agree with Hans vdM.
> > 
> > So what would be the acceptable standard given an x length of a glue?
> > 
> > In the above examples, it's all preset.
> > 
> > Is a rule of thumb — no pun intended here — to apply thereafter
> > a glue, in this case a \vrule that follows the box and precedes the
> > other glue? that is, the \rightarrowfill or \leftarrowfill?
> > 
> > I mean. Once you get the glues messed up, the whole box crumbles.
> 
> I'm not sure how you can mess up glue so that the box is no longer a box.
> Boxes remain boxes.

I guess that's the same mentality behind a fixed glue in LMTX, while
trying not to mess up the box. Back to point A and the main reason of the
op's question. 

Then again, the only way to resemble what TeX does is by re/defining
and copied verbatim from The TeXbook  both rightarrowfill and
leftarrowfill

and unlike with TeX in which an 

\hbox to 1in{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule} 

it says 1cm but it'd be more than that, and accurately so 


> 
> > How good would \meaning be here, notwithstanding the valuable info of
> > the macro it provides, if it can't print out, let alone source it up,
> > the more accurate dimension, let alone the measurement.
> 
> I don't follow. Does this come from ChapGPT?
> 

That's funny. 

But as chatgpt says:
"Sorry about that. \meaning\rightarrowfill is 
\begingroup \scratchunicode 8594\relax \adaptivebox [mathfiller][alterna­
tive=8594]{\hss \strut \hss }\endgroup "

That's what lmtx returned after Hans vdM sample


> > So, one would need to know the preset layout of the page to have an idea
> > about it?
> > 
> > Hans H. pulled the old modified trick of 'works here'.
> 
> Well, when used in a paragraph it works indeed. No trick involved. But as it
> uses a specific mechanism in an hbox you need to trigger that (unless you
> want to add overhead that will kake tex crawl).
> 
> > Like a magician… now all of a sudden evetything works, but unlike TeX's
> 
> Not sure what this refers to. Much of TeX is magick but what is bad about
> that?
> 
> > \hbox to 1in{\vrule \rightarrowfill \ 1in \leftarrowfill\vrule}
> > 
> > or
> > 
> > \hbox to 1cm{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule}
> > 
> > which gives an accurate description, not to mention measurement,
> 
> It depends on what you expect. First of all, your assumption that the arrow
> fill is the same as in plain tex is wrong.

Why would it be wrong? 

When I type 

\hbox to 3cm{\rightarrowfill} without a vrule

that's what I would normally expect


> 
> (1) one can define an arrow fill using a leader that uses some (happen to be
> present in tex math fonts) glyphs: repeated minuses followed by some magic
> kern and an arrow head.
> 

Can you apply it to pagination without breaking? 

Highly doubt it.


> (2) You can hope that the magick kern is right and that the minus aligns
> with the arrows bar.
> 
> (3) You also assume that the math font matches the text font.
> 
> (4) Normally an arrow fill is something math anyway. Where there can also be
> something on top or below, or where it can be a top or bottom accent.
> 
> > a
> > 
> > \vbox to 5pt{x\vrule\rightarrowfill \ x \leftarrowfill\vrule\ x}
> > 
> > or
> > 
> > x \rightarrowfill x
> > x \leftarrowfill x
> > 
> > or
> > 
> > \vbox to 3pt{x\vrule\rightarrowfill \  \leftarrowfill\vrule\ x}
> > 
> > \ \rightarrowfill \
> > \ \leftarrowfill \
> > 
> > 
> > in LMTX doesn't say much
> What should it say? You get a space, an arrow and a disc

Re: [NTG-context] right and left arrowfill

2023-06-23 Thread Hans Hagen via ntg-context

On 6/23/2023 12:43 PM, Carlos via ntg-context wrote:

On Thu, Jun 22, 2023 at 03:32:25PM +0200, Hans van der Meer via ntg-context 
wrote:

\starttext
x \rightarrowfill x

x \leftarrowfill x

hbox to 5cm:

y\hbox to5cm{\rightarrowfill}y

y\hbox to5cm{\leftarrowfill}y
\stoptext

But obviously not in an dimensioned \hbox, whereas Knuth's version does that 
too.




On 22 Jun 2023, at 15:11, Hans Hagen via ntg-context  wrote:

x \rightarrowfill x

x \leftarrowfill x


yours sincerely
dr. Hans van der Meer




I find this interesting. I agree with Hans vdM.

So what would be the acceptable standard given an x length of a glue?

In the above examples, it's all preset.

Is a rule of thumb — no pun intended here — to apply thereafter
a glue, in this case a \vrule that follows the box and precedes the
other glue? that is, the \rightarrowfill or \leftarrowfill?

I mean. Once you get the glues messed up, the whole box crumbles.


I'm not sure how you can mess up glue so that the box is no longer a 
box. Boxes remain boxes.



How good would \meaning be here, notwithstanding the valuable info of
the macro it provides, if it can't print out, let alone source it up,
the more accurate dimension, let alone the measurement.


I don't follow. Does this come from ChapGPT?


So, one would need to know the preset layout of the page to have an idea
about it?

Hans H. pulled the old modified trick of 'works here'.


Well, when used in a paragraph it works indeed. No trick involved. But 
as it uses a specific mechanism in an hbox you need to trigger that 
(unless you want to add overhead that will kake tex crawl).



Like a magician… now all of a sudden evetything works, but unlike TeX's


Not sure what this refers to. Much of TeX is magick but what is bad 
about that?



\hbox to 1in{\vrule \rightarrowfill \ 1in \leftarrowfill\vrule}

or

\hbox to 1cm{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule}

which gives an accurate description, not to mention measurement,


It depends on what you expect. First of all, your assumption that the 
arrow fill is the same as in plain tex is wrong.


(1) one can define an arrow fill using a leader that uses some (happen 
to be present in tex math fonts) glyphs: repeated minuses followed by 
some magic kern and an arrow head.


(2) You can hope that the magick kern is right and that the minus aligns 
with the arrows bar.


(3) You also assume that the math font matches the text font.

(4) Normally an arrow fill is something math anyway. Where there can 
also be something on top or below, or where it can be a top or bottom 
accent.



a

\vbox to 5pt{x\vrule\rightarrowfill \ x \leftarrowfill\vrule\ x}

or

x \rightarrowfill x
x \leftarrowfill x

or

\vbox to 3pt{x\vrule\rightarrowfill \  \leftarrowfill\vrule\ x}

\ \rightarrowfill \
\ \leftarrowfill \


in LMTX doesn't say much

What should it say? You get a space, an arrow and a discarded space.

That said: I think you miss a few points here:

(1) I know Hans vd Meer well and he knows ConTeXt well. He's quite 
capable of figuring out how to use advanced features and I bet he likes 
the following variant of arrows in text. Next time we meet I'll show him 
some more adaptive tricks (although I bet he can figure them out himself).


\starttext

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

% \startsetups adaptive:test
% \setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset 
-\usedadaptivedepth \bgroup

% \externalfigure
%   [cow.pdf]
%   [width=\usedadaptivewidth,
%height=\dimexpr\usedadaptiveheight+\usedadaptivedepth\relax]%
%\egroup
% \stopsetups

\startsetups adaptive:test
\setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset .25ex 
\bgroup

\startMPcode
drawarrow ((0,0) -- (\the\usedadaptivewidth,0)) randomized 
(ExHeight/2);

\stopMPcode
   \egroup
\stopsetups

\dorecurse{5}{
\dostepwiserecurse{1}{150}{1}{%
this~#1.##1 is~#1.##1 test~#1.##1
{\adaptivebox[strut=yes,setups=adaptive:test]{\strut}}
}
\blank
}

\stoptext

(2) If someone wants a plain (or fot that matter latex) solution then 
one can use these macro packages or write a macro that mimicks 
expectations.


(3) I don't like "Hans H. pulled the old modified trick of 'works 
here'." kind of remarks because they have a rather negative undertone 
and I don't know how to read that.



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://

Re: [NTG-context] Chinese typesetting with macOS font. Which one is a good choice?

2023-06-04 Thread 李延瑞
Gerben Wierda via ntg-context  于2023年6月2日周五 19:37写道:

> For Japanese I currently use
>
> \startsetups [japanese]
>   \setscript [nihongo]
> \stopsetups
> \setuplanguage [ja] [setups=japanese]
> \definefallbackfamily
>   [archimate]
>   [ss]
>   [Hiragino Sans]
>   [preset=range:japanese,
>tf=style:W3,
>it=style:W3,
>bf=style:W5,
>bi=style:W5,
>force=yes]
> \definefontfamily [archimate] [ss] [Optima]
> \setupbodyfont[archimate]
>
> I've been wondering what a good choice is for Chinese which is to be added
> to my project. Hiragino Sans GB has both Japanese and Chinese but only W3,W6
>
> I have no knowledge of what is elegant in these fonts. Can someone advise
> me? No bitmap fonts.
>
>
There are Noto Serif/Sans CJK fonts (including HK/JP/KR/SC/TC ) developed
by Google. But I don't know how to mix them with Hiraginfo Sans GB.

-- 
Best regards,

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Chinese typesetting with macOS font. Which one is a good choice?

2023-06-02 Thread Gerben Wierda via ntg-context
For Japanese I currently use

\startsetups [japanese]
  \setscript [nihongo]
\stopsetups
\setuplanguage [ja] [setups=japanese]
\definefallbackfamily
  [archimate]
  [ss]
  [Hiragino Sans]
  [preset=range:japanese,
   tf=style:W3,
   it=style:W3,
   bf=style:W5,
   bi=style:W5,
   force=yes]
\definefontfamily [archimate] [ss] [Optima]
\setupbodyfont[archimate]

I've been wondering what a good choice is for Chinese which is to be added to 
my project. Hiragino Sans GB has both Japanese and Chinese but only W3,W6

I have no knowledge of what is elegant in these fonts. Can someone advise me? 
No bitmap fonts.

Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>, Mastodon 
<https://newsie.social/@gctwnl>)
R IT Strategy <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Flushright problems with Japanese

2023-05-16 Thread Gerben Wierda via ntg-context
That does not make a difference.

Output of both lines

\framed[width=\textwidth,frame=off,align=flushright]{作図:A bit of text}
\framed[width=\textwidth,frame=off,align=flushright,broad]{作図:A bit of text}

is identical.

Gerben 

> On 16 May 2023, at 03:36, Li Yanrui (李延瑞) via ntg-context 
>  wrote:
> 
> 
> 
> Gerben Wierda via ntg-context  <mailto:ntg-context@ntg.nl>> 于2023年5月15日周一 16:43写道:
> When I use flushright, my Japanese characters get widely spaced as if 
> flushing right doesn't work
> 
> Minimal example:
> 
> % ===
>  \definefallbackfamily
>   [archimate]
>   [ss]
>   [Hiragino Sans]
>   [preset=range:japanese,
>tf=style:W3,
>it=style:W3,
>bf=style:W5,
>bi=style:W5,
>force=yes]
> 
> \definefontfamily [archimate] [ss] [Optima]
> 
> \setupbodyfont[archimate]
> 
> \startsetups [japanese]
>   \setscript [nihongo]
> \stopsetups
> \setuplanguage [ja] [setups=japanese]
> \mainlanguage [ja]
> 
> \starttext
> \setupindenting[none]
> \setupindenting[no]
> \framed[width=\textwidth,frame=off,align=flushleft]{作図:A bit of text}
> \framed[width=\textwidth,frame=off,align=flushright]{作図:A bit of text}
> \framed[width=\textwidth,frame=off,align=flushright]{作図: A bit of text}
> \framed[width=\textwidth,frame=off]{作図: A bit of text}
> \stoptext
> % ===
> 
> 
> Hi,
> 
> You can try `align={flushright,broad}'. 
> 
> -- 
> Best regards,
> 
> Li Yanrui
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Flushright problems with Japanese

2023-05-15 Thread 李延瑞
Gerben Wierda via ntg-context  于2023年5月15日周一 16:43写道:

> When I use flushright, my Japanese characters get widely spaced as if
> flushing right doesn't work
>
> Minimal example:
>
> % ===
>  \definefallbackfamily
>   [archimate]
>   [ss]
>   [Hiragino Sans]
>   [preset=range:japanese,
>tf=style:W3,
>it=style:W3,
>bf=style:W5,
>bi=style:W5,
>force=yes]
>
> \definefontfamily [archimate] [ss] [Optima]
>
> \setupbodyfont[archimate]
>
> \startsetups [japanese]
>   \setscript [nihongo]
> \stopsetups
> \setuplanguage [ja] [setups=japanese]
> \mainlanguage [ja]
>
> \starttext
> \setupindenting[none]
> \setupindenting[no]
> \framed[width=\textwidth,frame=off,align=flushleft]{作図:A bit of text}
> \framed[width=\textwidth,frame=off,align=flushright]{作図:A bit of text}
> \framed[width=\textwidth,frame=off,align=flushright]{作図: A bit of text}
> \framed[width=\textwidth,frame=off]{作図: A bit of text}
> \stoptext
> % ===
>
>
Hi,

You can try `align={flushright,broad}'.

-- 
Best regards,

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Flushright problems with Japanese

2023-05-15 Thread Gerben Wierda via ntg-context
When I use flushright, my Japanese characters get widely spaced as if flushing 
right doesn't work

Minimal example:

% ===
 \definefallbackfamily
  [archimate]
  [ss]
  [Hiragino Sans]
  [preset=range:japanese,
   tf=style:W3,
   it=style:W3,
   bf=style:W5,
   bi=style:W5,
   force=yes]

\definefontfamily [archimate] [ss] [Optima]

\setupbodyfont[archimate]

\startsetups [japanese]
  \setscript [nihongo]
\stopsetups
\setuplanguage [ja] [setups=japanese]
\mainlanguage [ja]

\starttext
\setupindenting[none]
\setupindenting[no]
\framed[width=\textwidth,frame=off,align=flushleft]{作図:A bit of text}
\framed[width=\textwidth,frame=off,align=flushright]{作図:A bit of text}
\framed[width=\textwidth,frame=off,align=flushright]{作図: A bit of text}
\framed[width=\textwidth,frame=off]{作図: A bit of text}
\stoptext
% ===

Output:




Gerben Wierda (LinkedIn <https://www.linkedin.com/in/gerbenwierda>, Mastodon 
<https://newsie.social/@gctwnl>)
R IT Strategy <https://ea.rna.nl/> (main site)
Book: Chess and the Art of Enterprise Architecture <https://ea.rna.nl/the-book/>
Book: Mastering ArchiMate <https://ea.rna.nl/the-book-edition-iii/>

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Custom TOC with makeup and setups

2023-05-10 Thread Jethro Djan via ntg-context
Hello,

I am trying to create a presentation where at the start of each section in
my presentation, a custom TOC page is shown. When I am at a particular
section, the TOC will grey out all other sections (not implemented in my
MWE). I have tried different ways but I find using makeups for the TOC page
works ok (following
https://wiki.contextgarden.net/Command/setuplistalternative and Aditya's
presentation slides on their blog). My challenge is that when a makeup page
is inserted, it leaves a page with the section name blank before it. How do
I fix it? Any other way to achieve this is also welcome. My MWE:

\setuppapersize[S6]
\startuseMPgraphic{itemize:toc}
  save p; path p;
  p := ( (0,-0.5)--(0,0.5)--(0.866,0)--cycle ) scaled 1.5ExHeight;
  fill p withcolor \MPcolor{Black};
\stopuseMPgraphic

\definesymbol[itemize:toc][\useMPgraphic{itemize:toc}]

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

\setupheadtext[section=Table of Contents]

\startsetups toclist
  \framed[align=normal, frame=off]{\placelist [section] [criterium=all,
alternative=toclist]}
\stopsetups

\definehspace[tspace][4cm]
\setupframed[
  height=fit,
  width=fit,
  location=middle,
  frame=off,
  align=normal,
  offset=none,
]
\startsetups list:toclist
  {\hbox to \hsize \bgroup
  \hspace[tspace]
  \framed[width=10mm,align=flushleft]{\symbol[itemize:toc]}%
  \framed[empty=yes]{\currentlistentrynumber\currentlistentrypagenumber}%
  \doifelse\currentlistentrylocation{\namedstructureheadlocation{section}}{%
\framed[align=flushright,]{{\bfb\currentlistentrytitle}}%
  }{\framed[align=flushright,]{\currentlistentrytitle}}
  \egroup}
\stopsetups



 \definemakeup
  [toc]
  [
doublesided=no,
page=yes,
bottom=,
top=,
pagestate=start,
headerstate=empty,
footerstate=empty,
setups={toclist},
before=\setups{toc:setups},
  ]
\startsetups toc:setups
  \setupbackgrounds[page][background=color, backgroundcolor=blue]
\stopsetups

 \definemakeup
  [standard]
  [
doublesided=no,
page=right,
pagestate=start,
headerstate=empty,
footerstate=empty,
before=\setups{standard:setups},
  ]

 \startsetups standard:setups
\setupbackgrounds[page][background=color, backgroundcolor=lightgray]
 \stopsetups

 \define\TOC{
  \starttocmakeup
  \stoptocmakeup
 }

\starttext

\startstandardmakeup
  \title{Your Title Here}
\stopstandardmakeup

\startsection[title={Motivation}]
\TOC
\startitemize

\item something cool
\item something else cool

\stopitemize
\stopsection

\startsection[title={Main strands of theory}]
\TOC
\startitemize

\item another cool thing
\item cool too

\stopitemize
\stopsection


\stoptext

Thanks in advance.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Linebreaking in Japanese in ConTeXt

2023-04-30 Thread Wolfgang Schuster via ntg-context

Gerben Wierda via ntg-context schrieb am 30.04.2023 um 10:48:
On 30 Apr 2023, at 10:04, Wolfgang Schuster via ntg-context 
mailto:ntg-context@ntg.nl>> wrote:


 begin example
\definefontfamily [noto-jp] [rm] [Noto Serif CJK JP]
\definefontfamily [noto-jp] [ss] [Noto Sans CJK JP]
\definetypeface   [noto-jp] [mm] [math] [pagella] [default]

\setupbodyfont [noto-jp]

\mainlanguage [ja]

\setscript [nihongo]


Thank you.

How do I change that in my setup?

My setup is creating the same stuff in different languages from XML 
input (LMTX using lua and METAPOST), which means I need to adapt the 
following setup (cyrillic and greek shown as the other languages with 
different character sets I use)


\startmode[JA]
\setuplanguage[ja][patterns={ja}]\mainlanguage[ja]
\stopmode


When your document prints only text in a single language change the 
setup above to


    \startmode [JA]
        \setscript [nihongo]
        \mainlanguage [ja]
    \stopmode

but for documents which use multiple script/languages at the same time 
replace the previous setup with


    \startsetups [japanese]
        \setscript [nihongo]
    \stopsetups

    \setuplanguage [ja] [setups=japanese]

and add \language[ja] before japanese text to ensure linebreaking is 
enabled.


Wolfgang

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] adjustment to my local footnotes problem

2023-04-23 Thread jbf via ntg-context
I tried all those Hraban, unsuccessfully, but finally 'happened' upon a 
solution by trying whitespace instead in the setups. Except that I had 
read somewhere in the mailing list (Pablo I think) that I would need to 
use \directsetup. I don't actually understand why, have never been sure 
about what \directsetup does, but there's no doubt it works in this 
case! So the following has done what I needed:



\startsetups[setups:footnotes]

 \setupwhitespace[.01em]

\stopsetups

\setupnote[before=\directsetup{setups:footnotes}]

Julian

On 23/4/23 20:34, Henning Hraban Ramm via ntg-context wrote:

Am 23.04.23 um 09:21 schrieb jbf via ntg-context:
I realise that I should have been talking about the space between 
local footnotes, rather than interlinespace (previous email on this 
issue), but my basic problem still stands. My efforts to influence 
the space between footnotes placed locally is to no avail so far.


I assume it is \setupnote (rather than \setupnotation, my earlier 
mistake) where I would need to somehow influence distance between 
footnotes which is currently too large. I have tried 
\setupnote[before={\blank[small]}, after={\blank[small]}]. It appears 
to be reducing the space before the entire block of local footnotes 
but not between the footnotes themselves, which is what I am trying 
to do.


Did you try "inbetween" or "distance"? (I’d assume the latter is for 
the distance between number and text, but inbetween is usually 
vertically.)


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

Am I correct in assuming that the \setupnote should influence my 
\placelocalfootnotes? Or is there something else I should do in the 
case of local footnotes as distinct from general footnotes (my 
document contains ONLY local footnotes, however).


I was wondering if \setupnote[localfootnote][…] makes sense, but I 
can’t find in the sources if local footnotes are setup differently 
from general one.


Hraban

___ 

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


maillist : ntg-context@ntg.nl / 
https://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] adjustment to my local footnotes problem

2023-04-23 Thread jbf via ntg-context
I tried all those Hraban, unsuccessfully, but finally 'happened' upon a 
solution by trying whitespace instead in the setups. Except that I had 
read somewhere in the mailing list (Pablo I think) that I would need to 
use \directsetup. I don't actually understand why, have never been sure 
about what \directsetup does, but there's no doubt it works in this 
case! So the following has done what I needed:



\startsetups[setups:footnotes]

 \setupwhitespace[.01em]

\stopsetups

\setupnote[before=\directsetup{setups:footnotes}]

Julian

On 23/4/23 20:34, Henning Hraban Ramm via ntg-context wrote:

Am 23.04.23 um 09:21 schrieb jbf via ntg-context:
I realise that I should have been talking about the space between 
local footnotes, rather than interlinespace (previous email on this 
issue), but my basic problem still stands. My efforts to influence 
the space between footnotes placed locally is to no avail so far.


I assume it is \setupnote (rather than \setupnotation, my earlier 
mistake) where I would need to somehow influence distance between 
footnotes which is currently too large. I have tried 
\setupnote[before={\blank[small]}, after={\blank[small]}]. It appears 
to be reducing the space before the entire block of local footnotes 
but not between the footnotes themselves, which is what I am trying 
to do.


Did you try "inbetween" or "distance"? (I’d assume the latter is for 
the distance between number and text, but inbetween is usually 
vertically.)


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

Am I correct in assuming that the \setupnote should influence my 
\placelocalfootnotes? Or is there something else I should do in the 
case of local footnotes as distinct from general footnotes (my 
document contains ONLY local footnotes, however).


I was wondering if \setupnote[localfootnote][…] makes sense, but I 
can’t find in the sources if local footnotes are setup differently 
from general one.


Hraban

___ 

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


maillist : ntg-context@ntg.nl / 
https://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] interlines space for local footnotes

2023-04-22 Thread jbf via ntg-context
I am using only local footnotes in a document, but am having difficulty 
influencing the interlines space between these notes. Since I am only 
using local footnotes, I thought initially that the following would work 
for them


\startsetups[footnote:interlinespace]
  \setupinterlinespace[line=2.4ex]
\stopsetups

\setupnote[footnote][setups=footnote:interlinespace]

but it doesn't. I had hoped there might be something like 
\setuplocalfootnotes but there is not.  I also tried placing the setups 
locally, either with 
\startlocalfootnotes[setups=footnote:interlinespace] or 
\placelocalfootnotes[setups=footnote:interlinespace].


Any idea how I can successfully influence my local footnotes globally?

Julian


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Userdata environment

2023-04-03 Thread Fabrice Couvreur via ntg-context
Hi,
I have already created a thread on the subject and Wolgang, Marco and Taco
have replied but the userdata environment is not yet clear to me. I would
like, if possible, to write a definition, a property or a theorem on the
left and illustrate it in the right margin with an example. In the code
below, the second example is on the second page and not next to the second
definition.
Thanks.
Fabrice


\
useMPlibrary[dum]

\setuppapersize[A4]

\mainlanguage
  [fr]

\setuppagenumbering
 [alternative=doublesided]

\setuplayout
  [width=12cm,
   rightmargin=60mm]


\setupenumerations
  [before={\blank},
   after={\blank},
   alternative=serried,
   distance=0.5em,
   title=yes,
   titleleft=,
   titleright=,
   titlestyle=normal,
   headcommand=\groupedcommand{}{.},
   numbercommand=\groupedcommand{}{},
   titlecommand=\groupedcommand{(}{)},
   width=fit]

\defineenumeration
   [definition]
   [text=Définition,
number=no,
style=italic]

\defineenumeration
   [exemple]
   [text=Exemple,
number=no,
style=normal]

\definemargindata[marginfigure][inright]
\setupmargindata [marginfigure][command=\vbox,align=middle,stack=yes]

\defineuserdata [margintext] [alternative=margintext]

\defineuserdataalternative [margintext] [renderingsetup=userdata:margintext]

\startsetups [userdata:margintext]
  \margindata
[inright]
[
 style={\switchtobodyfont[10pt]},
 width=\rightmarginwidth,
 align={flushleft,broad}
]
{\startexemple
 \getinlineuserdata
 \stopexemple}
  \stopsetups

\showframe
\starttext
\startchapter[title={First Chapter},ownnumber=1]
\startdefinition
 \input ward
\stopdefinition
\startuserdata [margintext]
  \input ward
\stopuserdata
\startdefinition
  \input ward
\stopdefinition
\startuserdata [margintext]
  \input knuth
\stopuserdata
\stopchapter
\stoptext


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Problem with \setuplayout parameters being ignored

2023-03-05 Thread Keith McKay via ntg-context
Many thanks Wolfgang. Useful tips indeed.
Best Wishes
Keith McKay

On Sun, 5 Mar 2023, 17:24 Wolfgang Schuster, <
wolfgang.schuster.li...@gmail.com> wrote:

> Keith McKay schrieb am 05.03.2023 um 18:10:
> >
> > Thank you so much Wolfgang! I should have realised that. It's what I
> > get for trying to write readable code.
> >
> You can use the = to align keys and values, e.g.
>
> \setuplayout
>[backspace=2.5cm,
>margin=0.5cm,
> width=16cm,
>header=1cm,
>footer=1cm]
>
> Another useful method is to put large settings into a setups-blocks and
> pass the block to a setup-command.
>
> \startsetups [apage]
> \startMPcode
> StartPage;
> ...
> StopPage;
> \stopMPcode
> \stopsetups
>
> \defineoverlay[apage][\directsetup{apage}]
>
> Wolfgang
>
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Problem with \setuplayout parameters being ignored

2023-03-05 Thread Wolfgang Schuster via ntg-context

Keith McKay schrieb am 05.03.2023 um 18:10:


Thank you so much Wolfgang! I should have realised that. It's what I 
get for trying to write readable code.



You can use the = to align keys and values, e.g.

\setuplayout
  [backspace=2.5cm,
  margin=0.5cm,
   width=16cm,
  header=1cm,
  footer=1cm]

Another useful method is to put large settings into a setups-blocks and 
pass the block to a setup-command.


\startsetups [apage]
\startMPcode
StartPage;
...
StopPage;
\stopMPcode
\stopsetups

\defineoverlay[apage][\directsetup{apage}]

Wolfgang

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] how to change metadata halfway through document

2023-01-30 Thread jbf via ntg-context

Indeed, that works. Thank you.

Julian

On 30/1/23 20:14, Hans Hagen via ntg-context wrote:

On 1/30/2023 1:14 AM, jbf via ntg-context wrote:
Am trying to understand how best to change the title metadata in 
headertext halfway through a document that has two parts: 
Constitutions and Regulations.


My first attempt (did not work)

\startsetups[headertext]

\startdocument

[metadata:title={Regulations}]

\stopsetups

\setupheadertexts

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

[{\pagenumber \hskip1em \setup{headertext}}] [ ]

My second attempt (quite crass, but it works!!) was to create a 
second \startdocument within the main \startdocument (obviously 
closing it towards the end but before the main \stopdocument), this 
time with [metadata:title={Regulations}] instead of the original 
[metadata:title={Constitutions}]. However, I have a strong feeling 
this is not a very elegant solution!

you can try \setupdocument but i didn't test that


-
  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://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] how to change metadata halfway through document

2023-01-30 Thread Hans Hagen via ntg-context

On 1/30/2023 1:14 AM, jbf via ntg-context wrote:
Am trying to understand how best to change the title metadata in 
headertext halfway through a document that has two parts: Constitutions 
and Regulations.


My first attempt (did not work)

\startsetups[headertext]

\startdocument

[metadata:title={Regulations}]

\stopsetups

\setupheadertexts

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

[{\pagenumber \hskip1em \setup{headertext}}] [ ]

My second attempt (quite crass, but it works!!) was to create a second 
\startdocument within the main \startdocument (obviously closing it 
towards the end but before the main \stopdocument), this time with 
[metadata:title={Regulations}] instead of the original 
[metadata:title={Constitutions}]. However, I have a strong feeling this 
is not a very elegant solution!

you can try \setupdocument but i didn't test that


-
  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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] how to change metadata halfway through document

2023-01-29 Thread jbf via ntg-context
Am trying to understand how best to change the title metadata in 
headertext halfway through a document that has two parts: Constitutions 
and Regulations.


My first attempt (did not work)

\startsetups[headertext]

\startdocument

[metadata:title={Regulations}]

\stopsetups

\setupheadertexts

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

[{\pagenumber \hskip1em \setup{headertext}}] [ ]

My second attempt (quite crass, but it works!!) was to create a second 
\startdocument within the main \startdocument (obviously closing it 
towards the end but before the main \stopdocument), this time with 
[metadata:title={Regulations}] instead of the original 
[metadata:title={Constitutions}]. However, I have a strong feeling this 
is not a very elegant solution!


Thoughts?

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Use section custom value in a header text.

2022-12-20 Thread Rik Kabel via ntg-context


On 2022-12-20 14:31, Pawel Urbanski via ntg-context wrote:

Hi,
Let me clarify my question more...
I need to attach some value to a chapter in that key. That custom 
prefix + the value in the key is ment to be in the header or a footer 
as a matter of fact. The case can apply to both headers and footers.

I tried:
\chapter[title={A sample title}][custom_random={custom_value}]
\setupheadertexts[{Prefix: \structureuservariable{custom_random}}]
...
\stopchapter
I tried this code when trying to figure out the mechanism. The prefix 
string in placed in the header, but hte custom value of the attached 
key is not expanded..
Evey page will contain just one section started by a \startchapter and 
\stop chapter. I would like to put this custom attached value in the 
right slot in the document header.


I hope that htis time around htigs are more clear.

On Tue, Dec 20, 2022 at 8:13 PM Henning Hraban Ramm via ntg-context 
 wrote:


Am 20.12.22 um 19:44 schrieb Pawel Urbanski via ntg-context:
> Dear Friends,
> I s-- pent some time searching and coding simple documents, but
failed and
> therefore I'm asking for help...
> A section such as chapter cn have custom keys with values. One
uses the:
> \structureuservariable command to access such values.
> How can I use such a value to create a custom header in a format:
> Prefix: \structureuservariable{foo}
>
> I am asking for the only thing that worked when I tried was
calling the:
> \setupheadertexts command inside a chapter environment block
with some
> prefix. Unfortunately the value from the custom field was not
expanded.
> It was correctly inserted in a regular paragraph.
> For example:
> \startchapter
> [title={A sample title}][custom_something={random_value}]
> ...
> \stopchapter
>
> How can I put the value of: custom_something in the header with
some prefix?

\define[2]\MyChapter{No.#1 – Prefix
\structureuservariable{custom_something}: #2}

\setuphead[chapter][
  command=\MyChapter,
]

Is this what you meant?

Hraban



Perhaps:

   \setuppagenumbering[alternative=doublesided,location=bottom]
   \startsetups chapter:headings
  \doifsomethingelse{\structureuservariable{custom}}
    {\setupheadertexts[RI]
  [Prefix:
   \structureuservariable{custom}]
  [Prefix:
   \structureuservariable{custom}]
  [VO]}
    {\setupheadertexts[RI][RO][VO][VI]}
   \stopsetups
   \setuphead[chapter]
  [style=\tfa,
   after={\blank\setups{chapter:headings}},
  ]
   \starttext
   \startchapter[title=Nothing special]
   \dorecurse{10}{\input knuth\par}
   \stopchapter
   \startchapter[title=Something special][custom={Hi there!}]
   \dorecurse{10}{\input knuth\par}
   \stopchapter
   \startchapter[title=More nothing special]
   \dorecurse{10}{\input knuth\par}
   \stopchapter
   \startchapter[title=More something special][custom={Bye Bye!}]
   \dorecurse{10}{\input knuth\par}
   \stopchapter
   \stoptext

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] String substitution using regular expressions and backreferences

2022-08-26 Thread Hans Hagen via ntg-context

On 8/25/2022 9:44 PM, Thangalin via ntg-context wrote:

I've attempted to apply Wolfgang's subtle suggestion of using Lua to parse
the input document using a regular expression via lpeg.replacer. The
replacement itself works fine; however, in doing so the XML document
structure is converted to text, which means that it is no longer possible
to "flush" the XML for further processing as XML. The result is that any
unresolved XML tags are written verbatim to the PDF:

https://i.stack.imgur.com/9ZFND.png

There are two other issues with this approach. First is efficiency. Second
is that the processing function would have to be called for every XML
element to capture the replacement.

My original post asked about applying regex word substitution in a ConTeXt
way, such as:

\definereplacement[SubstMac][ match={Mc([A-Z].*)}, replace={\Mac \\1} ]
\definereplacement[SubstPostmeridian][ match={[Pp]\\.[Mm]\\.},
replace={\cap{pm}} ]

That seems like the cleanest approach because it would work on top of XML
or any other source document. Nevertheless, here is what I tried, which
partially works:

\startbuffer[main]

   “Mr. McAnulty, I presume?”
   Regular text. Irregular text.
\stopbuffer
\startxmlsetups xml:xhtml
   \xmlsetsetup{\xmldocument}{*}{-}
   \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}\stopxmlsetups
\startxmlsetups xml:html
   \startdocument
 \xmlflush{#1}
   \stopdocument\stopxmlsetups
% Paragraphs are followed by a paragraph break, but only if not
nested.\startxmlsetups xml:p
   \xmlfunction{#1}{p}
   \par\stopxmlsetups
\startxmlsetups xml:em
   \dontleavehmode{\em\xmlflush{#1}}\stopxmlsetups
\startluacode
function xml.functions.p( t )
   rep = { [1] = { "McAnulty", "\\Mac Anulty" } }
   x = lpeg.replacer( rep ):match( tostring( xml.text( t ) ) )

   buffers.assign( "p", context( x ) )
   context.getbuffer{ "p" }
end\stopluacode
\xmlregistersetup{xml:xhtml}
\def\Mac{%
   % Determine the sizes of 'M' and 'c'.
   \newbox\MacMBox%
   \setbox\MacMBox\hbox{M}%
   \newbox\MacCBox%
   \setbox\MacCBox\hbox{c}%
   %
   % Cheat to dynamically derive the kerning size by putting Mc in a box.
   %
   \newbox\MacKernBox%
   \setbox\MacKernBox\hbox{\inframed[offset=\zeropoint, width=fit]{Mc}}%
   \def\MacDelta{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
   \def\MacUWidth{\dimexpr\wd\MacCBox-.75\MacDelta\relax}%
   \def\MacRule{\vrule width \MacUWidth height .04em depth \zeropoint \relax}%
   \def\MacKern{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}%
   \def\MacHeight{\dimexpr\ht\MacMBox-\ht\MacCBox\relax}%
   %
   % Write Mc, where c has a macron, to the document.
   %
   M{%
 \dontleavehmode{\raisebox{\MacHeight}\hbox{c}}%
 \kern-1.04\MacUWidth
 \MacRule
 \kern.08\MacUWidth
   }%
}%
\xmlprocessbuffer{main}{main}{}

As shown in the screen shot, this doesn't correctly handle nested XML
elements.

Any ideas on what approach to take to perform a string replacement in
ConTeXt?

Best stay at the xml end ...

\startbuffer[main]

  “Mr. McAnulty, I presume?”
  Regular text. Irregular text.

\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}
\stopxmlsetups

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

\startxmlsetups xml:p
\xmlfunction{#1}{p}
\xmlcontext{#1}
\par
\stopxmlsetups

\startxmlsetups xml:em
  \dontleavehmode{\em\xmlflush{#1}}
\stopxmlsetups

\startluacode
local rep = lpeg.replacer { [1] = { "McAnulty", "\\Mac Anulty" } }
function xml.functions.p(t)
local dt = t.dt
for i=1,#dt do
local di = dt[i]
if type(di) == "string" then
dt[i] = lpeg.match(rep,di)
end
end
end
\stopluacode

\xmlregistersetup{xml:xhtml}

\startdocument
\xmlprocessbuffer{main}{main}{}
\stopdocument

But this is more fun and probably also more reliable:

\startbuffer[main]

  “Mr. McAnulty, I presume?”
  Regular text. Irregular text.

\stopbuffer

\startxmlsetups xml:xhtml
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}
\stopxmlsetups

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

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

\startxmlsetups xml:em
  \dontleavehmode{\em\xmlflush{#1}}
\stopxmlsetups

\xmlregistersetup{xml:xhtml}

\usemodule[gimmicks] % in latest uploads

\chardef\MacAnulty = \getprivateglyphslot{MacAnulty}

\startsetups [box:mcanulty:\number\MacAnulty]
\Mac Anulty
\stopsetups

\registerboxglyph category {mcanulty} unicode \MacAnulty \relax

\startluacode
fonts.handlers.otf.addfeature {
name= "mcanulty",
type= "ligature",
nocheck = true,
data= {
[fonts.constructors.privateslots.MacAnulty] = {
"M", "c", "A", "n", &quo

Re: [NTG-context] number of chapters

2022-07-20 Thread Taco Hoekwater via ntg-context


> On 20 Jul 2022, at 09:40, Henning Hraban Ramm via ntg-context 
>  wrote:
> 
> Am 20.07.22 um 09:06 schrieb Henning Hraban Ramm via ntg-context:
>> Hi,
>> how do I access the current chapter number and the number of chapters 
>> (including appendixes; after the first run)?
>> I’d like to setup a chapter color like
>> \definecolor[ChapterColor][
>>   s=1,v=1,
>>   h=360*\namedstructurevariable{chapter}{number}/\numberofchapters,
>> ]
>> and use it for a thumb index...
>> (I can’t access the wiki ATM; downforeveryoneorjustme.com says it would be 
>> just me.)
> 
> Ok, I can access the wiki via Tor and found
> 
> \somenamedheadnumber{chapter}{current}
> \somenamedheadnumber{chapter}{last}

These are expandable

> 
> or
> 
> \someheadnumber[chapter][current]
> \someheadnumber[chapter][last]

These are not
> 
> What’s the difference?
> 
> And even if I use \definecolor within a setup, I get the same color for every 
> chapter – how and where must I delay expansion?
> 
> \usemodule[visual]
> 
> \startsetups[MyChapterSetup]
> \definecolor[MyChapterColor][h={360*\somenamedheadnumber{chapter}{current}/\somenamedheadnumber{chapter}{last}},s=1,v=1]

\definecolor[MyChapterColor][h={\the\numexpr 
360*\somenamedheadnumber{chapter}{current}/\somenamedheadnumber{chapter}{last}\relax},s=1,v=1]

Best wishes,
Taco

— 
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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] number of chapters

2022-07-20 Thread Henning Hraban Ramm via ntg-context

Am 20.07.22 um 09:06 schrieb Henning Hraban Ramm via ntg-context:

Hi,

how do I access the current chapter number and the number of chapters 
(including appendixes; after the first run)?


I’d like to setup a chapter color like

\definecolor[ChapterColor][
   s=1,v=1,
   h=360*\namedstructurevariable{chapter}{number}/\numberofchapters,
]

and use it for a thumb index...

(I can’t access the wiki ATM; downforeveryoneorjustme.com says it would 
be just me.)


Ok, I can access the wiki via Tor and found

\somenamedheadnumber{chapter}{current}
\somenamedheadnumber{chapter}{last}

or

\someheadnumber[chapter][current]
\someheadnumber[chapter][last]

What’s the difference?

And even if I use \definecolor within a setup, I get the same color for 
every chapter – how and where must I delay expansion?


\usemodule[visual]

\startsetups[MyChapterSetup]
\definecolor[MyChapterColor][h={360*\somenamedheadnumber{chapter}{current}/\somenamedheadnumber{chapter}{last}},s=1,v=1]
\definecolor[fakerulecolor][MyChapterColor]
\setuphead[chapter][color=MyChapterColor]
\stopsetups

\unexpanded\def\MyChapter#1{
  \setup{MyChapterSetup}
  \color[MyChapterColor]{#1}
}

\setuphead[chapter][page=no,textcommand=\MyChapter]

\starttext

\dorecurse{20}{
\chapter{\fakewords{1}{5}}
\fakewords{10}{50}
}

\stoptext


Hraban


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] error with sbl bibliography on latest LMTX

2022-07-09 Thread Joey McCollum via ntg-context
Sorry, these are definitely errors on my part. The first one ("invalid
parent sbl:list:title:unpublished for sbl:list:title:thesis,
sbl:list:title:unpublished defined too") was thankfully an easy fix; I just
had to move \definebtx[sbl:\s!list:title:unpublished] before
\definebtx[sbl:\s!list:title:thesis]. I've now pushed this change to the
repo at https://github.com/jjmccollum/context-sbl.

The second error ("Undefined control sequence \currentbtxloctext") is
unfortunately more puzzling. In an effort to preserve backward
compatibility with biblatex usage, I focused on implementing citations in
the SBL style using \autocite, \inlinecite, \parencite, and \footcite
commands, and I neglected to see if the ConTeXt \cite command would work as
expected.

The \currentbtxloctext macro is used for handling more complicated
situations regarding volume, part, page number, etc. citations; for the
purposes of your MWE (and for most citations) a righttext with the page
number citation should also work just fine, so the lack of a loctext
parameter in the \cite command shouldn't be a problem. The
\currentbtxloctext macro is defined in most of the btx:sbl:cite setups in
publ-imp-sbl.mkvi, always via the command

```
\def\currentbtxloctext{\btxparameter{loctext}}
```

The default value of this parameter and similar ones should be \empty, per
the \definebtx[sbl] command in publ-imp-sbl.mkvi:

```
\definebtx
  [sbl]
  [
  ...
  lefttext=\empty, % empty by default
  altloctext=\empty, %empty by default
  loctext=\empty, %empty by default
  righttext=\empty, % empty by default
  punct=\empty, % trailing punctuation (empty by default)
  ...
  ]
```

If I've coded this correctly, then the loctext parameter should default to
\empty when you do not specify it for your \cite command. This seems to be
the case when you first invoke the \cite command (i.e., in the
btx:sbl:cite:footnote setup).

Here is the problem: if you invoke the btx:sbl:cite:inline setup from
inside the btx:sbl:cite:footnote setup, it seems that the loctext parameter
is no longer accessible, and thus, it does not get defined. If I patch the
btx:sbl:cite:footnote setup as follows, then I no longer get the "Undefined
control sequence \currentbtxloctext" error:

```
% Inline footnote citation setup (with intelligent trailing punctuation
replacement)
\startsetups btx:sbl:cite:footnote
  \removeunwantedspaces

\doifinstring{\btxparameter{punct}}{\btxparameter{autopunctuation}}{\btxparameter{punct}}
  \begingroup
  \letbtxparameter{punct}\empty % don't pass the trailing punctuation down
to the inline setup
  \let\doifendswithpunctelse\btx_sbl_doifendswithpunctelse % why is this
necessary? For some reason, \btx_sbl_doifendswithpunctelse is not
recognized within the footnote environment...
  \def\currentbtxcitealternative{footnote}
  \def\currentbtxcategory{\btxfield{category}}
  \def\currentbtxloctext{\btxparameter{loctext}}
  \def\currentbtxaltloctext{\btxparameter{altloctext}}
  \startfootnote
\Word{\fastsetup{btx:sbl:cite:inline}}% capitalize the first word in
the footnote (needed to render "Ibid." and "Idem" correctly)
% Add a closing period if there is no righttext
\doif{\btxparameter{righttext}}{\empty} {
  \btxperiod
}
  \stopfootnote
  \endgroup

\doifnotinstring{\btxparameter{punct}}{\btxparameter{autopunctuation}}{\btxparameter{punct}}
\stopsetups
```

But I still get errors involving other macros that now appear to be
undefined—specifically, the \btxsblshorthandbeforeloctext macro (and,
likely, the \btxsblvolumebeforeloctext macro, as well). These are initially
defined as "no" in the SBL style module outside of the various citation
alternative setups, but they are conditionally redefined as "yes" in these
setups based on specific information in the bibliographic entry.

This pattern suggests a bigger problem. Do these variables and the \cite
parameters fall out of scope when we enter a footnote environment inside a
setup? In my code, I noticed that a macro defined outside of the
btx:sbl:cite:footnote setup was unrecognized within the footnote
environment unless I freshly redefined it:

```
\let\doifendswithpunctelse\btx_sbl_doifendswithpunctelse % why is this
necessary? For some reason, \btx_sbl_doifendswithpunctelse is not
recognized within the footnote environment...
```

Meanwhile, if I change the default citation alternative to "inline" or
"paren", then everything works:

```

\usebtxdataset[default][references.bib]

\setupbtx[dataset=default]

\usebtxdefinitions[sbl]

\setupbtx[sbl:cite][alternative=paren] % or alternative=inline

\setupinteraction[state=start]


\starttext


superior typographic output \cite[lefttext={e.g.}][taraborelli:beauty].


Therefore, the {\TEX}book mentions that the word

\quotation{shel\noligature{ff}ul} should indeed be rendered without the

ff-ligature \cite[righttext={p.~19}][knuth:texbook].


\placelistofpublica

[NTG-context] headings in line numbering

2022-06-18 Thread Pablo Rodriguez via ntg-context
Dear list,

I have the following sample:

  \setuppapersize[A6]
  \definelinenote[otherlinenote]
  \setupnote[otherlinenote]
[compress=yes]
  \startsetups[line:notes]
\setupinterlinespace[line=2.9ex]
  \stopsetups
  \setupnote[linenote]
[paragraph=yes, compress=yes, compressmethod=separator]%
  \setupnotation[linenote][alternative=serried, width=broad]
  \starttext
  \startlinenumbering
  \dorecurse{3}{\subject{Heading\linenote{title}}
  \dorecurse{2}{text\linenote{some text}\linenote{another text}\par}}
  \stoplinenumbering
  \stoptext

How can I get headings added to the line numbers?

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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] interwordspace error after update

2022-06-06 Thread Hans Hagen via ntg-context

On 6/6/2022 8:12 PM, Steffen Wolfrum via ntg-context wrote:


with my last ConTeXt ver 2022.01.21 20:31 LMTX (arm64) this work:

\startsetups footnotesetup
\interwordspace 2.75pt % \setuptolerance[NEUNspace] hat hier keine Wirkung!
\interwordstretch 1.7pt
\interwordshrink 0.9pt
\setupinterlinespace[line=11pt, height=.79,depth=.21]
\lineskiplimit-\maxdimen
\setupwhitespace[0pt]
\stopsetups
You're using the wrong skip. These interwors* things are not meant to be 
set, as they are basically font dimensions (and in traditional tex you'd 
then set them global for each shared font) .. consider them constants 
(which is also why they are lexed as such in syntax highlighting) .. you 
were just lucky and in lmtx we're more restrictive. If you want to go 
low level you can try:


\spaceskip 12.75pt plus 1.8pt minus 0.9pt

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] interwordspace error after update

2022-06-06 Thread Steffen Wolfrum via ntg-context
Hi,

with my last ConTeXt ver 2022.01.21 20:31 LMTX (arm64) this work:

\startsetups footnotesetup
\interwordspace 2.75pt % \setuptolerance[NEUNspace] hat hier keine Wirkung!
\interwordstretch 1.7pt
\interwordshrink 0.9pt
\setupinterlinespace[line=11pt, height=.79,depth=.21]
\lineskiplimit-\maxdimen
\setupwhitespace[0pt]
\stopsetups


Now, with ver 2022.05.11 11:36 LMTX (arm64) the same document gives an error:

tex error   > tex error on line 4 in file ./01_Fara.tex: You can't use 
'\scaledinterwordspace' in internal vertical mode

 \22>:footnotesetup 
   #1->\interwordspace 
   2.75pt\clubpenalty =1\widowpenalty =1\displaywidowpenalty 
=1\brokenpenalty =0\setupinterlinespace [line=11pt, 
height=.79,depth=.21]\lineskiplimit -\maxdimen \setupwhitespace [0pt]
 
 \m_syst_setups_asked 
   \clf_autosetups {\m_syst_setups_asked }
   \relax 
 \handlenoteinsert 
   ...ngroup \edef \currentnote {#1}\strc_constructions_initialize 
{#1}\strc_notes_synchronize \the \everybeforenoteinsert \insert 
\currentnoteinsertionnumber \bgroup \the \everyinsidenoteinsert \relax 
\usesetupsparameter \noteparameter 
   \useinterline ...
 \currentconstructionsynchronize 
   ...es \global \settrue \postponednote \orelse \ifconditional 
\c_strc_notes_flushed \handlenoteitself \currentnote \currentnotenumber \orelse 
\ifconditional \c_strc_notes_delayed \else \handlenoteinsert \currentnote 
\currentnotenumber 
   \fi \endgroup ...
 \currentconstructionsynchronize 
   \csname \??constructionnotehandler \currentconstructionhandler \endcsname 
   \strc_constructions_finalize \strc_notations_finalize 
 
   \stopfootnote
   }


Is there any chance my setup might work again?

Steffen

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Typesetting modern Greek (UTF8) with ConTeXt

2022-06-06 Thread Pablo Rodriguez via ntg-context
On 6/6/22 02:19, Gerben Wierda via ntg-context wrote:
> For Russian I have:
> 
> \setuplanguage[ru][patterns={ru}]\mainlanguage[ru]
> \definefallbackfamily
>   [archimate]
>   [ss]
>   [Helvetica]
>   [preset=range:cyrillic,
>    tf=style:light,
>    it=style:lightoblique,
>    bf=style:regular,
>    bi=style:oblique,
>    force=yes,
>  rscale=1.0]
> \definefontfamily [archimate] [ss] [Optima]
> \setupbodyfont[archimate]
> 
> I can’t find out from ConTeXtgarden what code I must use for modern
> Greek (‘el’?) and what range I must use for Greek characters (I guess
> ‘greekandcoptic’ which I’ve seen mentioned somewhere).
> 
> Correct?

Hi Gerben,

\language[gr], but beware since it uses patterns for ancient Greek.

preset=range:greek is what you intend.

Another approach would be to use \setuplanguage[gr] and configure the
font in setups.

Here you have a minimal sample with both approaches:

\mainlanguage[en]
\definefallbackfamily
  [archimate]
  [ss]
  [MgOpenCosmetica]
  [preset=range:greek,
   force=yes]
\definefontfamily [archimate] [ss] [Optima]
\setupbodyfont[archimate]

\definefontfamily
  [mgopencosm]
  [ss]
  [MgOpenCosmetica]
  [preset=range:greek,
   force=yes]
\startsetups[greek-typeface]
\switchtobodyfont[mgopencosm]
\stopsetups

\setuplanguage[agr][setups={greek-typeface}]

\startbuffer
Ο κόσμος θα ήταν απίστευτα φτωχός αν δεν υπήρχαν οι
Έλληνες. Μάλιστα, αν θέλουμε να είμαστε ειλικρινείς, δεν θα
υπήρχε καθόλου κόσμος, χωρίς τις επιστήμες, τη δημοκρατία,
τις πόλεις, τα φωνήεντα, τη φέτα, το φραπέ, το ούζο και το
χταποδάκι στα κάρβουνα.
\stopbuffer

\starttext
\gr \getbuffer\par
\agr \getbuffer
\stoptext

MgOpenCosmetica can be downloaded from
https://web.archive.org/web/20090309063533/www.ellak.gr/fonts/mgopen/index.en.html
(direct link:
https://web.archive.org/web/20090309063533/www.ellak.gr/fonts/mgopen/files/MgOpenCosmetica.tar.gz).

Just in case it might help,

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
I found a way to wrap everything before \startdocument, so I think this
looks like a template more or less:

In case anyone is interested, here's the MWE:

\definenote[address]
\setupnote[address][rule=off,location=text]


\setupnotation[footnote][numberconversion=numerals]

\definenote[putjustmark]
\setupnote[putjustmark][location=none]
\setupnotation[putjustmark][numberconversion=set 2]


\definenote[putjustnote][footnote]
\setupnote[putjustnote][textcommand=\gobbleoneargument]
\setupnotation[putjustnote][numberconversion=set 2]

\newif\ifnoteintitle
\newtoks\titlefootnotes

\titlefootnotes\emptytoks


\def\thanks#1{\noteintitletrue\putjustmark{#1}\doglobal\appendtoks
\putjustnote{#1} \to \titlefootnotes}
\def\email#1{\noteintitletrue\putjustmark{#1}\doglobal\appendtoks
\putjustnote{#1} \to \titlefootnotes}

\def\unskipfunnylines{\ifnoteintitle\endgraf\kern-2\lineheight\fi}


\definenamespace
   [addr]
   [type=module,
name=address,
command=yes,
setup=list,
parent=addr,
  ]

\define[1]\useaddress
{\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}



\setupaddress[style=italic]
\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, City,
Country}]
\defineaddress[thd][name={Name of Third Institute or Affiliation, City,
Country}]

\processcommacommand[fst,snd,thd]\useaddress



\startsetups [document:start]
The Title\dorecurse{10}{\expanded{\thanks{Work supported by fund
\recurselevel.}}}
\endgraf

Me\dorecurse{10}{\expanded{\email{\tt my.name@mailbox.\recurselevel.com
}}\high{,}}\note[address][fst]\high{,}\note[address][snd]\high{,}\note[address][thd]
\endgraf

\placenotes[address]

\blank[medium]
  \startcolumns\hyphenpenalty1000

  \the\titlefootnotes\relax

  \setcounter[footnote][0]

  \unskipfunnylines

\stopsetups

\startsetups [document:stop]
  \stopcolumns
\stopsetups



\startdocument


test\footnote{test}

\input knuth

\input knuth

\input knuth

\input knuth

\stopdocument



On Wed, May 18, 2022 at 10:02 PM Ross  wrote:

> After some visualisations, I found that my token \titlefootnotes will
> ALWAYS generate two lines if there is/are any non-zero number of footnotes
> there. Interesting. So I need a \newif that each time a \thanks or \email
> is invoked, it'll set to true and I'll unskip the 2\lineheight afterwards.
>
> I still don't know why this \kern macro won't have any effect if it's
> inside a token or a \startsetup.
>
> On Wed, May 18, 2022 at 4:56 PM Ross  wrote:
>
>> Hi Massi,
>>
>> You are a champion!
>>
>> On Wed, May 18, 2022 at 4:41 PM mf  wrote:
>>
>>> I hope I got the point now:
>>>
>>> ...
>>> \startcolumns
>>>
>>> \the\titlefootnotes
>>>
>>> \kern-\rawcountervalue[address]\lineheight % dirty trick
>>>
>>> test\footnote{test}
>>>
>>> \input knuth
>>>
>>> \stopcolumns
>>> ...
>>>
>>> Massi
>>>
>>> Il 18/05/22 10:07, Ross ha scritto:
>>> > Dear Massi,
>>> >
>>> > Thanks for your solution. But the thing may be related to the
>>> > \appendtoks macro. It doesn't work to put just \setnotetext there.
>>> > \note works fine, so that's the reason I need the "full functional
>>> macro".
>>> >
>>> > Maybe I didn't get the point, so if it's not too much to ask, could
>>> you
>>> > do it on my MWE?
>>> >
>>> > PS: sorry I have to use another email account because my institute
>>> > mailbox took forever to get the message before my government (China)
>>> > finishes auditing it.
>>> >
>>> > Best wishes,
>>> > Zhichu
>>> >
>>> > On Wed, May 18, 2022 at 3:36 PM mf via ntg-context >> > <mailto:ntg-context@ntg.nl>> wrote:
>>> >
>>> > Is this what you mean?
>>> >
>>> > \starttext
>>> > Hello\footnotetext{Footnote without mark}.
>>> > \stoptext
>>> >
>>> > Kind regards,
>>> > Massi
>>> >
>>> > Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
>>> >  > Hi everybody,
>>> >  >
>>> >  >
>>> >  > After some attempts to put footnotes in a mixed 1&2 columns
>>> > layout, I
>>> >  > decide to put marks in the one-column environment and flush them
>>> > when
>>> >  > entering the two-column environment.
>>> >  >
>>> >  >
>>> >  > The code

Re: [NTG-context] Table breaks incorrectly between pages

2022-05-15 Thread Bruce Horrocks via ntg-context
Too slow!!

I'd already added https://wiki.contextgarden.net/TABLE#Tables_in_page_headers.

> On 15 May 2022, at 12:00, śrīrāma via ntg-context  wrote:
> 
> On 5/15/22 2:20 PM Wolfgang Schuster via ntg-context wrote:
>> Use the TABLEnested environment in your document header which was added
>> to avoid problems like in your example.
>> 
>> \startsetups headertext
>> \bTABLEnested[setups=headertable,option=stretch]
>> ...
>> \eTABLEnested
>> \stopsetups
> 
> Splendid (as always)! Definitely a better solution for Stefan's document.
> 
> I added a section in the wiki making a note of this:
>  https://wiki.contextgarden.net/TABLE#Headers_with_TABLEs
> 
> Thanks Wolfgang! Until now, I did not even know of the 'nested' type for 
> TABLE.
> 
>  Sreeram
> 

—
Bruce Horrocks
Hampshire, UK

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


  1   2   3   4   5   6   7   8   9   10   >