[NTG-context] Re: framed boxes top aligned howto?

2024-05-31 Thread Hans van der Meer via ntg-context
Forget this question: location=top did the trick.
Should have found earlier. Rest of the day contemplating over the fact it took 
me so long to find out 沈

yours sincerely
dr. Hans van der Meer



> On 31 May 2024, at 12:13, Hans van der Meer via ntg-context 
>  wrote:
> 
> I have no problem of aligning two or more \framedtext boxes bottomwise on the 
> baseline, nor centering them vertically within a \vcenter.
> But I do not succeed in placing them with their top aligned without the 
> following trick: typeset them in a box, determine largestheight and then 
> typeset again each within: \vbox to largestheight and \vill'ed to the bottom.
> 
> All very well, but it is disastrous when there are side effects: twice 
> typesetting then fails in some instances.
> I hope I described the question sufficiently clear, because an MWE is not so 
> minimal.
> 
> Therefore my question: how can I align two or more \framedtext's thus:
> 
> |--] |--] |--] ...
> |  ] [  ] [  ]
> |  ] [  ] [  ]
> |  ] [  ] [  ]
> |  ] |--] [  ]
> |  ]  [  ]
> |  ]  [  ]
> |--]  [  ]
>   |--]
> 
> yours sincerely
> dr. Hans van der Meer
> 
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___

___
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] framed boxes top aligned howto?

2024-05-31 Thread Hans van der Meer via ntg-context
I have no problem of aligning two or more \framedtext boxes bottomwise on the 
baseline, nor centering them vertically within a \vcenter.
But I do not succeed in placing them with their top aligned without the 
following trick: typeset them in a box, determine largestheight and then 
typeset again each within: \vbox to largestheight and \vill'ed to the bottom.

All very well, but it is disastrous when there are side effects: twice 
typesetting then fails in some instances.
I hope I described the question sufficiently clear, because an MWE is not so 
minimal.

Therefore my question: how can I align two or more \framedtext's thus:

|--] |--] |--] ...
|  ] [  ] [  ]
|  ] [  ] [  ]
|  ] [  ] [  ]
|  ] |--] [  ]
|  ]  [  ]
|  ]  [  ]
|--]  [  ]
  |--]

yours sincerely
dr. Hans van der Meer



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

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


[NTG-context] Re: Number in a circle

2024-05-30 Thread Kip Warner
On Thu, 2024-05-30 at 23:20 +0100, Bruce Horrocks wrote:
> I'd be able to maintain a Context PPA but there already seems to be
> one:
> 

I think that's just the source used in Ubuntu. This is called a "source
package" in the Debian parlance:

   https://www.debian.org/doc/debian-policy/ch-source.html

But if you click the "Other versions of 'context' in untrusted
archives" at the bottom of the page it will show you PPAs. There
appears to be three, all of which are ancient.

Just so you know, Ubuntu source packages are just Debian source
packages, but often with some downstream patches. The Debian source
package is what ends up in endless distros.

Probably most lay users who use ConTeXt outside of building from a
tarball or putting somewhere outside of the FHS are using some Debian
distro derivative's package via:

   $ sudo apt install context

Unless the Debian package is updated, usually downstream derivative
distros won't update their own. For that reason if you want to affect
the most change for the most users it's best to do so here:

   https://tracker.debian.org/pkg/context

Over a hundred distros just recycle the above source package and its
resulting binaries.

Usually Debian is slow to update their packages, depending on who is
assigned as package maintainer. Because of that, this is part of the
reason why PPAs are popular because they shorten the time for lay users
to try the new version without having to fiddle with paths, tarballs,
etc.

Once you have a PPA up, to build binary packages the builder does the
same as the ones used by the Debian project. You upload a Debian source
package and it will then go and build and test the resulting binary
packages. After that it injects them into the APT repository (which is
all a PPA is).

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: Number in a circle

2024-05-30 Thread Bruce Horrocks

> On 30 May 2024, at 21:19, Henning Hraban Ramm  wrote:
> 
> Am 30.05.24 um 19:25 schrieb Kip Warner:
>> On Thu, 2024-05-30 at 18:26 +0200, Thomas A. Schmitz wrote:
>>> Is this a message "I'm volunteering to maintain such a ppa" or a
>>> message "wouldn't it be nice if someone went out of their way to make
>>> my life easier"? Just out of curiosity.
>> Right now it's the latter due to time constraints. Although I have
>> helped a number of free software projects get PPAs up and running.
>> Usually once they're up there's not much to do after. Since ConTeXt is
>> already Debianized by the Debian project, you probably can start with
>> their debian/ folder, edit as needed, and then you should be good. You
>> can also set an automatic build recipe in the PPA so each commit to SCM
>> results in a new nightly.
>> You'll get a lot more people using and testing your newer release this
>> way. Food for thought.
> 
> I can assure you the worldwide TeX community has thought about their approach 
> a few times.
> TeX Live packaging (i.e. mostly LaTeX packaging) is different to Linux 
> packaging. Somebody explained it to me in detail, but I can’t remember…
> At least TeX Live’s yearly release setup doesn’t fit… well, anything else (I 
> find it annoying). But for release date, many of the active contributors make 
> sure everything fits together.
> 
> ConTeXt is different in that the distribution is closely coupled to binary 
> versions. It would be possible to set up a PPA independent of TeX Live, I 
> guess. (Have binary & macros in the same package, maybe docs & fonts 
> separate…) But somebody would have to maintain it.

I'd be able to maintain a Context PPA but there already seems to be one:


The dates on that page confuse me, however. It says the last upload of the 
package was 2023-05-05 but that it somehow contains the Context version from 
2024-04-09. I'm not quite sure how that can be the case?

Also it's not clear to me whether that PPA is Context alone or TeXlive plus a 
bunch of TeX stuff including Context? (I could install it of course.) :-)

—
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: self defined conversion in \date

2024-05-30 Thread Wolfgang Schuster

Peter Münster schrieb am 30.05.2024 um 23:22:

On Thu, May 30 2024, Wolfgang Schuster wrote:


The \date mechanism can only use conversions which are defined on the Lua side


Ok. How please?

This does not work:

--8<---cut here---start->8---
\startluacode
-- from https://wiki.contextgarden.net/Command/defineconversion:
   interfaces.implement {
 name  = "FRdate",
 public= true,
 arguments = "string",
 actions   =
 function(s)
 local n = tonumber(s)
 if n == 1 then
 context"1\\ier"
 else
 context(s)
 end
 end
}
\stopluacode
\def\ier{\highordinalstr{er}}
\mainlanguage[fr]
\defineconversion[frd][\FRdate]
\setuplanguage[fr][date={day:frd,\ ,month,\ ,year}]
\starttext
Conversion: \convertnumber{frd}{1}, \convertnumber{frd}{2} (OK)\\
Dates: \date[d=1], \date[d=2] (not OK)
\stoptext
--8<---cut here---end--->8---



\startluacode
function converters.peter(n)
return "X-" .. converters.romannumerals(n)
end
\stopluacode

\starttext

\date[d=1][X-,day:romannumerals]

\date[d=1][day:peter]

\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: missing space with French quotation

2024-05-30 Thread Rik Kabel

My apologies to all, and thank you, Wolfgang. Time to update my notes.

--
Rik

On 2024-05-30 16:33, Wolfgang Schuster wrote:

Rik Kabel schrieb am 30.05.2024 um 19:21:

 From my basic environment file, a useful reminder:

    %% \mainlanguage sets language used for labels (TOC, chapters, ...)
    %% \language sets language to use for hyphenation, quote rules, ...


\mainlanguage includes all settings of \language.

As you can see in the following example \mainlanguage change the float 
label and the quotation marks but \language changes only the quotation 
marks and uses the label of the main language.


 begin example
\starttext

\startplacefigure[title=\quotation{English quotes}]
\midaligned{\blackrule[width=6cm,height=2cm,color=red]}
\stopplacefigure

\start \mainlanguage[nl]
\startplacefigure[title=\quotation{Dutch quotes}]
\midaligned{\blackrule[width=6cm,height=2cm,color=green]}
\stopplacefigure
\stop

\start \language[fr]
\startplacefigure[title=\quotation{French quotes}]
\midaligned{\blackrule[width=6cm,height=2cm,color=blue]}
\stopplacefigure
\stop

\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
___ 
___
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: self defined conversion in \date

2024-05-30 Thread Peter Münster
On Thu, May 30 2024, Wolfgang Schuster wrote:

> The \date mechanism can only use conversions which are defined on the Lua side

Ok. How please?

This does not work:

--8<---cut here---start->8---
\startluacode
-- from https://wiki.contextgarden.net/Command/defineconversion:
  interfaces.implement {
name  = "FRdate",
public= true,
arguments = "string",
actions   =
function(s)
local n = tonumber(s)
if n == 1 then
context"1\\ier"
else
context(s)
end
end
}
\stopluacode
\def\ier{\highordinalstr{er}}
\mainlanguage[fr]
\defineconversion[frd][\FRdate]
\setuplanguage[fr][date={day:frd,\ ,month,\ ,year}]
\starttext
Conversion: \convertnumber{frd}{1}, \convertnumber{frd}{2} (OK)\\
Dates: \date[d=1], \date[d=2] (not OK)
\stoptext
--8<---cut here---end--->8---

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

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


[NTG-context] Re: Number in a circle

2024-05-30 Thread Kip Warner
On Thu, 2024-05-30 at 17:26 +0200, Henning Hraban Ramm wrote:
> My example wasn’t complete, and so is yours. You just define that 
> typeface but never use it.

I'm probably doing it wrong, but I still can't get it to work:

   \definefontfallback[SymbolFB]
 [file:symbola.otf]
 [0x00300-0x003FF,0x02100-0x02800,0x1F000-0x2] % look up the right 
Unicode ranges!
 [check=no,force=no]
   
   
\definetypeface[circle_typeface][rm][serif][times][default][fallbacks=SymbolFB]
   
   \starttext
   Some text in default font before temporarily switching just for this number:
   {\switchtobodyfont[circle_typeface] \utfchar{0x02460}}
   And back to normal text.
   \stoptext

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: self defined conversion in \date

2024-05-30 Thread Wolfgang Schuster

Peter Münster schrieb am 30.05.2024 um 13:59:

Hi,

It seems, that you cannot use self defined conversions in \date:

\defineconversion[mytest][X-\romannumerals]
\starttext
Self defined conversion: \convertnumber{mytest}{1} (OK)\\
Predefined conversion in date: \date[d=1][day:a] (OK)\\
Self defined conversion in date: \date[d=1][day:mytest] (not OK)
\stoptext

Is this a bug, or a feature?

How could one use self defined conversions in \date please?


The \date mechanism can only use conversions which are defined on the 
Lua side but your custom conversion is only available on the TeX side.
You can however set the "X-" prefix as normal string in the output of 
\date and use a predefined conversion.


\starttext

\date[d=1][X-,day:r]

\date[d=1][X-,day:romannumerals]

\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: 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: missing space with French quotation

2024-05-30 Thread Wolfgang Schuster

Rik Kabel schrieb am 30.05.2024 um 19:21:

 From my basic environment file, a useful reminder:

%% \mainlanguage sets language used for labels (TOC, chapters, ...)
%% \language sets language to use for hyphenation, quote rules, ...


\mainlanguage includes all settings of \language.

As you can see in the following example \mainlanguage change the float 
label and the quotation marks but \language changes only the quotation 
marks and uses the label of the main language.


 begin example
\starttext

\startplacefigure[title=\quotation{English quotes}]
\midaligned{\blackrule[width=6cm,height=2cm,color=red]}
\stopplacefigure

\start \mainlanguage[nl]
\startplacefigure[title=\quotation{Dutch quotes}]
\midaligned{\blackrule[width=6cm,height=2cm,color=green]}
\stopplacefigure
\stop

\start \language[fr]
\startplacefigure[title=\quotation{French quotes}]
\midaligned{\blackrule[width=6cm,height=2cm,color=blue]}
\stopplacefigure
\stop

\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: Number in a circle

2024-05-30 Thread Henning Hraban Ramm

Am 30.05.24 um 19:25 schrieb Kip Warner:

On Thu, 2024-05-30 at 18:26 +0200, Thomas A. Schmitz wrote:

Is this a message "I'm volunteering to maintain such a ppa" or a
message "wouldn't it be nice if someone went out of their way to make
my life easier"? Just out of curiosity.


Right now it's the latter due to time constraints. Although I have
helped a number of free software projects get PPAs up and running.

