Re: [NTG-context] \startuserdata syntax questions

2018-08-29 Thread Hans Hagen

On 8/28/2018 10:40 PM, Rik Kabel wrote:

Wolfgang, Hans, et al,

The new \startuserdata macro looks very promising, and can simplify some 
work I have in progress.


The first question: the wiki example and the source use

\userparameter{optionkey}
\userparameter{anotherkey}

to retrieve the value of optionkey and anotherkey. Is there a way to 
provide the key/value pairs in a manner that they can be retrieved with 
the getparameters mechanism, as:


\getrawparameters [XX] [optionkey=,anotherkey=,#1]

This has the added advantage of allowing the setting of a default value, as

\getrawparameters [XX] [optionkey=2em,anotherkey=,#1]

Or is there a reason not to use getparameters in this setting?


hardly any of the core mechanisms in mkiv uses get(raw)parameters

define a category and then clone it ...

The second question: Is there the possibility to enhance the syntax so 
that one can write


\startMyStuff [optionalkey=value, anotherkey=value]
     stuff
\stopMyStuff

instead of

\startuserdata [MyStuff] [optionalkey=value, anotherkey=value]
stuff
\stopuserdata

Such syntactic sugar makes sweeter reading of the text, and makes 
clearer what is being done when nesting the macro.
for such Named environments there are probably other alternatives 
(depending on what you need it for), like blocks


also, user dat picks up its content (they're buffers) so that would also 
mean more nested buffers .. it's meant as a simple mechanism


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] Emacs + latest beta

2018-08-29 Thread Fabrice Couvreur
Hello,
Before considering modifications, here's what I get when I do which context
:

Setting "/home/aragorn/context/tex" as ConTeXt root.
[aragorn@fab ~]$ which context
/home/aragorn/context/tex/texmf-linux-64/bin/context
[aragorn@fab ~]$

$ pacman -Qs texlive
>

 [root@fab aragorn]# pacman -Qs texlive
[root@fab aragorn]#

$ pacman -Qs emacs
>

 [root@fab aragorn]# pacman -Qs emacs
local/emacs 26.1-2
The extensible, customizable, self-documenting real-time display editor
local/emacs-python-mode 6.2.3-1
Python mode for Emacs
[root@fab aragorn]#

you mentioned that commands run in terminal worked fine, but you
>   invoked them by full path;
>


To be able to test with the
texlive context binary and context standalone context binary
.


The next in the next message after restarting my PC ...

Fabrice


Le mer. 29 août 2018 à 04:58, Vladimir Lomov  a écrit :

> Hello,
> ** Fabrice Couvreur [2018-08-28 11:18:58 +0200]:
>
> > Hi Vladimir,
>
> > I do not use Arch Linux repositories to install  texlive 2018 packages
>
> Some texlive-* packages could be installed as dependencies of other
> packages. You may check if your system has any texlive package:
>
>   $ pacman -Qs texlive
>
> > but I installed texlive 2018 "scheme-full" with tlmgr -gui  in
> > /home/aragorn /texlive/2018.  I then make regular updates in the same
> > way. No texlive traces in the \usr\share\ directory or elsewhere.
>
> I prefer to rely on package manager.
>
> > Standalone Context is also installed in my home directory. However,
> > Emacs is installed from the Arch Linux repositories and is located in
> > /usr/share/emacs.
>
>   $ pacman -Qs emacs
>
> > So I have to add the path of texlive 2018 ?
> > Maybe you do not need to add the Context Standalone path ?
> > My ~/.profile file would be this :
> >
> > source /home/aragorn/context/tex/setuptex
> > export PATH = $ PATH: /home/aragorn/texlive/2018/bin/x86_64-linux
> > export PATH = $ PATH: /home/aragorn /bin
>
> This part is a bit strange:
> - in message
>   https://mailman.ntg.nl/pipermail/ntg-context/2018/092418.html
>   you mentioned that commands run in terminal worked fine, but you
>   invoked them by full path;
>
> - in the same message you set PATH in emacs as
>
> (setenv "PATH" "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)
>
>   (I have to admit that I didn't know it is possible to use '$PATH' in
>   setenv), so it prepends path to context binary to PATH list. The above
>   lines do opposite: they append path to context binary to the end of
>   PATH list.
>
>   The first line, 'source ...', helps here because 'setuptex' in turns
>   prepend path to context binary to PATH.
>
> When you invoke 'context' in terminal (I assume it is bash shell) the
> shell searches program in current directory (depends on configuration)
> and then in PATH, the first wins. So to use context from ConTeXt
> standalone you may simply do
>
>   $ export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH
>
> either in terminal or in ~/.profile. You may always check if this is
> true by runnig
>
>   $ command -v context
>
> (for bash shell) or
>
>   $ which context
>
> Returning to your problem. I looked closely again in messages with
> output from context and I don't understand what may cause the error.
> Seems that Emacs uses correct context (according to loading files).
> Could you show in full your ~/.emacs file? Do you use AUCTeX or bare
> Emacs?
>
> > Regards,
> > Fabrice
> >
>
> [...]
>
> ---
> WBR, Vladimir Lomov
>
>
> --
> Uncontrolled power will turn even saints into savages.  And we can all
> be counted on to live down to our lowest impulses.
> -- Parmen, "Plato's Stepchildren", stardate 5784.3
>
> ___
> 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
>
> ___
___
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] Emacs + latest beta

2018-08-29 Thread Fabrice Couvreur
Hello,
Here is the content of my file ~/.profile :

export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH
export PATH=$HOME/texlive/2018/bin/x86_64-linux:$PATH
export PATH=$HOME/bin:$PATH

$ command -v context
>

 [aragorn@fab ~]$  command -v context
/home/aragorn/texlive/2018/bin/x86_64-linux/context
[aragorn@fab ~]$

I then tested the vladimir.tex file



\setupsynctex[state=start]

\startusableMPgraphic{NumberHead}
  draw outlinetext.f
  ("\bf\namedheadnumber{chapter}")
  (withcolor "blue")
  ysized 50pt ;
\stopusableMPgraphic

\unexpanded\def\processMPheadnumber#1%
  {\useMPgraphic{NumberHead}}

\setuphead%
[chapter]%
[command=\HeadTitle,%
 headstyle=\ss,%
 numbercommand=\processMPheadnumber]

\unexpanded\def\HeadTitle#1#2%
{\framed%
  [frame=off,%
bottomframe=on,%
width=broad,
align={broad,nothyphenated,left}]%
{#1\blank[nowhite]#2}}

\starttext
\startchapter[title=First chapter]
  \input ward
\stopchapter
\stoptext
~/

% Local Variables:
% mode: context
% TeX-master: t
% End:

Here is the output vladimi
r
.output


Running `ConTeXt' on `vladimir' with
``PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context
--purgeall vladimir''
resolvers   | trees | analyzing 'home:texmf'
mtx-context | warning: no (local) file './vladimir', proceeding
mtx-context | run 1: luatex
--fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
--jobname="vladimir"
--lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
--no-parse-first-line --c:currentrun=1 --c:fulljobname="./vladimir"
--c:input="./vladimir" --c:kindofrun=1 --c:maxnofruns=9 --c:purgeall
"cont-yes.mkiv"

This is LuaTeX, Version 1.08.0 (TeX Live 2018)
 system commands enabled.

resolvers   > trees > analyzing 'home:texmf'
open source > level 1, order 1, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system  >
system  > ConTeXt  ver: 2018.08.25 10:04 MKIV beta  fmt: 2018.8.25
int: english/english
system  >
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 2, order 2, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > files > jobname 'vladimir', input './vladimir', result
'vladimir'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name '/home/aragorn/vladimir.tex'
system  > synctex functionality is enabled, expect 5-10 pct runtime
overhead!
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded
structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
metapost> initializing instance 'metafun:1' using format 'metafun'
and method 'default'
metapost> loading 'metafun' as
'/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
using method 'default'
metapost> initializing number mode 'scaled'
open source > level 3, order 4, name
'/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
close source> level 3, order 4, name
'/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
backend > xmp > using file
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
close source> level 2, order 4, name '/home/aragorn/vladimir.tex'
close source> level 1, order 4, name
'/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'

mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path:
/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.008 seconds, 1 scans with
scantime 0.000 seconds, 0 shared scans, 31 found files, scanned paths:
/home/aragorn/texmf
mkiv lua stats  > stored bytecode data: 437 modules (0.227 sec), 93 tables
(0.015 sec), 530 chunks (0.241 sec)
mkiv lua stats  > traced context: maxstack: 1328, freed: 5, unreachable:
1323
mkiv lua stats  > cleaned up reserved nodes: 58 nodes, 9 lists of 455
mkiv lua stats  > node memory usage: 2 glue, 2 kern, 2 penalty, 14
attribute, 50 glue_spec, 4 attribute_list, 2 temp, 2 user_defined
mkiv lua stats  > node list callback tasks: 8 unique task lists, 6
instances (re)created, 55 calls
mkiv lua stats  > synctex tracing: 2 referenced files, 5 files ignored, 3
objects flushed, logfile: vladimir.synctex
mkiv lua stats  > used backend: pdf (backend for directly generating pdf
output)
mkiv lua stats  > jobdata time: 0.001 seconds 

Re: [NTG-context] Emacs + latest beta

2018-08-29 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2018-08-29 11:39:07 +0200]:

> Hello,
> Before considering modifications, here's what I get when I do which context
> :
> 
> Setting "/home/aragorn/context/tex" as ConTeXt root.
> [aragorn@fab ~]$ which context
> /home/aragorn/context/tex/texmf-linux-64/bin/context
> [aragorn@fab ~]$

Ok, context from ConTeXt Standalone.

> $ pacman -Qs texlive

Ok, your system doesn't have any texlive packages.

> 
>  [root@fab aragorn]# pacman -Qs texlive
> [root@fab aragorn]#

Running commands as root is a bit dangerous.

> $ pacman -Qs emacs
>
> 
>  [root@fab aragorn]# pacman -Qs emacs
> local/emacs 26.1-2
> The extensible, customizable, self-documenting real-time display editor
> local/emacs-python-mode 6.2.3-1
> Python mode for Emacs
> [root@fab aragorn]#

Your system has only these two packages.

> you mentioned that commands run in terminal worked fine, but you
> >   invoked them by full path;
> >
> 
> 
> To be able to test with the
> texlive context binary and context standalone context binary
> .

Got it.

> 
> 
> The next in the next message after restarting my PC ...
> 
> Fabrice

[..]

---
WBR, Vladimir Lomov

-- 
I think that I shall never see
A thing as lovely as a tree.
But as you see the trees have gone
They went this morning with the dawn.
A logging firm from out of town
Came and chopped the trees all down.
But I will trick those dirty skunks
And write a brand new poem called 'Trunks'.


signature.asc
Description: PGP signature
___
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] Emacs + latest beta

2018-08-29 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2018-08-29 12:01:46 +0200]:

> Hello,
> Here is the content of my file ~/.profile :
> 
> export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH
> export PATH=$HOME/texlive/2018/bin/x86_64-linux:$PATH
> export PATH=$HOME/bin:$PATH
> 
>> $ command -v context
> 
>  [aragorn@fab ~]$  command -v context
> /home/aragorn/texlive/2018/bin/x86_64-linux/context
> [aragorn@fab ~]$

And this means that when you run 'context' in shell (terminal) the
context from TeX Live will be used. Note the above 'export' commands.
The first prepend the path to ConTeXt Standalone binaries, the next on
prepends TeX Live binaries, so TeX Live binaries will be used if you run
'context' in terminal/shell.

> I then tested the vladimir.tex file
> 
> \setupsynctex[state=start]
> 
> \startusableMPgraphic{NumberHead}
>   draw outlinetext.f
>   ("\bf\namedheadnumber{chapter}")
>   (withcolor "blue")
>   ysized 50pt ;
> \stopusableMPgraphic
> 
> \unexpanded\def\processMPheadnumber#1%
>   {\useMPgraphic{NumberHead}}
> 
> \setuphead%
> [chapter]%
> [command=\HeadTitle,%
>  headstyle=\ss,%
>  numbercommand=\processMPheadnumber]
> 
> \unexpanded\def\HeadTitle#1#2%
> {\framed%
>   [frame=off,%
> bottomframe=on,%
> width=broad,
> align={broad,nothyphenated,left}]%
> {#1\blank[nowhite]#2}}
> 
> \starttext
> \startchapter[title=First chapter]
>   \input ward
> \stopchapter
> \stoptext
> ~/
> 
> % Local Variables:
> % mode: context
> % TeX-master: t
> % End:
> 
> Here is the output vladimir output

I suppose this is from within Emacs.

> 
> Running `ConTeXt' on `vladimir' with
> ``PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context
> --purgeall vladimir''
> resolvers   | trees | analyzing 'home:texmf'
> mtx-context | warning: no (local) file './vladimir', proceeding
> mtx-context | run 1: luatex
> --fmt="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
> --jobname="vladimir"
> --lua="/home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
> --no-parse-first-line --c:currentrun=1 --c:fulljobname="./vladimir"
> --c:input="./vladimir" --c:kindofrun=1 --c:maxnofruns=9 --c:purgeall
> "cont-yes.mkiv"
> 
> This is LuaTeX, Version 1.08.0 (TeX Live 2018)
>  system commands enabled.
> 
> resolvers   > trees > analyzing 'home:texmf'
> open source > level 1, order 1, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
> system  >
> system  > ConTeXt  ver: 2018.08.25 10:04 MKIV beta  fmt: 2018.8.25
> int: english/english
> system  >
> system  > 'cont-new.mkiv' loaded
> open source > level 2, order 2, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
> system  > beware: some patches loaded from cont-new.mkiv
> close source> level 2, order 2, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
> system  > files > jobname 'vladimir', input './vladimir', result
> 'vladimir'
> fonts   > latin modern fonts are not preloaded
> languages   > language 'en' is active
> open source > level 2, order 3, name '/home/aragorn/vladimir.tex'
> system  > synctex functionality is enabled, expect 5-10 pct runtime
> overhead!
> fonts   > preloading latin modern fonts (second stage)
> fonts   > 'fallback modern-designsize rm 12pt' is loaded
> structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
> metapost> initializing instance 'metafun:1' using format 'metafun'
> and method 'default'
> metapost> loading 'metafun' as
> '/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
> using method 'default'
> metapost> initializing number mode 'scaled'
> open source > level 3, order 4, name
> '/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
> close source> level 3, order 4, name
> '/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
> backend > xmp > using file
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
> pages   > flushing realpage 1, userpage 1, subpage 1
> close source> level 2, order 4, name '/home/aragorn/vladimir.tex'
> close source> level 1, order 4, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
> 
> mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
> mkiv lua stats  > used cache path:
> /home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
> mkiv lua stats  > resource resolver: loadtime 0.008 seconds, 1 scans with
> scantime 0.000 seconds, 0 shared scans, 31 found files, scanned paths:
> /home/aragorn/texmf
> mkiv lua stats  > stored bytecode data: 437 modules (0.227 sec), 93 tables
> (0.015 sec), 530 chunks

Re: [NTG-context] \startuserdata syntax questions

2018-08-29 Thread Wolfgang Schuster



Hans Hagen schrieb am 29.08.18 um 09:15:

On 8/28/2018 10:40 PM, Rik Kabel wrote:

Wolfgang, Hans, et al,

The new \startuserdata macro looks very promising, and can simplify 
some work I have in progress.


The first question: the wiki example and the source use

\userparameter{optionkey}
\userparameter{anotherkey}

to retrieve the value of optionkey and anotherkey. Is there a way to 
provide the key/value pairs in a manner that they can be retrieved 
with the getparameters mechanism, as:


\getrawparameters [XX] [optionkey=,anotherkey=,#1]

This has the added advantage of allowing the setting of a default 
value, as


\getrawparameters [XX] [optionkey=2em,anotherkey=,#1]

Or is there a reason not to use getparameters in this setting?


hardly any of the core mechanisms in mkiv uses get(raw)parameters

define a category and then clone it ... 


\defineuserdata [rik] [name=Rik,alternative=rik]

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

\startsetups [userdata:rik]
\starttabulate[|l|p|]
\NC \userdataparameter{name} \NC \getuserdata \NC\NR
\stoptabulate
\stopsetups

\starttext

\startuserdata [rik]
\samplefile{greenfield}
\stopuserdata

\startuserdata [rik] [name=Greenfield]
\samplefile{greenfield}
\stopuserdata

\stoptext

The second question: Is there the possibility to enhance the syntax so 
that one can write


\startMyStuff [optionalkey=value, anotherkey=value]
 stuff
\stopMyStuff

instead of

\startuserdata [MyStuff] [optionalkey=value, anotherkey=value]
stuff
\stopuserdata


I can generated environment commands but I haven’t done this at the 
beginning because I prefer to pass the name of the environment as 
argument because this allows me to check if the used instance exists.


Such syntactic sugar makes sweeter reading of the text, and makes 
clearer what is being done when nesting the macro.
for such Named environments there are probably other alternatives 
(depending on what you need it for), like blocks


also, user dat picks up its content (they're buffers) so that would 
also mean more nested buffers .. it's meant as a simple mechanism


Yes, the environment is meant for short blocks of text (e.g. a 
blockquote) where you have to set different texts (e.g. the name of a 
author) for each use of the environment.


I thought about adding a switch to change between buffer mode and normal 
start/stop commands which work like the startstop environment but it 
wasn’t worth the effort.


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 and reinstating xmlsetup's

2018-08-29 Thread Hans van der Meer
Doing:  \xmlremovesetup{SETUP}
does not seems to have an effect.

Is it possible to deactivate a xml setup and reinstate at at a later point in 
time?

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 / 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] \startuserdata syntax questions

2018-08-29 Thread Rik Kabel

On 8/29/2018 11:19, Wolfgang Schuster wrote:



Hans Hagen schrieb am 29.08.18 um 09:15:

On 8/28/2018 10:40 PM, Rik Kabel wrote:

Wolfgang, Hans, et al,

The new \startuserdata macro looks very promising, and can simplify 
some work I have in progress.


The first question: the wiki example and the source use

    \userparameter{optionkey}
    \userparameter{anotherkey}

to retrieve the value of optionkey and anotherkey. Is there a way to 
provide the key/value pairs in a manner that they can be retrieved 
with the getparameters mechanism, as:


    \getrawparameters [XX] [optionkey=,anotherkey=,#1]

This has the added advantage of allowing the setting of a default 
value, as


    \getrawparameters [XX] [optionkey=2em,anotherkey=,#1]

Or is there a reason not to use getparameters in this setting?


hardly any of the core mechanisms in mkiv uses get(raw)parameters

define a category and then clone it ... 


\defineuserdata [rik] [name=Rik,alternative=rik]

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

\startsetups [userdata:rik]
    \starttabulate[|l|p|]
    \NC \userdataparameter{name} \NC \getuserdata \NC\NR
    \stoptabulate
\stopsetups

\starttext

\startuserdata [rik]
\samplefile{greenfield}
\stopuserdata

\startuserdata [rik] [name=Greenfield]
\samplefile{greenfield}
\stopuserdata

\stoptext



Ahh, that does nicely to set defaults. Thank you.

The second question: Is there the possibility to enhance the syntax 
so that one can write


    \startMyStuff [optionalkey=value, anotherkey=value]
 stuff
    \stopMyStuff

instead of

    \startuserdata [MyStuff] [optionalkey=value, anotherkey=value]
    stuff
    \stopuserdata


I can generated environment commands but I haven’t done this at the 
beginning because I prefer to pass the name of the environment as 
argument because this allows me to check if the used instance exists.


Such syntactic sugar makes sweeter reading of the text, and makes 
clearer what is being done when nesting the macro.
for such Named environments there are probably other alternatives 
(depending on what you need it for), like blocks


also, user dat picks up its content (they're buffers) so that would 
also mean more nested buffers .. it's meant as a simple mechanism


Yes, the environment is meant for short blocks of text (e.g. a 
blockquote) where you have to set different texts (e.g. the name of a 
author) for each use of the environment.


I thought about adding a switch to change between buffer mode and 
normal start/stop commands which work like the startstop environment 
but it wasn’t worth the effort.




Very well. It is what it is. The ability to set defaults goes a long way.


Wolfgang


--
Rik


___
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] \startuserdata syntax questions

2018-08-29 Thread Aditya Mahajan

On Wed, 29 Aug 2018, Wolfgang Schuster wrote:

The second question: Is there the possibility to enhance the syntax so 
that one can write


\startMyStuff [optionalkey=value, anotherkey=value]
 stuff
\stopMyStuff

instead of

\startuserdata [MyStuff] [optionalkey=value, anotherkey=value]
stuff
\stopuserdata


I can generated environment commands but I haven’t done this at the 
beginning because I prefer to pass the name of the environment as 
argument because this allows me to check if the used instance exists.


Perhaps adding a `command=yes` key, which can be set to `no` by default.

Aditya___
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] protrusion with opening exclamation and question marks

2018-08-29 Thread Pablo Rodriguez
Hi Hans,

I have the following sample:

\definefontfeature[default][default]
[protrusion=quality]

\setupxtable[frame=off, option=stretch]

\startbuffer[standard]
¿Cómo?

¡No!
\stopbuffer

\startbuffer[right]
\hfill¿Cómo?

\hfill¡No!
\stopbuffer

\starttext
\startTEXpage[offset=2em]
\startembeddedxtable[framecolor=red, align=hanging,
foregroundstyle={\ss\bfd}, offset=overlay]
\startxrow
\startxcell[leftframe=on] \getbuffer[standard]\stopxcell
\stopxrow
\startxrow[toffset=2em]
\startxcell[rightframe=on] \getbuffer[right]\stopxcell
\startxcell[rightframe=on, align=nothanging]
\getbuffer[right]\stopxcell
\stopxrow
\stopembeddedxtable
\stopTEXpage
\stoptext

It shows that question and exclamation marks are sligtly protruded.

Well, in Spanish (and Galician in some ortographies) there are opening
exclamation and quotation marks.

I think it would make sense to have the same protrusion values for
opening quotation and exclamation marks as for the closing ones.

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
___

[NTG-context] about character expansion

2018-08-29 Thread Pablo Rodriguez
Dear list,

I would like to introduce character expansion to novice users.

I know that ConTeXt adds values automatically.

But I’m interested in showing extremely stretched and shrinked
characters, as an example of character expansion done wrong.

Sorry for not providing a minimal example, but I don’t have any idea
about how to achieve that.

Does anyone know how to do it?

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] removing and reinstating xmlsetup's

2018-08-29 Thread Hans Hagen

On 8/29/2018 5:54 PM, Hans van der Meer wrote:

Doing: \xmlremovesetup{SETUP}
does not seems to have an effect.

Is it possible to deactivate a xml setup and reinstate at at a later 
point in time?

normally one uses modes for that (inside the setup)

ir you can decide for explicit filtering (\xmlfilter)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] protrusion with opening exclamation and question marks

2018-08-29 Thread Hans Hagen

On 8/29/2018 10:12 PM, Pablo Rodriguez wrote:

Hi Hans,

I have the following sample:

 \definefontfeature[default][default]
 [protrusion=quality]

 \setupxtable[frame=off, option=stretch]

 \startbuffer[standard]
 ¿Cómo?

 ¡No!
 \stopbuffer

 \startbuffer[right]
 \hfill¿Cómo?

 \hfill¡No!
 \stopbuffer

 \starttext
 \startTEXpage[offset=2em]
 \startembeddedxtable[framecolor=red, align=hanging,
 foregroundstyle={\ss\bfd}, offset=overlay]
 \startxrow
 \startxcell[leftframe=on] \getbuffer[standard]\stopxcell
 \stopxrow
 \startxrow[toffset=2em]
 \startxcell[rightframe=on] \getbuffer[right]\stopxcell
 \startxcell[rightframe=on, align=nothanging]
 \getbuffer[right]\stopxcell
 \stopxrow
 \stopembeddedxtable
 \stopTEXpage
 \stoptext

It shows that question and exclamation marks are sligtly protruded.

Well, in Spanish (and Galician in some ortographies) there are opening
exclamation and quotation marks.

I think it would make sense to have the same protrusion values for
opening quotation and exclamation marks as for the closing ones.

you need to patch font-imp-quality.lua:

vectors['punctuation'] = {

[0x003F] = { 0,0.20 }, -- ?
[0x00BF] = { 0.20, 0}, -- ¿
[0x0021] = { 0,0.20 }, -- !
[0x00A1] = { 0.20, 0,   }, -- ¡





-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] about character expansion

2018-08-29 Thread Henri Menke
See also “8.9 Expansion” in
http://www.pragma-ade.nl/general/manuals/fonts-mkiv.pdf


\setupfontexpansion
  [extremehz]
  [stretch=50,shrink=50,step=.5,vector=default,factor=1]

\definefontfeature
  [default]
  [default]
  [expansion=extremehz]

\starttext

\setupalign[hz]
\input{knuth}

\stoptext

On 30/08/18 08:20, Pablo Rodriguez wrote:
> Dear list,
> 
> I would like to introduce character expansion to novice users.
> 
> I know that ConTeXt adds values automatically.
> 
> But I’m interested in showing extremely stretched and shrinked
> characters, as an example of character expansion done wrong.
> 
> Sorry for not providing a minimal example, but I don’t have any idea
> about how to achieve that.
> 
> Does anyone know how 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 / 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
___