[NTG-context] [BUG] \registerexternalfigure doesn't work

2020-08-19 Thread Henri Menke
Dear list,

To get properties of a figure without actually typesetting it, it is
handy to use \registerexternalfigure.  However, trying to use it fails.
Consider the following MWE:

\starttext
\registerexternalfigure[cow.pdf]
\stoptext

Looking at the definition in grph-inc.mkiv reveals that is it complete
bogus.

\unexpanded\def\registerexternalfigure
  {\dotripleempty\grph_include_register}

\def\grph_include_register[#1][#2][#3]%
  {\startnointerference
 \c_grph_include_test_only
 \setfalse\c_grph_include_flush % == test ?
 \externalfigure[#1][#2][#3]% or
 \externalfigure[#1][#2,\c!display=,\c!mask=,\c!object=\v!no]%
   \stopnointerference}

I guess this is not intentional and was left over at some point.  Could
you please fix this?

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

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


Re: [NTG-context] TOC chapter and section numbering

2020-08-19 Thread Adrian
Excellent, this was the solution.  I'm certain to learn a great
deal from it.

Thanks again,

Adrian


Sent with ProtonMail Secure Email.

‐‐‐ Original Message ‐‐‐
On Wednesday, August 19, 2020 9:44 AM, Wolfgang Schuster 
 wrote:

> Adrian schrieb am 18.08.2020 um 06:40:
>
> > Hello,
> > I'm attempting to typeset a short book using ConTeXt
> > (current version: 2020.08.09 22:03).
> > EXAMPLE:
> > [...]
> > I would like all the chapters to be prefixed with "Chapter RN." and the
> > sections to keep a single count,
> > for example:
> > Chapter I. Introductory .
> >    1. The concept of a function
> >    2. Extension and intension
> >    3. Functions of several variables
> >    4. Abstraction
> > Chapter II. Lambda Conversion .
> >    5. Primitive symbols and formulas
> >    6. Conversion
> >    7. Fundamental theorems on well-formed formulas and on the normal form
> > I tried to the following for the chapters:
> > \defineconversion[church][Chapter \Romannumerals.\quad]
> > \setuphead[chapter][conversion=church]
> > Which appeared to generate the prefix correctly but it overlapped the
> > title.
>
> \setuplabeltext
> [en] [chapter=Chapter ]
>
> \defineresetset
> [default] [0,0,0] [1]
>
> \defineconversionset
> [section] [n,R,n] [n]
>
> \setuphead
> [chapter]
> [sectionconversionset=section,
> sectionstopper=.]
>
> \setuphead
> [section]
> [sectionsegments=section,
> sectionconversionset=section,
> sectionstopper=.]
>
> \setuphead
> [title]
> [alternative=middle,
> style=WORD]
>
> \setuplist
> [chapter]
> [label=yes,
> style=bold,
> width=fit,
> distance=\spaceamount]
>
> \setuplist
> [section]
> [margin=3em,
> width=1.5em]
>
> \starttext
>
> \completecontent
>
> ...
>
> \stoptext
>
> Wolfgang


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

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


[NTG-context] removing word in filtered XML

2020-08-19 Thread Pablo Rodriguez
Dear list,

I have the following sample:

  \startbuffer[demo]
  

  
This is
  One of the best a paragraph.
This is another paragraph.
This is another
  Two of the best paragraph.
This is another
  Three paragraph.
This is another
  Four of five paragraph.
  

  
  \stopbuffer

  \startxmlsetups xml:initialize
\xmlsetsetup{#1}{html}{xml:gen}
  \stopxmlsetups

  \xmlregistersetup{xml:initialize}

  \startxmlsetups xml:gen
 \xmlfilter{#1}{/**/div/command(xml:special)}
  \stopxmlsetups

  \startxmlsetups xml:special
%~ \startitem
\cldcontext{string.gsub(lxml.flush([[#1]]),
   " of the ", "")}\stopitem
  \stopxmlsetups

  \starttext
\xmlprocessbuffer{main}{demo}{}
  \stoptext

Is there any way to remove " of " and " of the " in the filtered content
(xml:special)?

Sorry, Lua code is crap for sure.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] TOC chapter and section numbering

2020-08-19 Thread Wolfgang Schuster

Adrian schrieb am 18.08.2020 um 06:40:

Hello,

I'm attempting to typeset a short book using ConTeXt 
(current version: 2020.08.09 22:03).


*EXAMPLE*:

[...]

I would like all the chapters to be prefixed with "Chapter RN." and the 
sections to keep a single count,

for example:

*Chapter I. Introductory .*
    1. The concept of a function
    2. Extension and intension
    3. Functions of several variables
    4. Abstraction
*Chapter II. Lambda Conversion .*
    5. Primitive symbols and formulas
    6. Conversion
    7. Fundamental theorems on well-formed formulas and on the normal form

I tried to the following for the chapters:

\defineconversion[church][Chapter \Romannumerals.\quad]
\setuphead[chapter][conversion=church]

Which appeared to generate the prefix correctly but it overlapped the 
title.


\setuplabeltext
  [en] [chapter=Chapter ]

\defineresetset
  [default] [0,0,0] [1]

\defineconversionset
  [section] [n,R,n] [n]

\setuphead
  [chapter]
  [sectionconversionset=section,
   sectionstopper=.]

\setuphead
  [section]
  [sectionsegments=section,
   sectionconversionset=section,
   sectionstopper=.]

\setuphead
  [title]
  [alternative=middle,
   style=WORD]

\setuplist
  [chapter]
  [label=yes,
   style=bold,
   width=fit,
   distance=\spaceamount]

\setuplist
  [section]
  [margin=3em,
   width=1.5em]

\starttext

\completecontent

...

\stoptext

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

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