Usually once they're up there's not much to do after. Since ConTeXt is
already Debianized by the Debian project, you probably can start with
their debian/ folder, edit as needed, and then you should be good. You
can also set an automatic build recipe in the PPA so each commit to SCM
results in a new nightly.

You'll get a lot more people using and testing your newer release this
way. Food for thought.


I can assure you the worldwide TeX community has thought about their 
approach a few times.
TeX Live packaging (i.e. mostly LaTeX packaging) is different to Linux 
packaging. Somebody explained it to me in detail, but I can’t remember…
At least TeX Live’s yearly release setup doesn’t fit… well, anything 
else (I find it annoying). But for release date, many of the active 
contributors make sure everything fits together.


ConTeXt is different in that the distribution is closely coupled to 
binary versions. It would be possible to set up a PPA independent of TeX 
Live, I guess. (Have binary & macros in the same package, maybe docs & 
fonts separate…) But somebody would have to maintain it.


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

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


[NTG-context] Re: Number in a circle

2024-05-30 Thread Kip Warner
On Thu, 2024-05-30 at 18:26 +0200, Thomas A. Schmitz wrote:
> Is this a message "I'm volunteering to maintain such a ppa" or a
> message "wouldn't it be nice if someone went out of their way to make
> my life easier"? Just out of curiosity.

Right now it's the latter due to time constraints. Although I have
helped a number of free software projects get PPAs up and running. 

Usually once they're up there's not much to do after. Since ConTeXt is
already Debianized by the Debian project, you probably can start with
their debian/ folder, edit as needed, and then you should be good. You
can also set an automatic build recipe in the PPA so each commit to SCM
results in a new nightly.

You'll get a lot more people using and testing your newer release this
way. Food for thought.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: missing space with French quotation

2024-05-30 Thread Rik Kabel

From my basic environment file, a useful reminder:

   %% \mainlanguage sets language used for labels (TOC, chapters, ...)
   %% \language sets language to use for hyphenation, quote rules, ...

--
Rik


On 2024-05-30 11:34, Peter Münster wrote:

Hi,

When using \start/stopquotation in French documents, there is a missing space:

\mainlanguage[fr]
\setcharacterspacing[frenchpunctuation]
\starttext
bla \quotation{OK} bla\\
bla «OK» bla
\startquotation
   Not Ok: a space is missing
\stopquotation
\stoptext

Is this a bug or a feature?

How could I get a space before "»" please?

TIA for any help,___
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: Number in a circle

2024-05-30 Thread Thomas A. Schmitz

On 30.05.24 18:18, Kip Warner wrote:

Thanks Hrabab. With respect to the latter wiki page, the project might
consider adding a PPA. They're very popular among the over a hundred
different Debian based distros out there. They reconcile both system
requirements of proper FHS usage and file tracking by the system
package manager with the user's need to use the latest stable or
nightly.


Is this a message "I'm volunteering to maintain such a ppa" or a message 
"wouldn't it be nice if someone went out of their way to make my life 
easier"? Just out of curiosity.


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

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


[NTG-context] Re: Number in a circle

2024-05-30 Thread Kip Warner
On Thu, 2024-05-30 at 17:22 +0200, Henning Hraban Ramm wrote:
> Am 28.05.24 um 23:50 schrieb Kip Warner:
> > On Tue, 2024-05-28 at 17:47 +0200, Pablo Rodriguez wrote:
> > > fw is a new dimensio unit only available in LMTX (not in LuaTeX).
> > > 
> > > Just in case it might help,
> > 
> > Thanks Pablo. I'm using the context package for Ubuntu Mantic which
> > is
> > version 2021.03.05.20230120+dfsg-2. I'm assuming that doesn't
> > support
> > the new unit.
> 
> No. Debian/Ubuntu is known for outdated TeX Live packages.
> 
> It doesn’t matter as long as it works for you, but on this mailing
> list we tend to assume latest versions.
> 
> See "Integrating vanilla TeX Live with Debian" in 
> https://wiki.debian.org/TeXLive how to replace TeX Live from your
> Linux distribution with a current version.
> 
> You can also install an additional ConTeXt LMTX, just be careful
> about your PATH.
> https://wiki.contextgarden.net/Installation

Thanks Hrabab. With respect to the latter wiki page, the project might
consider adding a PPA. They're very popular among the over a hundred
different Debian based distros out there. They reconcile both system
requirements of proper FHS usage and file tracking by the system
package manager with the user's need to use the latest stable or
nightly.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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] \hfrac undefined in latest

2024-05-30 Thread Henning Hraban Ramm

Hi Hans & Mikael,

\hfrac is not defined anymore in latest LMTX, is this intentional?

(I don’t need it, it’s just about documentation.)

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

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


[NTG-context] missing space with French quotation

2024-05-30 Thread Peter Münster
Hi,

When using \start/stopquotation in French documents, there is a missing space:

\mainlanguage[fr]
\setcharacterspacing[frenchpunctuation]
\starttext
bla \quotation{OK} bla\\
bla «OK» bla
\startquotation
  Not Ok: a space is missing
\stopquotation
\stoptext

Is this a bug or a feature?

How could I get a space before "»" please?

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

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


[NTG-context] Re: Number in a circle

2024-05-30 Thread Henning Hraban Ramm

Am 28.05.24 um 23:49 schrieb Kip Warner:

On Tue, 2024-05-28 at 08:17 +0200, Henning Hraban Ramm wrote:

Am 27.05.24 um 19:20 schrieb Kip Warner:



You could just define a fallback font, like:

\definefontfallback[SymbolFB]
    [file:symbola.otf]
    [0x00300-0x003FF,0x02100-0x02800,0x1F000-0x2] % look up the
right
Unicode ranges!
    [check=no,force=no]

\definetypeface [myfonts] [rm] [serif] [times] [default]
[fallbacks=SymbolFB]

And then copy the character from a symbol table, no need for a macro.


Hmm, that's a great idea. But I can't seem to get a minimal to work
with https://context-on-web.eu:

\definefontfallback[SymbolFB]
   [file:symbola.otf]
   [0x00300-0x003FF,0x02100-0x02800,0x1F000-0x2] % look up the
right
Unicode ranges!
   [check=no,force=no]

\definetypeface [myfonts] [rm] [serif] [times] [default]

[fallbacks=SymbolFB]

\starttext

\utfchar{0x02460}
\stoptext

The above just prints the vanilla character '1'. That might be because
the online editor doesn't have access to the font. So I tried compiling
the above locally with the Symbola.otf file in the same directory and
same problem.



My example wasn’t complete, and so is yours. You just define that 
typeface but never use it.


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

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


[NTG-context] Re: Number in a circle

2024-05-30 Thread Henning Hraban Ramm

Am 28.05.24 um 23:50 schrieb Kip Warner:

On Tue, 2024-05-28 at 17:47 +0200, Pablo Rodriguez wrote:

fw is a new dimensio unit only available in LMTX (not in LuaTeX).

Just in case it might help,


Thanks Pablo. I'm using the context package for Ubuntu Mantic which is
version 2021.03.05.20230120+dfsg-2. I'm assuming that doesn't support
the new unit.


No. Debian/Ubuntu is known for outdated TeX Live packages.

It doesn’t matter as long as it works for you, but on this mailing list 
we tend to assume latest versions.


See "Integrating vanilla TeX Live with Debian" in 
https://wiki.debian.org/TeXLive how to replace TeX Live from your Linux 
distribution with a current version.


You can also install an additional ConTeXt LMTX, just be careful about 
your PATH.

https://wiki.contextgarden.net/Installation

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

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


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

2024-05-30 Thread Gerion Entrup
Hi Tomáš,

first, thank you for the answer.

Am Donnerstag, 30. Mai 2024, 16:47:36 MESZ schrieb Tomáš Hála:
> Hi Gebrion,
> 
> > ## Font size + ## Bold text
> 
> for font size etc., you can use 
>   \setuphead [chapter] [style={\setupbodyfont[11pt]}]  or
>   \setuphead [chapter] [style=\tf]
> 
>   \setuphead [chapter] [style=\bf]

So this sentence of the wiki [1] is wrong (documentation of the command 
argument)?:
> Command to use for typesetting the title; overrules all other styling. First 
> argument is the number, second the title text.

If I see it right, `style=` only affects the typesetting of `#1` and `#2`, so I 
need setupbodyfont _and_ switchtobodyfont, didn't I?
Also, when I want #1 and #2 to be in different sizes, I choose the "base" size 
with style=\setupbodyfont and adjust it further with switchtobodyfont just for 
one the the argument?

All in all, the correct documentation would be:
> Command to use for typesetting the title. First argument is the number, 
> second the title text. Styling of these parameters can be achieved only by 
> specifying style=.


> > ## Line breaks + ## Framed
> > How can I achieve line breaks?
> 
> \define[2]\MyChapter{%
>   \framedtext{%
>  #1 #2:\\
>  \structureuservariable{subtitle}\\
>  (\structureuservariable{intro})
>   }
> }

This produces an extra line break between '#2' and ':', I don't get why. 
Otherwise, it looks quite nice.


> > I also want to set everything except of the intro in a flushright 
> > environment but do not know how. I tried:
> 
> As above: 
>   \framedtext[align=flushright]{%

That works, thank you!


Best,
Gerion

> --
> 
> On Thu, May 30, 2024 at 02:15:01PM +, Gerion Entrup wrote:
> > Hi,
> > 
> > I'm trying to adapt the format of chapters in my document and have a few 
> > questions regarding setuphead.
> > My aim is to have the chapter (title) on a separate page with an additional 
> > intro in different text sizes for title, subtitle and the intro.
> > I chose to use the "command=" argument in setuphead for that.
> > However, I'm not quite sure about it's internals.
> > 
> > Let's begin with a minimal example:
> > ```
> > \define[2]\MyChapter{%
> > #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> > }
> > 
> > \setuphead[title, chapter][command=\MyChapter]
> > 
> > \setupbodyfont[11pt]
> > 
> > \starttext
> > \startchapter[title=foo][subtitle=bar, intro={some explanation}]
> > some text
> > \stopchapter
> > \stoptext
> > ```
> > This produces 1.pdf.
> > 
> > 
> > ## Font size
> > 
> > What is the reason that that the font of the chapter is bigger? How can I 
> > reset it to normal size? This does not work at all:
> > ```
> > \define[2]\MyChapter{%
> > \setupbodyfont[11pt] #1 #2: \structureuservariable{subtitle} 
> > (\structureuservariable{intro})
> > }
> > ```
> > However, changing to a bigger font works somehow. Is there a factor applied 
> > to the font size internally? For example:
> > ```
> > \define[2]\MyChapter{%
> > \setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
> > (\structureuservariable{intro})
> > }
> > ```
> > produces 2.pdf (the chapter font is not 20pt).
> > 
> > 
> > ## Line breaks
> > 
> > How can I achieve line breaks?
> > This does not work:
> > ```
> > \define[2]\MyChapter{%
> > #1 #2:\\
> > \structureuservariable{subtitle}\\
> > (\structureuservariable{intro})
> > }
> > ```
> > (see 3.pdf)
> > 
> > I also want to set everything except of the intro in a flushright 
> > environment but do not know how. I tried:
> > ```
> > \define[2]\MyChapter{%
> > \startalignment[flushright]
> > #1 #2:\\
> > \structureuservariable{subtitle}\\
> > \stopalignment
> > \structureuservariable{intro}
> > }
> > ```
> > (see 4.pdf, no change)
> > 
> > 
> > ## Bold text
> > 
> > I tried to get the text bold. However, `#1` and `#2` does not seem to 
> > follow this.
> > ```
> > \define[2]\MyChapter{%
> > \bold #1 #2: \structureuservariable{subtitle} 
> > (\structureuservariable{intro})
> > }
> > ```
> > 
> > ## Makeups
> > 
> > The best solution, I had so far, was to define a makeup, but I don't get it 
> > to work with text with mixed alignment and it does not solve the font size 
> > problem:
> > ```
> > \definemakeup[chapter][align=left, top=]
> > \define[2]\MyChapter{%
> > \startmakeup[chapter]
> > #1 #2:\\
> > \structureuservariable{subtitle}\\
> > \stopmakeup
> > (\structureuservariable{intro})
> > }
> > ```
> > (see 5.pdf)
> > 
> > ## Framed
> > 
> > I also have tried this but it does not bring any linebreaks:
> > ```
> > \define[2]\MyChapter{%
> > \framed[frame=off, offset=0pt]{#1\\#2:\\ 
> > \structureuservariable{subtitle}\\ (\structureuservariable{intro})}
> > }
> > ```
> > (see 6.pdf)
> > 
> > I hope you can shed some light into setuphead with command. I search on the 
> > wiki, Stackoverflow and the manuals but didn't really find anything.
> > 
> > Best,
> > Gerion
> > 
> 
> 
> 

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

2024-05-30 Thread Tomáš Hála
Hi Gebrion,

> ## Font size + ## Bold text

for font size etc., you can use 
  \setuphead [chapter] [style={\setupbodyfont[11pt]}]  or
  \setuphead [chapter] [style=\tf]

  \setuphead [chapter] [style=\bf]

> ## Line breaks + ## Framed
> How can I achieve line breaks?

\define[2]\MyChapter{%
  \framedtext{%
 #1 #2:\\
 \structureuservariable{subtitle}\\
 (\structureuservariable{intro})
  }
}

> I also want to set everything except of the intro in a flushright environment 
> but do not know how. I tried:

As above: 
  \framedtext[align=flushright]{%

The best,

Tomáš

--

On Thu, May 30, 2024 at 02:15:01PM +, Gerion Entrup wrote:
> Hi,
> 
> I'm trying to adapt the format of chapters in my document and have a few 
> questions regarding setuphead.
> My aim is to have the chapter (title) on a separate page with an additional 
> intro in different text sizes for title, subtitle and the intro.
> I chose to use the "command=" argument in setuphead for that.
> However, I'm not quite sure about it's internals.
> 
> Let's begin with a minimal example:
> ```
> \define[2]\MyChapter{%
>   #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> }
> 
> \setuphead[title, chapter][command=\MyChapter]
> 
> \setupbodyfont[11pt]
> 
> \starttext
> \startchapter[title=foo][subtitle=bar, intro={some explanation}]
> some text
> \stopchapter
> \stoptext
> ```
> This produces 1.pdf.
> 
> 
> ## Font size
> 
> What is the reason that that the font of the chapter is bigger? How can I 
> reset it to normal size? This does not work at all:
> ```
> \define[2]\MyChapter{%
>   \setupbodyfont[11pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> However, changing to a bigger font works somehow. Is there a factor applied 
> to the font size internally? For example:
> ```
> \define[2]\MyChapter{%
>   \setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> produces 2.pdf (the chapter font is not 20pt).
> 
> 
> ## Line breaks
> 
> How can I achieve line breaks?
> This does not work:
> ```
> \define[2]\MyChapter{%
> #1 #2:\\
> \structureuservariable{subtitle}\\
> (\structureuservariable{intro})
> }
> ```
> (see 3.pdf)
> 
> I also want to set everything except of the intro in a flushright environment 
> but do not know how. I tried:
> ```
> \define[2]\MyChapter{%
> \startalignment[flushright]
> #1 #2:\\
> \structureuservariable{subtitle}\\
> \stopalignment
> \structureuservariable{intro}
> }
> ```
> (see 4.pdf, no change)
> 
> 
> ## Bold text
> 
> I tried to get the text bold. However, `#1` and `#2` does not seem to follow 
> this.
> ```
> \define[2]\MyChapter{%
> \bold #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> 
> ## Makeups
> 
> The best solution, I had so far, was to define a makeup, but I don't get it 
> to work with text with mixed alignment and it does not solve the font size 
> problem:
> ```
> \definemakeup[chapter][align=left, top=]
> \define[2]\MyChapter{%
> \startmakeup[chapter]
> #1 #2:\\
> \structureuservariable{subtitle}\\
> \stopmakeup
> (\structureuservariable{intro})
> }
> ```
> (see 5.pdf)
> 
> ## Framed
> 
> I also have tried this but it does not bring any linebreaks:
> ```
> \define[2]\MyChapter{%
> \framed[frame=off, offset=0pt]{#1\\#2:\\ 
> \structureuservariable{subtitle}\\ (\structureuservariable{intro})}
> }
> ```
> (see 6.pdf)
> 
> I hope you can shed some light into setuphead with command. I search on the 
> wiki, Stackoverflow and the manuals but didn't really find anything.
> 
> Best,
> Gerion
> 







> % 1.pdf
> \define[2]\MyChapter{%
>   #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> }
> 
> % % 2.pdf
> % \define[2]\MyChapter{%
> % \setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> % }
> 
> % % 3.pdf
> % \define[2]\MyChapter{%
> % #1 #2:\\
> % \structureuservariable{subtitle}\\
> % (\structureuservariable{intro})
> % }
> 
> % % 4.pdf
> % \define[2]\MyChapter{%
> % \startalignment[flushright]
> % #1 #2:\\
> % \structureuservariable{subtitle}\\
> % \stopalignment
> % \structureuservariable{intro}
> % }
> 
> % % 5.pdf
> % \definemakeup[chapter][align=left, top=]
> % \define[2]\MyChapter{%
> % \startmakeup[chapter]
> % #1 #2:\\
> % \structureuservariable{subtitle}\\
> % \stopmakeup
> % (\structureuservariable{intro})
> % }
> 
> 
> % % 6.pdf
> % \define[2]\MyChapter{%
> % \framed[frame=off, offset=0pt]{#1\\#2:\\ 
> \structureuservariable{subtitle}\\ (\structureuservariable{intro})}
> % }
> 
> \setuphead[title, chapter][command=\MyChapter]
> 
> \setupbodyfont[11pt]
> 
> \starttext
> \startchapter[title=foo][subtitle=bar, intro={some explanation}]
> some text
> \stopchapter
> \stoptext


> 

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

2024-05-30 Thread Gerion Entrup
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).

Best
Gerion


Am Donnerstag, 30. Mai 2024, 16:15:01 MESZ schrieb Gerion Entrup:
> Hi,
> 
> I'm trying to adapt the format of chapters in my document and have a few 
> questions regarding setuphead.
> My aim is to have the chapter (title) on a separate page with an additional 
> intro in different text sizes for title, subtitle and the intro.
> I chose to use the "command=" argument in setuphead for that.
> However, I'm not quite sure about it's internals.
> 
> Let's begin with a minimal example:
> ```
> \define[2]\MyChapter{%
>   #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
> }
> 
> \setuphead[title, chapter][command=\MyChapter]
> 
> \setupbodyfont[11pt]
> 
> \starttext
> \startchapter[title=foo][subtitle=bar, intro={some explanation}]
> some text
> \stopchapter
> \stoptext
> ```
> This produces 1.pdf.
> 
> 
> ## Font size
> 
> What is the reason that that the font of the chapter is bigger? How can I 
> reset it to normal size? This does not work at all:
> ```
> \define[2]\MyChapter{%
>   \setupbodyfont[11pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> However, changing to a bigger font works somehow. Is there a factor applied 
> to the font size internally? For example:
> ```
> \define[2]\MyChapter{%
>   \setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> produces 2.pdf (the chapter font is not 20pt).
> 
> 
> ## Line breaks
> 
> How can I achieve line breaks?
> This does not work:
> ```
> \define[2]\MyChapter{%
> #1 #2:\\
> \structureuservariable{subtitle}\\
> (\structureuservariable{intro})
> }
> ```
> (see 3.pdf)
> 
> I also want to set everything except of the intro in a flushright environment 
> but do not know how. I tried:
> ```
> \define[2]\MyChapter{%
> \startalignment[flushright]
> #1 #2:\\
> \structureuservariable{subtitle}\\
> \stopalignment
> \structureuservariable{intro}
> }
> ```
> (see 4.pdf, no change)
> 
> 
> ## Bold text
> 
> I tried to get the text bold. However, `#1` and `#2` does not seem to follow 
> this.
> ```
> \define[2]\MyChapter{%
> \bold #1 #2: \structureuservariable{subtitle} 
> (\structureuservariable{intro})
> }
> ```
> 
> ## Makeups
> 
> The best solution, I had so far, was to define a makeup, but I don't get it 
> to work with text with mixed alignment and it does not solve the font size 
> problem:
> ```
> \definemakeup[chapter][align=left, top=]
> \define[2]\MyChapter{%
> \startmakeup[chapter]
> #1 #2:\\
> \structureuservariable{subtitle}\\
> \stopmakeup
> (\structureuservariable{intro})
> }
> ```
> (see 5.pdf)
> 
> ## Framed
> 
> I also have tried this but it does not bring any linebreaks:
> ```
> \define[2]\MyChapter{%
> \framed[frame=off, offset=0pt]{#1\\#2:\\ 
> \structureuservariable{subtitle}\\ (\structureuservariable{intro})}
> }
> ```
> (see 6.pdf)
> 
> I hope you can shed some light into setuphead with command. I search on the 
> wiki, Stackoverflow and the manuals but didn't really find anything.
> 
> Best,
> Gerion
> 
> 



chapter.pdf
Description: Adobe PDF document


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

2024-05-30 Thread Gerion Entrup
Hi,

I'm trying to adapt the format of chapters in my document and have a few 
questions regarding setuphead.
My aim is to have the chapter (title) on a separate page with an additional 
intro in different text sizes for title, subtitle and the intro.
I chose to use the "command=" argument in setuphead for that.
However, I'm not quite sure about it's internals.

Let's begin with a minimal example:
```
\define[2]\MyChapter{%
#1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
}

\setuphead[title, chapter][command=\MyChapter]

\setupbodyfont[11pt]

\starttext
\startchapter[title=foo][subtitle=bar, intro={some explanation}]
some text
\stopchapter
\stoptext
```
This produces 1.pdf.


## Font size

What is the reason that that the font of the chapter is bigger? How can I reset 
it to normal size? This does not work at all:
```
\define[2]\MyChapter{%
\setupbodyfont[11pt] #1 #2: \structureuservariable{subtitle} 
(\structureuservariable{intro})
}
```
However, changing to a bigger font works somehow. Is there a factor applied to 
the font size internally? For example:
```
\define[2]\MyChapter{%
\setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} 
(\structureuservariable{intro})
}
```
produces 2.pdf (the chapter font is not 20pt).


## Line breaks

How can I achieve line breaks?
This does not work:
```
\define[2]\MyChapter{%
#1 #2:\\
\structureuservariable{subtitle}\\
(\structureuservariable{intro})
}
```
(see 3.pdf)

I also want to set everything except of the intro in a flushright environment 
but do not know how. I tried:
```
\define[2]\MyChapter{%
\startalignment[flushright]
#1 #2:\\
\structureuservariable{subtitle}\\
\stopalignment
\structureuservariable{intro}
}
```
(see 4.pdf, no change)


## Bold text

I tried to get the text bold. However, `#1` and `#2` does not seem to follow 
this.
```
\define[2]\MyChapter{%
\bold #1 #2: \structureuservariable{subtitle} 
(\structureuservariable{intro})
}
```

## Makeups

The best solution, I had so far, was to define a makeup, but I don't get it to 
work with text with mixed alignment and it does not solve the font size problem:
```
\definemakeup[chapter][align=left, top=]
\define[2]\MyChapter{%
\startmakeup[chapter]
#1 #2:\\
\structureuservariable{subtitle}\\
\stopmakeup
(\structureuservariable{intro})
}
```
(see 5.pdf)

## Framed

I also have tried this but it does not bring any linebreaks:
```
\define[2]\MyChapter{%
\framed[frame=off, offset=0pt]{#1\\#2:\\ \structureuservariable{subtitle}\\ 
(\structureuservariable{intro})}
}
```
(see 6.pdf)

I hope you can shed some light into setuphead with command. I search on the 
wiki, Stackoverflow and the manuals but didn't really find anything.

Best,
Gerion



1.pdf
Description: Adobe PDF document


2.pdf
Description: Adobe PDF document


3.pdf
Description: Adobe PDF document


4.pdf
Description: Adobe PDF document


5.pdf
Description: Adobe PDF document


6.pdf
Description: Adobe PDF document
% 1.pdf
\define[2]\MyChapter{%
	#1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
}

% % 2.pdf
% \define[2]\MyChapter{%
% 	\setupbodyfont[20pt] #1 #2: \structureuservariable{subtitle} (\structureuservariable{intro})
% }

% % 3.pdf
% \define[2]\MyChapter{%
% #1 #2:\\
% \structureuservariable{subtitle}\\
% (\structureuservariable{intro})
% }

% % 4.pdf
% \define[2]\MyChapter{%
% \startalignment[flushright]
% #1 #2:\\
% \structureuservariable{subtitle}\\
% \stopalignment
% \structureuservariable{intro}
% }

% % 5.pdf
% \definemakeup[chapter][align=left, top=]
% \define[2]\MyChapter{%
% \startmakeup[chapter]
% #1 #2:\\
% \structureuservariable{subtitle}\\
% \stopmakeup
% (\structureuservariable{intro})
% }


% % 6.pdf
% \define[2]\MyChapter{%
% \framed[frame=off, offset=0pt]{#1\\#2:\\ \structureuservariable{subtitle}\\ (\structureuservariable{intro})}
% }

\setuphead[title, chapter][command=\MyChapter]

\setupbodyfont[11pt]

\starttext
\startchapter[title=foo][subtitle=bar, intro={some explanation}]
some text
\stopchapter
\stoptext


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: how to prevent item appearing in List of Figures

2024-05-30 Thread Rik Kabel
Bypass the place figure mechanism completely  by placing them on the page in an overlay. On May 30, 2024 04:22, Tomáš Hála  wrote:Hi Charlie,

I guess that \starttplacefigure[location={none},...] might help you.

Or (older) \placefigure[none][,,,]{...}{...}

Best,

Tomáš

> I haven’t typeset a book before and various things are a challenge. The most recent is the following.
> 
> I have \placelistoffigures some of which are logos (for the publisher and two granting bodies) that I have placed with:
> 
>    \setupcaptions[number=no]
> \starttplacefigure[
>  location={middle,high,low},
>  reference=fig:logo,
>  title=]
> {\externalfigure[FCLogo][width=0.045\textwidth]}
> \stopplacefigure 
> 
> These are not part of the text and I don’t want them to appear in the list.
> 
> The caption for the logo doesn’t appear in the List of Figures but the page number does. How can I prevent these particular graphics from being listed in the List of figures.
> 
> Thanks,
> Charlie
> 
> 
> 
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
___
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] self defined conversion in \date

2024-05-30 Thread Peter Münster
Hi,

It seems, that you cannot use self defined conversions in \date:

\defineconversion[mytest][X-\romannumerals]
\starttext
Self defined conversion: \convertnumber{mytest}{1} (OK)\\
Predefined conversion in date: \date[d=1][day:a] (OK)\\
Self defined conversion in date: \date[d=1][day:mytest] (not OK)
\stoptext

Is this a bug, or a feature?

How could one use self defined conversions in \date please?

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

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


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

2024-05-30 Thread Charles Doherty via ntg-context
Thanks Hraban,

Tomáš Hála suggested l \starttplacefigure[location={none},...] which works a 
treat. I will keep your suggestion in mind too. I am very grateful to you all.

Thank you,
Charlie

> On 30 May 2024, at 11:41, Henning Hraban Ramm  wrote:
> 
> If you don’t need them in the list and also no caption, I wouldn’t use floats 
> (\placefigure) at all, but just plain \externalfigure.
> 
> Hraban

***
CHARLES DOHERTY
13 BANCROFT ROAD
TALLAGHT
DUBLIN 
D24 YH2V
home: +353 1 2447483
Mobile: +353 863868629
charles.dohe...@icloud.com





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

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


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

2024-05-30 Thread Henning Hraban Ramm

Am 29.05.24 um 17:35 schrieb Charles Doherty via ntg-context:

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

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

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


If you don’t need them in the list and also no caption, I wouldn’t use 
floats (\placefigure) at all, but just plain \externalfigure.


Hraban

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

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


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

2024-05-30 Thread Tomáš Hála
Hi Charlie,

I guess that \starttplacefigure[location={none},...] might help you.

Or (older) \placefigure[none][,,,]{...}{...}

Best,

Tomáš

> I haven’t typeset a book before and various things are a challenge. The most 
> recent is the following.
> 
> I have \placelistoffigures some of which are logos (for the publisher and two 
> granting bodies) that I have placed with:
> 
>\setupcaptions[number=no]
> \starttplacefigure[
>  location={middle,high,low},
>  reference=fig:logo,
>  title=]
> {\externalfigure[FCLogo][width=0.045\textwidth]}
> \stopplacefigure 
> 
> These are not part of the text and I don’t want them to appear in the list.
> 
> The caption for the logo doesn’t appear in the List of Figures but the page 
> number does. How can I prevent these particular graphics from being listed in 
> the List of figures.
> 
> Thanks,
> Charlie
> 
> 
> 
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

2024-05-29 Thread Kip Warner
On Wed, 2024-05-29 at 06:49 -0600, Alan Braslau wrote:
> 1) You appear to be using the long-frozen mkii bibliography code.

I think you are right! I just realized that. I'm using in my
Environment file...

   % \BIBTEX macro...
   \usemodule[abr-02]
   
   % Setup bibliography...
   
   % References database and other general settings...
   \setupbibtex[database={./References}, sort=author]
   
   % Global settings...
   \setuppublications[
   alternative=apa,
   numbering=yes,
   monthconversion=month,
   autohang=yes,
   sorttype=cite]
   
   % Without this, no hyperlinks at all in the output...
   \setupinteraction[state=start]
   
   % This two-part helper creates a hyperlink for url fields...
   \unprotect
   \def\bibgotoURL#1#2%
{\useURL[#1][#2][][#1]\from[#1]}
   \def\bibinsertbiburl#1#2#3%
{\bibdoifelse{\@@pb@biburl}
  {#1\expanded{\bibgotoURL{\@@pb@title}{\@@pb@biburl}}#2}{#3}}
   \protect
   
   % Book reference layout...
   \setuppublicationlayout[book]{%
\insertauthors{}{. }{\insertthekey{}{. }{}}%
\inserttitle{\bgroup\it }{.\egroup\space }{}%
\insertpubname{}{. }{}%
\insertday{}{ }{}%
\insertmonth{\Word }{. }{}%
\insertpubyear{}{. }{}%
\insertnote{}{.}{}%
   }
   
   % Adjusted version of 'misc' typesetting, using \insertbiburl
   % instead of \inserttitle (and \insertbiburl runs the
   % \bibinsertbiburl macro defined above)
   \setuppublicationlayout[misc]{%
\insertauthors{}{. }{\insertthekey{}{. }{}}%
\insertbiburl{\bgroup\it }{.\egroup\space }{}%
\insertpubname{}{. }{}%
\insertday{}{ }{}%
\insertmonth{\Word }{. }{}%
\insertpubyear{}{. }{}%
\insertnote{}{.}{}%
   }
   
   % finally, this is a horrible hack needed due to bibtex inserting
   % line breaks in the middle of urls in the output bbl (!)
   % If you find this hack too ugly, consider editing the .bbl by
   % hand and forgetting about the .bib file altogether...
   \let\mydodostartpublication\dodostartpublication
   \def\dodostartpublication{\catcode`\%=14 \mydodostartpublication}
   
   % Macro to put the citations as footnotes...
   \unexpanded\def\footnotecite{\dodoubleempty\domycite}
   \def\domycite[#1][#2]%
   {\ifsecondargument
   \footnote{\cite[alternative=data,#1][#2]}%
   \else
   \footnote{\cite[data][#1]}%
   \fi}
   
   % Individial citation settings...
   
   % Enable clickable links...
   \setupcite[alternative=interaction=start, compress=no]
   
   % Publication list setups for end of the book list...
   
   % Settings for triggering et al...
   \setuppublicationlist[authoretallimit=3]
   \setuppublicationlist[authoretaltext={\it\ et al.}]
   \setuppublicationlist[authoretaldisplay=2]
   
   % List the author, editor, or article author's full name, inverted...
   \setuppublicationlist[%
   author=\invertedauthor,%
   artauthor=\invertedauthor,%
   editor=\invertedauthor,%
   title=References]
   
   % Setup footnotes...
   
   \setupnotation[footnote]
   [color=colour_footnote_text,
backgroundcolor=colour_footnote_background,
width=0.3cm, % Space between footnote number and footnote itself
numbercommand=] % Remove elevated footnote notation at bottom of 
page
   
   \setupnote[footnote]
   [textseparator={\textcomma}, % Comma delineated
before={\crlf\crlf}] %
   
   \setupfootnotes
 [rule=on, % Disable horizontal rule
  textstyle={\hskip.03em}] % Vertical space between footnotes and the 
text
   
   % To move footnotes inside of text boxes to the bottom of the page with
   %  the rest of the footnotes. Disabled temporarily to fix issue of text
   %  background frame borders vanishing...
   \kindofpagetextareas\plusone

Whenever I wanted to use a citation I'd just write
\footnotecite[something]. But I see now there is this page that
describes a different process for using BibTeX:

   https://wiki.contextgarden.net/Bibliography

I will take a look today and try to incorporate the new best practice
for using the database and its citations. If you have any suggestions I
will try and incorporate them.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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  : 

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

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

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

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

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

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

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

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

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

Thanks,
Charlie





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

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


[NTG-context] slides from 2023 meeting

2024-05-29 Thread Pablo Rodriguez via ntg-context
Hi there,

just out of curiosity, are the slides from the 2023 meeting
(https://meeting.contextgarden.net/2023/programme.shtml) planned for
public release?

Many thanks for your help,

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

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


[NTG-context] Re: Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread ai2472206007
I must have made a mistake with something, I changed a counter and it somehow 
worked properly. Because I've designed too many counters, I still haven't 
figured out exactly what the problem is doing. But admittedly, the question I 
asked is non-existent. It's a problem with my design.
___
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: regular expression as lua pattern

2024-05-29 Thread Pablo Rodriguez via ntg-context
On 5/29/24 13:00, Henning Hraban Ramm wrote:
> [...]
> See also Taco’s introduction to LPEG in
> https://articles.contextgarden.net/journal/2019/77-98.pdf

Many thanks for the reference, Hraban.

I need to start digesting that to learn about LPEG.

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

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


[NTG-context] Re: regular expression as lua pattern

2024-05-29 Thread Pablo Rodriguez via ntg-context
On 5/28/24 20:06, Hans Hagen wrote:
> On 5/28/2024 6:25 PM, Tomáš Hála wrote:
>> Hi Pablo,
>>
>> unfortunately, that it is not possible:
>>
>> http://lua-users.org/wiki/PatternsTutorial, section Limitations.
>
> \starttext
>   \startTEXpage[pagestate=start, offset=1em]
>  \startluacode
>  local pat = (lpeg.Cmt(lpeg.P("this") + lpeg.P("that"),
> function(str,_,s)
>  context(s)
>  return #str
>  end) + lpeg.P(1))^1
>  lpeg.match(pat,"how about this being that")
>
>  local pat = (lpeg.Cmt(lpeg.oneof({ "this", "that" }),
> function(str,_,s)
>  context(s)
>  return #str
>  end) + lpeg.P(1))^1
>  lpeg.match(pat,"how about this being that")
>  \stopluacode
>   \stopTEXpage
> \stoptext

Many thanks for your reply, Hans.

I will have to study it becasue LPEGs is new stuff for me.

Many thanks for your help,

Pablo

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

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


[NTG-context] Re: Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread ai2472206007
Thank you. I will try again.
___
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: Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread ai2472206007
Thanks, probably interfered with his output in other parts of my command. I 
didn't locate the error correctly.
___
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: Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread Wolfgang Schuster

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

I'm defining a command to generate options for multiple choice questions,
but at the moment I'm stuck at this step.
I want to get a number and assign a value to the counter, but why can't I get 
it?


\starttext
\definedataset [myset]
\setdataset[myset] [foo=1,boo=4]
\newcount\tempa
\datasetvariable{myset}{1}{boo} % definitely get 4
%\tempa=\datasetvariable{myset}{1}{boo} % why i cannt pass 4 to tempa?
%\number\tempa
\stoptext
%

If anyone can fix it, thanka very much


You have to add a check to ensure there is a value stored in the 
aux-file before you pass the value to the counter. This is necessary 
because when you process the document for the first time Context only 
saves the value and can access it only in the next run after.


 begin example
\definedataset [myset]

\starttext

\setdataset [myset] [foo=1,boo=4]

\doifelsesomething{\datasetvariable{myset}{1}{boo}}
  {\scratchcounter\datasetvariable{myset}{1}{boo}}
  {\scratchcounter\zerocount}

boo = \number\scratchcounter

\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] lua error in `back-exp.lmt`

2024-05-29 Thread Sylvain Hubert
ConTeXt LMTX version: 2024.05.27 18:16

Sample tex file:

\setupbackend[export=yes]

\starttext
x
\startsectionlevel
\startitemize
\item
\startitemize
\item
\startitemize
\item
\stopitemize
\stopitemize
\stopitemize
\stopsectionlevel

\stoptext

Error log:

tex error   > tex error on line 1 in file ./input.tex:
lua error:
registered function call [252]:
...mtx/tex/texmf-context/tex/context/base/mkxl/back-exp.lmt:1426: attempt
to get length of a nil value (local 'td')
stack traceback:
...mtx/tex/texmf-context/tex/context/base/mkxl/back-exp.lmt:1426:
in upvalue 'pushcontent'
...mtx/tex/texmf-context/tex/context/base/mkxl/back-exp.lmt:1597:
in upvalue 'collectresults'
...mtx/tex/texmf-context/tex/context/base/mkxl/back-exp.lmt:1867:
in upvalue 'collectresults'
...mtx/tex/texmf-context/tex/context/base/mkxl/back-exp.lmt:1867:
in upvalue 'collectresults'
.
...mtx/tex/texmf-context/tex/context/base/mkxl/back-exp.lmt:1867:
in upvalue 'collectresults'
...mtx/tex/texmf-context/tex/context/base/mkxl/back-exp.lmt:1969:
in upvalue 'nodes_handlers_export'
[string "local tonut  = nodes.tonut..."]:27: in function <[string
"local tonut  = nodes.tonut..."]:12>
(...tail calls...)
...mtx/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:38: in
function <...mtx/tex/texmf-context/tex/context/base/mkxl/node-shp.lmt:37>
(...tail calls...)

 1 >>  \setupbackend[export=yes]
 2
 3 \starttext
 4 x
 5 \startsectionlevel
 6 \startitemize
 7 \item
 8   \startitemize
 9   \item
10 \startitemize
11 \item
mtx-context | fatal error: return code: 1
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

2024-05-29 Thread Alan Braslau via ntg-context
On Tue, 28 May 2024 21:54:08 -0700
Kip Warner  wrote:

> On Tue, 2024-05-28 at 17:00 -0600, Alan Braslau wrote:
> > The Context publications reference subsystem reads BibTeX databases
> > but does not use BibTeX at all. I am not sure what your quoted
> > statement means exactly.  
> 
> I see. The first few lines of my BibTeX file just contains a copyright
> notice that is commented out with the % character. If that is not a
> valid comment character, is there no way to write a comment in the
> file?
> 

1) You appear to be using the long-frozen mkii bibliography code.
2) As Aditya wrote, anything outside of a valid entry is ignored.

@comment{
}

is a good construction.

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

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

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


[NTG-context] Re: Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread Taco Hoekwater



> On 29 May 2024, at 14:05, ai2472206...@yeah.net wrote:
> 
> I'm defining a command to generate options for multiple choice questions, 
> but at the moment I'm stuck at this step. 
> I want to get a number and assign a value to the counter, but why can't I get 
> it?
> 
> 
> \starttext
> \definedataset [myset]
> \setdataset[myset] [foo=1,boo=4]
> \newcount\tempa
> \datasetvariable{myset}{1}{boo} % definitely get 4
> %\tempa=\datasetvariable{myset}{1}{boo} % why i cannt pass 4 to tempa?
> %\number\tempa
> \stoptext

Works for me (minus comment signs of course):

 ConTeXt  ver: 2024.03.11 09:34 LMTX

Best wishes,
Taco


___
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] Numbers obtained by commands <\datasetvariable> cannot be copied to counters

2024-05-29 Thread ai2472206007
I'm defining a command to generate options for multiple choice questions, 
but at the moment I'm stuck at this step. 
I want to get a number and assign a value to the counter, but why can't I get 
it?


\starttext
\definedataset [myset]
\setdataset[myset] [foo=1,boo=4]
\newcount\tempa
\datasetvariable{myset}{1}{boo} % definitely get 4
%\tempa=\datasetvariable{myset}{1}{boo} % why i cannt pass 4 to tempa?
%\number\tempa
\stoptext
%

If anyone can fix it, thanka very much

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

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


[NTG-context] Re: regular expression as lua pattern

2024-05-29 Thread Henning Hraban Ramm

Am 28.05.24 um 20:06 schrieb Hans Hagen:

On 5/28/2024 6:25 PM, Tomáš Hála wrote:

Hi Pablo,

unfortunately, that it is not possible:

http://lua-users.org/wiki/PatternsTutorial, section Limitations.


\starttext
 \startTEXpage[pagestate=start, offset=1em]
     \startluacode
     local pat = (lpeg.Cmt(lpeg.P("this") + lpeg.P("that"), 
function(str,_,s)

     context(s)
     return #str
     end) + lpeg.P(1))^1
     lpeg.match(pat,"how about this being that")

     local pat = (lpeg.Cmt(lpeg.oneof({ "this", "that" }), 
function(str,_,s)

     context(s)
     return #str
     end) + lpeg.P(1))^1
     lpeg.match(pat,"how about this being that")
     \stopluacode
 \stopTEXpage
\stoptext


See also Taco’s introduction to LPEG in 
https://articles.contextgarden.net/journal/2019/77-98.pdf


Hraban


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

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


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

2024-05-29 Thread Henning Hraban Ramm

Am 29.05.24 um 11:16 schrieb Henning Hraban Ramm:

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


After changes to the source files you must re-generate the format:

context --generate

and maybe

context --luatex --generate


--make instead of --generate, of course. Sorry!

Hraban

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

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


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

2024-05-29 Thread Hans Hagen

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

context --make

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

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

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


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

2024-05-29 Thread Henning Hraban Ramm

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


After changes to the source files you must re-generate the format:

context --generate

and maybe

context --luatex --generate



Hraban

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

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


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

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

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

> On 5/28/2024 10:48 AM, Sylvain Hubert wrote:
> > ConTeXt LMTX version: 2024.05.27 18:16
> >
> > Reproducible example:
> >
> > \definesectionlevels
> > [default]
> > [section, subsection, subsubsection, subsubsubsection,
> subsubsubsubsection]
> >
> > \starttext
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stoptext
> >
> > lua error   > lua error on line 19 in file ./input.tex:
> >
> > registered function call [969]:
> > ...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75: attempt
> > to index a nil value (field '?')
> > stack traceback:
> >  ...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75:
> > in function
> <...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:66>
> >  (...tail calls...)
> can you test with the attached ... (remake the format)
>
> \starttext
> \startsectionlevel[title=level 1]
>  \startsectionlevel[title=level 2 ]
>  \startsectionlevel[title=level 3]
>  \startsectionlevel[title=level 4]
>  \startsectionlevel[title=level 5]
>  \startsectionlevel[title=level 6]
>  \startsectionlevel[title=level 7]
>  \startsectionlevel[title=level 8]
>  \startsectionlevel[title=level 9]
>  \startsectionlevel[title=level 10 ]
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stoptext
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

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

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

> On 5/28/2024 10:48 AM, Sylvain Hubert wrote:
> > ConTeXt LMTX version: 2024.05.27 18:16
> >
> > Reproducible example:
> >
> > \definesectionlevels
> > [default]
> > [section, subsection, subsubsection, subsubsubsection,
> subsubsubsubsection]
> >
> > \starttext
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \startsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stopsectionlevel
> > \stoptext
> >
> > lua error   > lua error on line 19 in file ./input.tex:
> >
> > registered function call [969]:
> > ...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75: attempt
> > to index a nil value (field '?')
> > stack traceback:
> >  ...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75:
> > in function
> <...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:66>
> >  (...tail calls...)
> can you test with the attached ... (remake the format)
>
> \starttext
> \startsectionlevel[title=level 1]
>  \startsectionlevel[title=level 2 ]
>  \startsectionlevel[title=level 3]
>  \startsectionlevel[title=level 4]
>  \startsectionlevel[title=level 5]
>  \startsectionlevel[title=level 6]
>  \startsectionlevel[title=level 7]
>  \startsectionlevel[title=level 8]
>  \startsectionlevel[title=level 9]
>  \startsectionlevel[title=level 10 ]
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
>  \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stopsectionlevel
> \stoptext
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


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

2024-05-28 Thread Kip Warner
On Tue, 2024-05-28 at 17:00 -0600, Alan Braslau wrote:
> The Context publications reference subsystem reads BibTeX databases
> but does not use BibTeX at all. I am not sure what your quoted
> statement means exactly.

I see. The first few lines of my BibTeX file just contains a copyright
notice that is commented out with the % character. If that is not a
valid comment character, is there no way to write a comment in the
file?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: Number in a circle

2024-05-28 Thread Kip Warner
On Tue, 2024-05-28 at 15:02 -0700, Kip Warner wrote:
> On Tue, 2024-05-28 at 17:38 +0200, Wolfgang Schuster wrote:
> > Add
> > 
> >  framecolor=colour_text,
> > 
> > to the frame settings.
> 
> Thanks Wolfgang. That does work.
> 
> But another problem I've found is the font and circle are not
> automatically resized when used in a formula:
> 
>    \definecolor[colour_text][r=0.754,g=0.516,b=0.324] % RGB 0xc08453
>    
>    \setupcolors[
>    state=start,
>    textcolor=colour_text,
>    pagecolormodel=rgb] % gray rgb cmyk auto none
>    
>    % Commands for MetaPost interpreter to draw a circle...
>    \startuseMPgraphic{textcircle}
>     draw fullcircle
>     xscaled OverlayWidth
>     yscaled OverlayWidth
>     withcolor OverlayLineColor;
>    \stopuseMPgraphic
>    
>    % Define an overlay using the above image...
>    \defineoverlay[textcircle][\useMPgraphic{textcircle}]
>    
>    % Define a frame we can use via \textcircled{X} that uses as its
>    background
>    %  the above overlay...
>    \defineframed
>   [textcircled]
>   [width=1.4em,
>    height=1.4em,
>    frame=off,
>    background=textcircle,
>    framecolor=colour_text,
>    location=low,
>    offset=none]
>    
>    \starttext
>    Here are the numbers \textcircled{1}, \textcircled{2}, and
>    \textcircled{3}.
>    
>    And when used in formula, \math{\Sigma_{i^b
> x_{\textcircled{3}}^i}}
>    \stoptext
> 
> What I was hoping would happen there was the circled 3 in the formula
> would shrink to look like a subscript for the x variable. Any help
> appreciated.

Wolfgang, please don't tax yourself further on this. I've managed to
find another way of expressing the same ideas in my publication without
having to resort to the above magic. Thanks again.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: BibTeX choking on comments in database

2024-05-28 Thread Kip Warner
On Wed, 2024-05-29 at 00:45 +0200, Aditya Mahajan wrote:
> Hard to say without looking at the bib file, but % is not a comment
> character in bibtex. So, if your file starts with

The first few lines of the file is just a copyright notice, with each
line beginning with %. If that's not an appropriate comment character,
is there any way to put comments in a BibTeX file?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: BibTeX choking on comments in database

2024-05-28 Thread Alan Braslau via ntg-context
On Mon, 27 May 2024 16:24:49 -0700
Kip Warner  wrote:

> I am using BibTeX under ConTeXt to typeset a publication.

The Context publications reference subsystem reads BibTeX databases but
does not use BibTeX at all. I am not sure what your quoted statement
means exactly.

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: BibTeX choking on comments in database

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

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

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

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

you will get an error from the bib parser.

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

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

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

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

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


[NTG-context] Re: Number in a circle

2024-05-28 Thread Kip Warner
On Tue, 2024-05-28 at 17:38 +0200, Wolfgang Schuster wrote:
> Add
> 
>  framecolor=colour_text,
> 
> to the frame settings.

Thanks Wolfgang. That does work.

But another problem I've found is the font and circle are not
automatically resized when used in a formula:

   \definecolor[colour_text][r=0.754,g=0.516,b=0.324] % RGB 0xc08453
   
   \setupcolors[
   state=start,
   textcolor=colour_text,
   pagecolormodel=rgb] % gray rgb cmyk auto none
   
   % Commands for MetaPost interpreter to draw a circle...
   \startuseMPgraphic{textcircle}
draw fullcircle
xscaled OverlayWidth
yscaled OverlayWidth
withcolor OverlayLineColor;
   \stopuseMPgraphic
   
   % Define an overlay using the above image...
   \defineoverlay[textcircle][\useMPgraphic{textcircle}]
   
   % Define a frame we can use via \textcircled{X} that uses as its
   background
   %  the above overlay...
   \defineframed
  [textcircled]
  [width=1.4em,
   height=1.4em,
   frame=off,
   background=textcircle,
   framecolor=colour_text,
   location=low,
   offset=none]
   
   \starttext
   Here are the numbers \textcircled{1}, \textcircled{2}, and
   \textcircled{3}.
   
   And when used in formula, \math{\Sigma_{i^b x_{\textcircled{3}}^i}}
   \stoptext

What I was hoping would happen there was the circled 3 in the formula
would shrink to look like a subscript for the x variable. Any help
appreciated.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: Number in a circle

2024-05-28 Thread Kip Warner
On Tue, 2024-05-28 at 17:47 +0200, Pablo Rodriguez wrote:
> fw is a new dimensio unit only available in LMTX (not in LuaTeX).
> 
> Just in case it might help,

Thanks Pablo. I'm using the context package for Ubuntu Mantic which is
version 2021.03.05.20230120+dfsg-2. I'm assuming that doesn't support
the new unit.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: Number in a circle

2024-05-28 Thread Kip Warner
On Tue, 2024-05-28 at 08:17 +0200, Henning Hraban Ramm wrote:
> Am 27.05.24 um 19:20 schrieb Kip Warner:
> > On Mon, 2024-05-27 at 07:09 +0200, Ryszard Kubiak wrote:
> > > Hi Kip,
> > > 
> > > You may try characters with Unicode slots from U+2460 upto
> > > U+2469.
> > > They mean circled digits and are available in many fonts.
> > 
> > Thanks Ryszard. Those would be perfect, except I can't get them to
> > work
> > in ConTeXt. I tried using the \utfchar{0x2460} but it just displays
> > the
> > number 1.
> > 
> > I am assuming it needs a font that supports it, but I'm not sure
> > how to
> > switch to a supporting font just to typeset that character and then
> > revert back. Is there some way to define a macro?
> 
> You could just define a fallback font, like:
> 
> \definefontfallback[SymbolFB]
>    [file:symbola.otf]
>    [0x00300-0x003FF,0x02100-0x02800,0x1F000-0x2] % look up the
> right 
> Unicode ranges!
>    [check=no,force=no]
> 
> \definetypeface [myfonts] [rm] [serif] [times] [default] 
> [fallbacks=SymbolFB]
> 
> And then copy the character from a symbol table, no need for a macro.

Hmm, that's a great idea. But I can't seem to get a minimal to work
with https://context-on-web.eu:

   \definefontfallback[SymbolFB]
  [file:symbola.otf]
  [0x00300-0x003FF,0x02100-0x02800,0x1F000-0x2] % look up the
   right
   Unicode ranges!
  [check=no,force=no]
   
   \definetypeface [myfonts] [rm] [serif] [times] [default]
   [fallbacks=SymbolFB]
   
   \starttext
   \utfchar{0x02460}
   \stoptext

The above just prints the vanilla character '1'. That might be because
the online editor doesn't have access to the font. So I tried compiling
the above locally with the Symbola.otf file in the same directory and
same problem.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: Number in a circle

2024-05-28 Thread Kip Warner
On Mon, 2024-05-27 at 20:15 +0200, vm wrote:
> if you make width and hwight 1.4en instead of 1.5em, the characters
> will align with the running text.

Thank you. I will give that a try.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: regular expression as lua pattern

2024-05-28 Thread Hans Hagen

On 5/28/2024 6:25 PM, Tomáš Hála wrote:

Hi Pablo,

unfortunately, that it is not possible:

http://lua-users.org/wiki/PatternsTutorial, section Limitations.


\starttext
\startTEXpage[pagestate=start, offset=1em]
\startluacode
local pat = (lpeg.Cmt(lpeg.P("this") + lpeg.P("that"), 
function(str,_,s)

context(s)
return #str
end) + lpeg.P(1))^1
lpeg.match(pat,"how about this being that")

local pat = (lpeg.Cmt(lpeg.oneof({ "this", "that" }), 
function(str,_,s)

context(s)
return #str
end) + lpeg.P(1))^1
lpeg.match(pat,"how about this being that")
\stopluacode
\stopTEXpage
\stoptext



On Tue, May 28, 2024 at 06:12:51PM +0200, Pablo Rodriguez via ntg-context wrote:

Dear list,

I have the following sample:

\starttext
\startTEXpage[pagestate=start, offset=1em]
\startluacode
local str = "this is that"
context(str:match("(this|these)"))
\stopluacode
\stopTEXpage
\stoptext

In short, I would like to know whether it is possible to have the
regular expression (this|these) as a Lua pattern.

I mean, I need complete strings and I haven’t found the way to do it.

Many thanks for your help,

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

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

___
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: BibTeX choking on comments in database

2024-05-28 Thread Kip Warner
On Tue, 2024-05-28 at 08:05 +0200, Henning Hraban Ramm wrote:
> According to the documentation, everything outside of entries is 
> considered a comment. Inside of entries, there can’t be comments.

But in this case, is it not warning about text outside of an entry that
should be treated as a comment?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: regular expression as lua pattern

2024-05-28 Thread Pablo Rodriguez via ntg-context
On 5/28/24 18:25, Tomáš Hála wrote:
> Hi Pablo,
>
> unfortunately, that it is not possible:
>
> http://lua-users.org/wiki/PatternsTutorial, section Limitations.

Many thanks for your reply, Tomáš.

It is clear to me now.

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

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


[NTG-context] Re: regular expression as lua pattern

2024-05-28 Thread Tomáš Hála
Hi Pablo,

unfortunately, that it is not possible:

http://lua-users.org/wiki/PatternsTutorial, section Limitations.

The best,

Tomáš


On Tue, May 28, 2024 at 06:12:51PM +0200, Pablo Rodriguez via ntg-context wrote:
> Dear list,
> 
> I have the following sample:
> 
>   \starttext
>   \startTEXpage[pagestate=start, offset=1em]
>   \startluacode
>   local str = "this is that"
>   context(str:match("(this|these)"))
>   \stopluacode
>   \stopTEXpage
>   \stoptext
> 
> In short, I would like to know whether it is possible to have the
> regular expression (this|these) as a Lua pattern.
> 
> I mean, I need complete strings and I haven’t found the way to do it.
> 
> Many thanks for your help,
> 
> Pablo
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___
___
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] regular expression as lua pattern

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

I have the following sample:

\starttext
\startTEXpage[pagestate=start, offset=1em]
\startluacode
local str = "this is that"
context(str:match("(this|these)"))
\stopluacode
\stopTEXpage
\stoptext

In short, I would like to know whether it is possible to have the
regular expression (this|these) as a Lua pattern.

I mean, I need complete strings and I haven’t found the way to do it.

Many thanks for your help,

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

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


[NTG-context] Re: wrong font scaling in LMTX?

2024-05-28 Thread Pablo Rodriguez via ntg-context
On 5/26/24 20:50, Wolfgang Schuster wrote:
> [...]
> I get the same results with the default font mode in MkIV and LMTX but
> when I add
>
> \enableexperiments[fonts.compact]
>
> the x and xx sizes are wrong.

Many thanks for having fixed that in latest, both Hans and Wolfgang.

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

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


[NTG-context] Re: Number in a circle

2024-05-28 Thread Pablo Rodriguez via ntg-context
On 5/28/24 17:47, Pablo Rodriguez via ntg-context wrote:
> On 5/27/24 19:10, Kip Warner wrote:
>> [...]
>>to say pt, for printer's55points. two letters.
>>
>> I'm not sure what it is referring to.
>
> fw is a new dimensio unit only available in LMTX (not in LuaTeX).

Sorry for the noise.

I didn’t see that there were new messages and the proper answer from
Wolfgang among these.

Pablo

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

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


[NTG-context] Re: Number in a circle

2024-05-28 Thread Pablo Rodriguez via ntg-context
On 5/27/24 19:10, Kip Warner wrote:
> [...]
> Thanks Wolfgang. I gave it a try on https://context-on-web.eu/, but it
> failed:
>
>Dimensions can be in units of em, ex, in, pt, pc, cm, mm, dd, cc,
>bp, dk, or54sp; but yours is a new one! I'll assume that you meant
>to say pt, for printer's55points. two letters.
>
> I'm not sure what it is referring to.

fw is a new dimensio unit only available in LMTX (not in LuaTeX).

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 / 
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: Number in a circle

2024-05-28 Thread Wolfgang Schuster

Kip Warner schrieb am 28.05.2024 um 06:29:

On Mon, 2024-05-27 at 19:44 +0200, Wolfgang Schuster wrote:

You can use the \framed solution and modify it to use a metapost
graphic as background, it also easy to replace the circle with a
hexagon etc.

\startuseMPgraphic{textcircle}
  draw fullcircle
  xscaled OverlayWidth
  yscaled OverlayWidth
  withcolor OverlayLineColor ;
\stopuseMPgraphic

\defineoverlay[textcircle][\useMPgraphic{textcircle}]

\defineframed
    [textcircled]
    [  width=1.5em,
  height=1.5em,
  frame=off,
     background=textcircle,
   location=low,
     offset=none]

\starttext
\dostepwiserecurse{0}{9}{1}{#1 = \textcircled{#1}\blank}
\stoptext


Thank you again Wolfgang. This is very helpful and works well.

One question I have for you is how to set the colour of the circle to
match the other text on my page. I currently do the following in my
environment file:

\definecolor[colour_text][r=0.754,g=0.516,b=0.324]
   
\setupcolors[state=start,textcolor=colour_text,pagecolormodel=rgb]


Add

framecolor=colour_text,

to the frame settings.

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: lua error in `strc-lev.lua`

2024-05-28 Thread Denis Maier via ntg-context
Well, you define less levels than you need.

 

Try this :

 

%

\definesectionlevels

   [default]

   [

%chapter, % uncomment this line to make it work

   section, subsection, subsubsection, subsubsubsection, subsubsubsubsection]

 

\starttext

\startsectionlevel

\startsectionlevel

\startsectionlevel

\startsectionlevel

\startsectionlevel

\startsectionlevel

\startsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stoptext

%

 

Interestingly, this will also work, although (if I’m counting correctly) there 
are still only 5 levels defined, but 6 are used (just like above):

 



 

\definesectionlevels

   [default]

   [

%chapter, % uncomment this line to make it work

   section, subsection, subsubsection, subsubsubsection, subsubsubsubsection]

 

\starttext

\startsectionlevel

\startsectionlevel

\startsectionlevel

\startsectionlevel

\startsectionlevel

\startsectionlevel

%\startsectionlevel

%\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stoptext

 

 



Von: Sylvain Hubert  
Gesendet: Dienstag, 28. Mai 2024 10:48
An: mailing list for ConTeXt users 
Betreff: [NTG-context] lua error in `strc-lev.lua`

 

ConTeXt LMTX version: 2024.05.27 18:16

 

Reproducible example:

 

\definesectionlevels

   [default]

   [section, subsection, subsubsection, subsubsubsection, subsubsubsubsection]

 

\starttext

\startsectionlevel

\startsectionlevel

\startsectionlevel

\startsectionlevel

\startsectionlevel

\startsectionlevel

\startsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stopsectionlevel

\stoptext

 

lua error   > lua error on line 19 in file ./input.tex:

registered function call [969]: 
...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75: attempt to 
index a nil value (field '?')
stack traceback:
...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75: in 
function <...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:66>
(...tail calls...)

 

___
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] lua error in `strc-lev.lua`

2024-05-28 Thread Sylvain Hubert
ConTeXt LMTX version: 2024.05.27 18:16

Reproducible example:

\definesectionlevels
[default]
[section, subsection, subsubsection, subsubsubsection, subsubsubsubsection]

\starttext
\startsectionlevel
\startsectionlevel
\startsectionlevel
\startsectionlevel
\startsectionlevel
\startsectionlevel
\startsectionlevel
\stopsectionlevel
\stopsectionlevel
\stopsectionlevel
\stopsectionlevel
\stopsectionlevel
\stopsectionlevel
\stopsectionlevel
\stoptext

lua error   > lua error on line 19 in file ./input.tex:

registered function call [969]:
...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75: attempt to
index a nil value (field '?')
stack traceback:
...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:75: in
function <...mtx/tex/texmf-context/tex/context/base/mkiv/strc-lev.lua:66>
(...tail calls...)
___
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: Number in a circle

2024-05-28 Thread Henning Hraban Ramm

Am 27.05.24 um 19:20 schrieb Kip Warner:

On Mon, 2024-05-27 at 07:09 +0200, Ryszard Kubiak wrote:

Hi Kip,

You may try characters with Unicode slots from U+2460 upto U+2469.
They mean circled digits and are available in many fonts.


Thanks Ryszard. Those would be perfect, except I can't get them to work
in ConTeXt. I tried using the \utfchar{0x2460} but it just displays the
number 1.

I am assuming it needs a font that supports it, but I'm not sure how to
switch to a supporting font just to typeset that character and then
revert back. Is there some way to define a macro?


You could just define a fallback font, like:

\definefontfallback[SymbolFB]
  [file:symbola.otf]
  [0x00300-0x003FF,0x02100-0x02800,0x1F000-0x2] % look up the right 
Unicode ranges!

  [check=no,force=no]

\definetypeface [myfonts] [rm] [serif] [times] [default] 
[fallbacks=SymbolFB]


And then copy the character from a symbol table, no need for a macro.

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

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


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

2024-05-28 Thread Henning Hraban Ramm

Am 28.05.24 um 01:24 schrieb Kip Warner:

Hello list,

I am using BibTeX under ConTeXt to typeset a publication. I noticed
while building the publication ConTeXt raises the following non-fatal
warning:

...
This is BibTeX, Version 0.99d (TeX Live 2023/Debian)
The top-level auxiliary file: Secret_Sauce.aux
The style file: cont-au.bst
Database file #1: ./References.bib
I was expecting a `{' or a `('---line 2 of file ./References.bib
 :
 : % See the file Copying for details on copying conditions.
(Error may have been on previous line)
I'm skipping whatever remains of this entry
(There was 1 error message)
publications> loading formatting style from 'bibl-apa'
open source > level 4, order 13, name
'/usr/share/texmf/tex/context/bib/mkii/bibl-apa.tex'
close source> level 4, order 13, name
'/usr/share/texmf/tex/context/bib/mkii/bibl-apa.tex'
...

All that's present on the first few lines of the References.bib BibTeX
database are comments that begin with the '%' character.

Is there a different character that should be used for BibTeX databases
when used with ConTeXt?


According to the documentation, everything outside of entries is 
considered a comment. Inside of entries, there can’t be comments.


Hraban

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

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


[NTG-context] Re: Number in a circle

2024-05-27 Thread Kip Warner
On Mon, 2024-05-27 at 19:44 +0200, Wolfgang Schuster wrote:
> You can use the \framed solution and modify it to use a metapost
> graphic as background, it also easy to replace the circle with a
> hexagon etc.
> 
> \startuseMPgraphic{textcircle}
>  draw fullcircle
>  xscaled OverlayWidth
>  yscaled OverlayWidth
>  withcolor OverlayLineColor ;
> \stopuseMPgraphic
> 
> \defineoverlay[textcircle][\useMPgraphic{textcircle}]
> 
> \defineframed
>    [textcircled]
>    [  width=1.5em,
>  height=1.5em,
>  frame=off,
>     background=textcircle,
>   location=low,
>     offset=none]
> 
> \starttext
> \dostepwiserecurse{0}{9}{1}{#1 = \textcircled{#1}\blank}
> \stoptext

Thank you again Wolfgang. This is very helpful and works well.

One question I have for you is how to set the colour of the circle to
match the other text on my page. I currently do the following in my
environment file:

   \definecolor[colour_text][r=0.754,g=0.516,b=0.324]
  
   \setupcolors[state=start,textcolor=colour_text,pagecolormodel=rgb]

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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] BibTeX choking on comments in database

2024-05-27 Thread Kip Warner
Hello list,

I am using BibTeX under ConTeXt to typeset a publication. I noticed
while building the publication ConTeXt raises the following non-fatal
warning:

   ...
   This is BibTeX, Version 0.99d (TeX Live 2023/Debian)
   The top-level auxiliary file: Secret_Sauce.aux
   The style file: cont-au.bst
   Database file #1: ./References.bib
   I was expecting a `{' or a `('---line 2 of file ./References.bib
: 
: % See the file Copying for details on copying conditions.
   (Error may have been on previous line)
   I'm skipping whatever remains of this entry
   (There was 1 error message)
   publications> loading formatting style from 'bibl-apa'
   open source > level 4, order 13, name
   '/usr/share/texmf/tex/context/bib/mkii/bibl-apa.tex'
   close source> level 4, order 13, name
   '/usr/share/texmf/tex/context/bib/mkii/bibl-apa.tex'
   ...

All that's present on the first few lines of the References.bib BibTeX
database are comments that begin with the '%' character.

Is there a different character that should be used for BibTeX databases
when used with ConTeXt?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: Number in a circle

2024-05-27 Thread vm via ntg-context
if you make width and hwight 1.4en instead of 1.5em, the characters will 
align with the running text.




\defineframed
  [textcircled]
  [   width=1.4em,
 height=1.4em,
   location=low,
 corner=round,
%radius=.5fw,
 radius=\dimexpr\framedwidth/2\relax,
 offset=none]

\starttext
\dostepwiserecurse{0}{9}{1}{#1 = \textcircled{#1}\blank}
\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: Number in a circle

2024-05-27 Thread Wolfgang Schuster

Kip Warner schrieb am 27.05.2024 um 19:23:

On Mon, 2024-05-27 at 05:43 -0400, seyal zavira wrote:

if you don't want to use metapost you can also use svg for background
for example:

\startuniqueMPgraphic{centered_svg}
   draw lmt_svg [
     filename = "badge.svg",
     width  = OverlayWidth,
     y      = OverlayHeight/2,  ] ;
\stopuniqueMPgraphic

\defineoverlay
   [svgback]
   [\useMPgraphic{centered_svg}]

\defineframed[Sback][location=low,background=svgback,frame=off,offset=8pt]

\starttext
this is a sample \Sback{1} text
\stoptext


Hello Seyal,

This does work but it's a bit annoying that I have to create an SVG of
just a circle and store it somewhere. I'm fine with using MetaPost,
especially if it makes this easier, but I just don't know how.


You can use the \framed solution and modify it to use a metapost graphic 
as background, it also easy to replace the circle with a hexagon etc.


\startuseMPgraphic{textcircle}
draw fullcircle
xscaled OverlayWidth
yscaled OverlayWidth
withcolor OverlayLineColor ;
\stopuseMPgraphic

\defineoverlay[textcircle][\useMPgraphic{textcircle}]

\defineframed
  [textcircled]
  [  width=1.5em,
height=1.5em,
frame=off,
   background=textcircle,
 location=low,
   offset=none]

\starttext
\dostepwiserecurse{0}{9}{1}{#1 = \textcircled{#1}\blank}
\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: Number in a circle

2024-05-27 Thread Kip Warner
On Mon, 2024-05-27 at 19:28 +0200, Wolfgang Schuster wrote:
> TeX complains about the value ".5fw" for the radius key. Hans added
> last year the function to add new units to ConTeXt and I used it to
> set the radius to half of the width of the framed box.
> 
> Use the following version of the setup for the frame which works with
> older ConTeXt installations because it doesn't use the feature.
> 
> \defineframed
>    [textcircled]
>    [   width=1.5em,
>   height=1.5em,
>     location=low,
>   corner=round,
>  %radius=.5fw,
>   radius=\dimexpr\framedwidth/2\relax,
>   offset=none]
> 
> \starttext
> \dostepwiserecurse{0}{9}{1}{#1 = \textcircled{#1}\blank}
> \stoptext

Thank you kindly, Wolfgang. That worked perfectly.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: Number in a circle

2024-05-27 Thread Wolfgang Schuster

Kip Warner schrieb am 27.05.2024 um 19:10:

On Mon, 2024-05-27 at 16:51 +0200, Wolfgang Schuster wrote:

I can't provide a circle but I can give you a box with rounded
corners.

\defineframed
    [textcircled]
    [   width=1.5em,
   height=1.5em,
     location=low,
   corner=round,
   radius=.5fw,
   offset=none]

\starttext
\dostepwiserecurse{0}{9}{1}{#1 = \textcircled{#1}\blank}
\stoptext


Thanks Wolfgang. I gave it a try on https://context-on-web.eu/, but it
failed:

Dimensions can be in units of em, ex, in, pt, pc, cm, mm, dd, cc,
bp, dk, or54sp; but yours is a new one! I'll assume that you meant
to say pt, for printer's55points. two letters.

I'm not sure what it is referring to.


TeX complains about the value ".5fw" for the radius key. Hans added last 
year the function to add new units to ConTeXt and I used it to set the 
radius to half of the width of the framed box.


Use the following version of the setup for the frame which works with 
older ConTeXt installations because it doesn't use the feature.


\defineframed
  [textcircled]
  [   width=1.5em,
 height=1.5em,
   location=low,
 corner=round,
%radius=.5fw,
 radius=\dimexpr\framedwidth/2\relax,
 offset=none]

\starttext
\dostepwiserecurse{0}{9}{1}{#1 = \textcircled{#1}\blank}
\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: Number in a circle

2024-05-27 Thread Kip Warner
On Mon, 2024-05-27 at 05:43 -0400, seyal zavira wrote:
> if you don't want to use metapost you can also use svg for background
> for example:
> 
> \startuniqueMPgraphic{centered_svg}
>   draw lmt_svg [
>     filename = "badge.svg",
>     width  = OverlayWidth,
>     y      = OverlayHeight/2,  ] ;
> \stopuniqueMPgraphic
> 
> \defineoverlay
>   [svgback]
>   [\useMPgraphic{centered_svg}]
> 
> \defineframed[Sback][location=low,background=svgback,frame=off,offset
> =8pt]
> 
> \starttext
> this is a sample \Sback{1} text
> \stoptext

Hello Seyal,

This does work but it's a bit annoying that I have to create an SVG of
just a circle and store it somewhere. I'm fine with using MetaPost,
especially if it makes this easier, but I just don't know how.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: Number in a circle

2024-05-27 Thread Kip Warner
On Mon, 2024-05-27 at 07:09 +0200, Ryszard Kubiak wrote:
> Hi Kip,
> 
> You may try characters with Unicode slots from U+2460 upto U+2469.
> They mean circled digits and are available in many fonts.

Thanks Ryszard. Those would be perfect, except I can't get them to work
in ConTeXt. I tried using the \utfchar{0x2460} but it just displays the
number 1.

I am assuming it needs a font that supports it, but I'm not sure how to
switch to a supporting font just to typeset that character and then
revert back. Is there some way to define a macro?

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: Number in a circle

2024-05-27 Thread Kip Warner
On Mon, 2024-05-27 at 16:51 +0200, Wolfgang Schuster wrote:
> I can't provide a circle but I can give you a box with rounded
> corners.
> 
> \defineframed
>    [textcircled]
>    [   width=1.5em,
>   height=1.5em,
>     location=low,
>   corner=round,
>   radius=.5fw,
>   offset=none]
> 
> \starttext
> \dostepwiserecurse{0}{9}{1}{#1 = \textcircled{#1}\blank}
> \stoptext

Thanks Wolfgang. I gave it a try on https://context-on-web.eu/, but it
failed:

   Dimensions can be in units of em, ex, in, pt, pc, cm, mm, dd, cc,
   bp, dk, or54sp; but yours is a new one! I'll assume that you meant
   to say pt, for printer's55points. two letters.

I'm not sure what it is referring to.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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

2024-05-27 Thread Cron Daemon
receiving incremental file list
 ./
 ctan.lsr
 document-2.htm
 download-1.htm
 download-2.htm
 logo-ade.png
 logo-cts.png
 logo-pod.png
 rss.xml
 show-fil.pdf
 context/latest/
 context/latest/cont-lmt.zip
 context/latest/cont-mpd.zip
 context/latest/cont-ppc.zip
 context/latest/cont-sci.zip
 context/latest/cont-tmf.zip
 context/latest/cont-tst.7z
 context/latest/cont-tst.tar.xz
 context/latest/cont-tst.zip
 general/manuals/
 general/manuals/lowlevel-characters.pdf
 general/manuals/primitives.pdf
 general/qrcs/
 general/qrcs/setup-mapping-en.pdf
 general/qrcs/setup-mapping-it.pdf
 
 sent 190,872 bytes  received 45,199,940 bytes  3,631,264.96 bytes/sec
 total size is 582,177,943  speedup is 12.83


Running archiver:

New dir: /var/www/aanhet.net/context//htdocs/archives/context-2024-05-27.19
248173390   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-27.19/latest
126745317   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-27.19/current
374922803   
/var/www/aanhet.net/context//htdocs/archives/context-2024-05-27.19
374922803   total
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] Re: bug tracker

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

On 5/27/2024 3:46 PM, Peter Münster wrote:


Is there a bug tracker for ConTeXt?
(It seems, that https://tracker.luatex.org/ is no more used...)
just mail to the list as bugs are normally either solved fast or becoem 
features


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: Number in a circle

2024-05-27 Thread Wolfgang Schuster

Kip Warner schrieb am 27.05.2024 um 06:14:

Hello list,

I would like to typeset a number in a circle. Nothing fancy. No special
colours, transforms, or complex metapost magic (which I am not familiar
with).

I have tried \circled{3} and \textcircled{3}, but ConTeXt does not
appear to recognize these commands. Any help appreciated.


I can't provide a circle but I can give you a box with rounded corners.

\defineframed
  [textcircled]
  [   width=1.5em,
 height=1.5em,
   location=low,
 corner=round,
 radius=.5fw,
 offset=none]

\starttext
\dostepwiserecurse{0}{9}{1}{#1 = \textcircled{#1}\blank}
\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: How to Define a New Language

2024-05-27 Thread ai2472206007
Thanks for your reply, I found out that I just deleted the code 'default=cn', 
and it actually worked.

With just this code system can install the language normally, and then get the 
correct 'labeltext'.

%%%
\installlanguage [zh-tw] [patterns=cn]% install traditional chinese
%%%
___
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] bug tracker

2024-05-27 Thread Peter Münster
Hi,

Is there a bug tracker for ConTeXt?
(It seems, that https://tracker.luatex.org/ is no more used...)

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

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


[NTG-context] Re: Number in a circle

2024-05-27 Thread seyal zavira
if you don't want to use metapost you can also use svg for background
for example:

\startuniqueMPgraphic{centered_svg}
  draw lmt_svg [
filename = "badge.svg",
width  = OverlayWidth,
y  = OverlayHeight/2,  ] ;
\stopuniqueMPgraphic

\defineoverlay
  [svgback]
  [\useMPgraphic{centered_svg}]

\defineframed[Sback][location=low,background=svgback,frame=off,offset=8pt]

\starttext
this is a sample \Sback{1} text
\stoptext

On Mon, May 27, 2024 at 12:38 AM Kip Warner  wrote:

> Hello list,
>
> I would like to typeset a number in a circle. Nothing fancy. No special
> colours, transforms, or complex metapost magic (which I am not familiar
> with).
>
> I have tried \circled{3} and \textcircled{3}, but ConTeXt does not
> appear to recognize these commands. Any help appreciated.
>
> --
> Kip Warner
> OpenPGP signed/encrypted mail preferred
> https://www.thevertigo.com
>
> ___
> 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
>
> ___
>


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

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


[NTG-context] Re: Number in a circle

2024-05-26 Thread Ryszard Kubiak
Hi Kip,

You may try characters with Unicode slots from U+2460 upto U+2469. They
mean circled digits and are available in many fonts.

Best,
Ryszard

pon., 27 maj 2024 o 06:39 Kip Warner  napisał(a):

> Hello list,
>
> I would like to typeset a number in a circle. Nothing fancy. No special
> colours, transforms, or complex metapost magic (which I am not familiar
> with).
>
> I have tried \circled{3} and \textcircled{3}, but ConTeXt does not
> appear to recognize these commands. Any help appreciated.
>
> --
> Kip Warner
> OpenPGP signed/encrypted mail preferred
> https://www.thevertigo.com
>
> ___
> 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] Number in a circle

2024-05-26 Thread Kip Warner
Hello list,

I would like to typeset a number in a circle. Nothing fancy. No special
colours, transforms, or complex metapost magic (which I am not familiar
with). 

I have tried \circled{3} and \textcircled{3}, but ConTeXt does not
appear to recognize these commands. Any help appreciated.

-- 
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com


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: wrong font scaling in LMTX?

2024-05-26 Thread Pablo Rodriguez via ntg-context
On 5/26/24 20:50, Wolfgang Schuster wrote:
> [...]
> I get the same results with the default font mode in MkIV and LMTX but
> when I add
>
> \enableexperiments[fonts.compact]
>
> the x and xx sizes are wrong.

Many thanks for your reply, Wolfgang.

I tend to forget that I have always compact fonts enabled by default.

Only enabling or disabling it, compilation with sample goes from 2.6s
when enabled to 3.2s when disabled (using --purgeall)

Without your help, I would have been never detected this.

Many thanks for your help,

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

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


[NTG-context] Re: wrong font scaling in LMTX?

2024-05-26 Thread Wolfgang Schuster

Pablo Rodriguez via ntg-context schrieb am 26.05.2024 um 12:38:

Dear list,

I have the following sample:

\definefontfamily[mainface][rm][TeX Gyre Pagella]
\definefontfamily[mainface][ss][TeX Gyre Heros]
[scale=0.125]
\setupbodyfont[mainface]
\starttext
\startTEXpage[pagestate=start, offset=1em]
\rm a\ss a\\
{\rm a\ssd a}\\
{\rm a\ssx a}\\
{\rm a\ssxx a}
\stopTEXpage
\stoptext

Scaled \ssx and \ssxx are wrong in LMTX (not scaled at all).

All font sizes are scaled fine in MkIV.

In both cases, I‘m running latest from 2024.05.17 16:32.

Could anyone confirm the issue?


I get the same results with the default font mode in MkIV and LMTX but 
when I add


\enableexperiments[fonts.compact]

the x and xx sizes are wrong.

Wolfgang

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

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


[NTG-context] Re: page number

2024-05-26 Thread Wolfgang Schuster

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

Dear Wolfgang,

I have a book in preparation with running heads.


Pagenumber  marking   |marking  Pagenumber

The chapter title page has empty headings.

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

I have

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

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


Please send a complete working example next time.


Can anyone show me code to achieve this?


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

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


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

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

\definetext
  [chapterheader]
  [header]
  [pagenumber]

\setuphead
  [chapter]
  [header=chapterheader]

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

\stoptext
 end example

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

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


[NTG-context] wrong font scaling in LMTX?

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

I have the following sample:

\definefontfamily[mainface][rm][TeX Gyre Pagella]
\definefontfamily[mainface][ss][TeX Gyre Heros]
[scale=0.125]
\setupbodyfont[mainface]
\starttext
\startTEXpage[pagestate=start, offset=1em]
\rm a\ss a\\
{\rm a\ssd a}\\
{\rm a\ssx a}\\
{\rm a\ssxx a}
\stopTEXpage
\stoptext

Scaled \ssx and \ssxx are wrong in LMTX (not scaled at all).

All font sizes are scaled fine in MkIV.

In both cases, I‘m running latest from 2024.05.17 16:32.

Could anyone confirm the issue?

BTW, this is the first time I indent the sample sent to the list with a
single character (one tab) instead of two or four spaces.

If the sample is wrong displayed in the medium you use with the mailing
list, please tell me and I will go back to spaces instead of tabs.

Many thanks for your help,

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

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


[NTG-context] Re: page number

2024-05-26 Thread Mikael Sundqvist
Hi Charles,

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

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

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

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

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

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


[NTG-context] page number

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

I have a book in preparation with running heads.


Pagenumber  marking   |marking  Pagenumber

The chapter title page has empty headings. 

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

I have

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

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

Can anyone show me code to achieve this?

Thanks,
Charlie 



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

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


[NTG-context] Re: simplify side by side Poems

2024-05-25 Thread seyal . zavira
Thanks so much

i also could define poem structure like this:

Using table method: 
\protected\def\PoemStart#1\PoemStop
   {\bTABLE[setups=tablepoem]#1\eTABLE}
\protected\def\Beyt#1
   {\bTR #1 \eTR}
\protected\def\Misra#1
   {\bTD #1 \eTD}
   
\starttext
\PoemStart
\Beyt{\Misra{the first sentence}   \Misra{the second sentence}}
\Beyt{\Misra{the third sentence}   \Misra{the fourth sentence}}
\PoemStop
\stoptext

also it can be done with itemize(easier but less flexible):
\defineitemgroup[Mypoem]
\setupitemgroup[Mypoem][horizontal,two]

\protected\def\PoemStart#1\PoemStop
   {\startitemgroup[Mypoem]#1\stopitemgroup}
\protected\def\Misra#1
   {\startitem#1\stopitem}

\starttext
\PoemStart
\Misra{the first sentence}  \Misra{the second sentence}
\Misra{the third sentence}  \Misra{the fourth sentence}
\PoemStop
\stoptext

there is also another method by using buffers and lua code (part of the answer 
to my question on the stack site).
___
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: Problem with PNG images in the latest standalone version

2024-05-24 Thread Hajtmar Jaroslav
Thanks Wolfgang for the analysis and explanation. Both pictures are "not from 
my workshop" and I received them as background material. Moreover, I have 
reduced them a lot today for the purpose of sending them to the conference (I 
have reduced the quality a lot to reduce their size). Strangely, I have been 
translating documents with this image for several years with the old version of 
ConTeXt, so I was surprised that the new ConTeXt was not able to process them 
as I expected. Unfortunately, it didn't really occur to me that the problem 
might be with the image rather than ConTeXt, but the images were commonly 
displayed on several computers (Windows and OS X), and I didn't think to look 
at the log file.
Thanks again for the explanation and for the lesson, which I will certainly 
remember.
Have a nice day.
Jaroslav


> 24. 5. 2024 v 15:22, Wolfgang Schuster :
> 
> Hajtmar Jaroslav schrieb am 24.05.2024 um 13:48:
>> Hello, thanx for reply.
>> PNG and JPG files are available at the URL given, as well as PDF documents 
>> with the compilation results. The old ConTeXt seems to be able to embed PNGs 
>> from the local disk, but no longer from a remote address.
>> The new ConTeXt handles both local and remote PNG image in different ways.
> 
> I tested both of your images and I had a problem with the png-version as well 
> but when you look at the log-file you should find the following message:
> 
> graphics> inclusion > image 'gyzalogo-new.png' has bad dimensions 
> (0pt,0pt), discarding
> 
> My next step was to open the file with a image viewer which showed my the 
> file is a jpeg rather than a png, afterwards i changed the file extension 
> from png to jpg and it appears in my document.
> 
> The conclusion here is that somebody just changed the file extension to 
> *convert* the image from jpeg to png which of yourse is nonsense. Another 
> clue to notice there is something wrong is the size of both value because 
> there should be a difference between jpeg and png but both have the same file 
> size.
> 
> Wolfgang

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

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


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

2024-05-24 Thread Wolfgang Schuster

ai2472206...@yeah.net schrieb am 24.05.2024 um 16:39:

3. In general, it is enough to distinguish between Chinese Simplified Chinese 
and Chinese Traditional.

Chinese has a large number of Chinese characters, therefore the fonts produced 
are generally divided into Chinese Simplified and Chinese Traditional. This 
causes Chinese Simplified Chinese fonts to fail to display Chinese Traditional.

In addition to the differences in fonts, Chinese mainland, Taiwan(china), Hong 
Kong(china), etc. use different punctuation marks, expressions, etc. For example, Chinese 
mainland mainly uses "", while Taiwan may use 「」 more often. and the difference 
between the two Chinese expressions, such as when using labeltext.


There are also differences regarding punctuation marks between official 
documents from the government and universities etc. but this is 
something which can be changed in the document style.



While it's great to set up new languages at the system level, there is always 
the possibility that new languages will be added for one reason or another.

As far as Chinese is concerned, it has a very large number of dialects. We 
can't be fully integrated into the system. Opening up suitable interfaces to 
add new languages can reduce the cost of system maintenance.


The following should work with two main languages for simplified and 
traditional and local variant which fall back on both. The current 
chinese language can also be changed to the fallbacks.


\installlanguage [zh-hans] [..,..=..,..] % Simplified Chinese
\installlanguage [zh-hant] [..,..=..,..] % Traditional Chinese

\installlanguage [zh-cn] [zh-hans] % China
\installlanguage [zh-my] [zh-hans] % Malaysia
\installlanguage [zh-sg] [zh-hans] % Singapore

\installlanguage [zh-hk] [zh-hant] % Hong Kong
\installlanguage [zh-mo] [zh-hant] % Macau
\installlanguage [zh-tw] [zh-hant] % Taiwan


As far as I know, the characters used (Chinese Simplified, Chinese 
Traditional), the punctuation marks used (Chinese mainland, Taiwan, Hong Kong), 
and the expressions used (Chinese mainland, Taiwan, Hong Kong) are basically 
different between the dialects of Chinese. There is no hyphenation difference 
in any dialect.


I looked at the rules for linebreaking in chinese a while ago and even 
though there are a few guidelines there is no fixed list this. Many 
programs let you change the characters where a break is or isn't possible.



As far as I am currently using, the context is not very well set for 
localization, and there are many words in lang-txt.lua that have not been 
translated into Chinese. I think that as an ordinary user, it is very dangerous 
to modify information at the system level.


You're free to fill the missing entries.


Although, as a temporary alternative, we can use 'newif' or 'startmode' to add 
a new condition to accommodate both Chinese Simplified and Chinese Traditional 
in the same document. However, it would be nice to have support at the system 
level.

I don't know if I'm getting my point right. Because of the above, I used 
translation software to translate my thoughts.


To support both forms it is easier to have separate languages and 
linebreaking/font settings for each of them.


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

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


<    1   2   3   4   5   6   7   8   9   10   >