Re: [NTG-context] Language dependency in environment-project file

2018-11-27 Thread Marco Patzer
On Tue, 27 Nov 2018 22:41:25 +0100
Wolfgang Schuster  wrote:

> > With named setups I need to specify a name for each occurrence and
> > gather them at the end. This is not as clean. Is it possible e.g. to
> > add something to an already existing setup instead of creating a new
> > one every time?  
> 
> No, this is only possible with a token list.

Works perfectly.

Your first solution is technically better since it works even if the
language is changed mid document (something not used in this
project). However, the second solution is cleaner. I'll make up my mind.

Thanks for the quick help.

Marco
___
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] Grammar to parse TeX input?

2018-11-27 Thread Joseph Canedo
I’ve tried context.processbuffer but I am afraid it’s not what I am after, most 
probably I have not phrased clearly my question.

What I am looking for is roughly what’s described in Taco’s presentation 
https://meeting.contextgarden.net/2014/talks/2014-09-12-taco-luatex/luatextalk.pdf
A way to decompose some input into tokens which represent either normal text, 
csnames etc…  I had a try to this token library in LuaTeX but I could not find 
examples of how to use it. I suspect that buffers mechanism use it somehow.

Thanks

De : Hans Hagen
Envoyé le :lundi 26 novembre 2018 18:55
À : mailing list for ConTeXt users; Joseph Canedo
Objet :Re: [NTG-context] Grammar to parse TeX input?

On 11/26/2018 3:19 PM, Joseph Canedo wrote:
> \startluacode
> 
> function zzz_function(text)
> 
> - How to process ‘text’ to get bits which are macros, groups etc… ? 
> Eventually expanded ?
> 
> end
> 
> \stopluacode
> 
> \definebuffer[ZZZBuffer]
> 
> \def\StartZZZ{\grabbufferdata[ZZZBuffer][StartZZZ][StopZZZ]}
> 
> \def\StopZZZ{\ctxlua{zzz_function(buffers.getcontent('ZZZBuffer'))}}
> 
> \StartZZZ
> 
> \input knuth
> 
> \StopZZZ
context.processbuffer { "ZZZBuffer" }

-
   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] can \REGISTER[key]{term} modify typesetting (adding space)?

2018-11-27 Thread Wolfgang Schuster



Rik Kabel schrieb am 27.11.18 um 22:27:
What is unexpected is that the space does not appear in the body 
(non-footnote) text of the second paragraph. The difference between 
handling in notes and in body text seems discordant.


\startparagraph does *not* start a paragraph.


In the two paragraphs in the following example it is always the word 
“Text” which start the paragraph.


\setuppapersize[A9]

\starttext

\index{Strumpf}
Text

\startparagraph
\index{Strumpf}
Text
\stopparagraph

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

Re: [NTG-context] Language dependency in environment-project file

2018-11-27 Thread Wolfgang Schuster



Marco Patzer schrieb am 27.11.18 um 22:23:

On Tue, 27 Nov 2018 22:05:27 +0100
Wolfgang Schuster  wrote:


But even your solution doesn't work here. Did you try it in the
example project file?

\startenvironment [*]

\startsetups [itemgroup:en]
    \setupitemgroup [itemize] [i]
\stopsetups

\startsetups [itemgroup:sv]
    \setupitemgroup [itemize] [a]
\stopsetups

\setuplanguage
    [en]
    [setups=itemgroup:en]

\setuplanguage
    [sv]
    [setups=itemgroup:sv]

\appendtoks
\doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}
\to \everysetupdocument

\stopenvironment

That works, thanks.

One more question: I used to use modes, since I could just

   \startmode[*en]
 …
   \stopmode

any number of times. There are many language dependent settings in
the environment files.

With named setups I need to specify a name for each occurrence and
gather them at the end. This is not as clean. Is it possible e.g. to
add something to an already existing setup instead of creating a new
one every time?


No, this is only possible with a token list.


\startenvironment [*]

\newtoks\EnglishSettings
\newtoks\SwedishSettings

\appendtoks
  \setupitemgroup [itemize] [i]
\to \EnglishSettings

\appendtoks
  \setupitemgroup [itemize] [a]
\to \SwedishSettings

% the order of the following settings is important because you have
% to set the language before you can make the language dependant
% mode setting

\appendtoks
\doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}
\to \everysetupdocument

\appendtoks
  \startmodeset
    [**en] {\flushtoks\EnglishSettings}
    [**sv] {\flushtoks\SwedishSettings}
  \stopmodeset
\to \everysetupdocument

\stopenvironment


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
___

Re: [NTG-context] can \REGISTER[key]{term} modify typesetting (adding space)?

2018-11-27 Thread Rik Kabel

On 11/27/2018 16:12, Wolfgang Schuster wrote:

The space after the register entry is only ignored when you put it
before the start of a paragraph because ConTeXt saves the content
and flushes it at the start of the next paragraph.

When the register entry appear within in a paragraph or when TeX
is in horizontal mode (like in your footnote) the space after the argument
stays and appears in the text. In this case you have to put a comment
after it to ignore the space which is generated from the line break in 
your

document.

Wolfgang


Rik Kabel schrieb am 27.11.18 um 21:17:


And now I can construct it, so here is a not-necessarily-minimal 
example. Note that the problem occurs in footnotes (and endnotes, 
left as an exercise to the curious).


\setuppapersize[A9]
\starttext
\startparagraph
Text
\startfootnote
Text
\stopfootnote
\stopparagraph
\startparagraph
\index{Strumpf}
Text
\startfootnote
\index{Strumpf}
Text
\stopfootnote
\stopparagraph\startparagraph
Text
\startfootnote
\index{Strumpf}%
Text
\stopfootnote
\stopparagraph
\stoptext

With the result:

What is unexpected is that the space does not appear in the body 
(non-footnote) text of the second paragraph. The difference between 
handling in notes and in body text seems discordant.


--
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] Language dependency in environment-project file

2018-11-27 Thread Marco Patzer
On Tue, 27 Nov 2018 22:05:27 +0100
Wolfgang Schuster  wrote:

> > But even your solution doesn't work here. Did you try it in the
> > example project file?  
> 
> \startenvironment [*]
> 
> \startsetups [itemgroup:en]
>    \setupitemgroup [itemize] [i]
> \stopsetups
> 
> \startsetups [itemgroup:sv]
>    \setupitemgroup [itemize] [a]
> \stopsetups
> 
> \setuplanguage
>    [en]
>    [setups=itemgroup:en]
> 
> \setuplanguage
>    [sv]
>    [setups=itemgroup:sv]
> 
> \appendtoks
> \doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}
> \to \everysetupdocument
> 
> \stopenvironment

That works, thanks.

One more question: I used to use modes, since I could just

  \startmode[*en]
…
  \stopmode

any number of times. There are many language dependent settings in
the environment files.

With named setups I need to specify a name for each occurrence and
gather them at the end. This is not as clean. Is it possible e.g. to
add something to an already existing setup instead of creating a new
one every time?

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

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

Re: [NTG-context] can \REGISTER[key]{term} modify typesetting (adding space)?

2018-11-27 Thread Wolfgang Schuster

The space after the register entry is only ignored when you put it
before the start of a paragraph because ConTeXt saves the content
and flushes it at the start of the next paragraph.

When the register entry appear within in a paragraph or when TeX
is in horizontal mode (like in your footnote) the space after the argument
stays and appears in the text. In this case you have to put a comment
after it to ignore the space which is generated from the line break in your
document.

Wolfgang


Rik Kabel schrieb am 27.11.18 um 21:17:

On 11/27/2018 08:43, Rik Kabel wrote:

On 11/27/2018 05:38, mf wrote:

In my setup, i have an index of names:

\defineregister[Nome][...]

The indexing of names can be toggled with a mode: --mode=AddNames

The setup is something like this:

\startmode[AddNames]
  \Name[key]{term}\xmlflush{#1}
\stopmode
\startnotmode[AddNames]
  \xmlflush{#1}
\stopnotmode

I noticed that \Name[key]{term} adds some space, leading to a 
different typesetting of the paragraph in rare cases (especially in 
a paragraph full of names).


Can \Name[key]{term} add some space, or should i look for a 
different bug in my setup?


Sorry, no MWE; i tried, but i could not reproduce the problem in a 
minimal example.


This has been a long-standing issue with registers in straight 
(non-XML) code. I always follow a \index{} with a % to avoid it. I 
suspect that will help here as well, splitting onto two lines, as


\Name[key]{term}%
\xmlflush{#1}

or perhaps

\Name[key]{term}\letterpercent
\xmlflush{#1}

Have you tried this?

(I cannot construct an MWE at this point either.)

And now I can construct it, so here is a not-necessarily-minimal 
example. Note that the problem occurs in footnotes (and endnotes, left 
as an exercise to the curious).


\setuppapersize[A9]
\starttext
\startparagraph
Text
\startfootnote
Text
\stopfootnote
\stopparagraph
\startparagraph
\index{Strumpf}
Text
\startfootnote
\index{Strumpf}
Text
\stopfootnote
\stopparagraph\startparagraph
Text
\startfootnote
\index{Strumpf}%
Text
\stopfootnote
\stopparagraph
\stoptext

With the result:

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


___
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] Language dependency in environment-project file

2018-11-27 Thread Wolfgang Schuster

Marco Patzer schrieb am 27.11.18 um 21:56:

On Tue, 27 Nov 2018 21:41:52 +0100
Wolfgang Schuster  wrote:


A nudge in the right direction appreciated.

\appendtoks
    \mainlanguage[\documentvariable{language}]%
%\doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}%
\to \everysetupdocument

That's basically what I've done in my project file (te-proj.tex). At
least the code is supposed to do exactly that.

But even your solution doesn't work here. Did you try it in the
example project file?


\startenvironment [*]

\startsetups [itemgroup:en]
  \setupitemgroup [itemize] [i]
\stopsetups

\startsetups [itemgroup:sv]
  \setupitemgroup [itemize] [a]
\stopsetups

\setuplanguage
  [en]
  [setups=itemgroup:en]

\setuplanguage
  [sv]
  [setups=itemgroup:sv]

\appendtoks
\doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}
\to \everysetupdocument

\stopenvironment

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
___

Re: [NTG-context] Language dependency in environment-project file

2018-11-27 Thread Marco Patzer
On Tue, 27 Nov 2018 21:41:52 +0100
Wolfgang Schuster  wrote:

> > A nudge in the right direction appreciated.  
> 
> \appendtoks
>    \mainlanguage[\documentvariable{language}]%
> %\doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}%
> \to \everysetupdocument

That's basically what I've done in my project file (te-proj.tex). At
least the code is supposed to do exactly that.

But even your solution doesn't work here. Did you try it in the
example project file?

Marco
___
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] \everystarttext in components

2018-11-27 Thread Wolfgang Schuster

Marco Patzer schrieb am 27.11.18 um 21:40:

On Tue, 27 Nov 2018 18:42:51 +0100
Wolfgang Schuster  wrote:


Has that changed over the course of the last year or always been
that way?

This was always the case.

OK, I'm wondering why I set it up that way back then. I'm sure I
tested it. But I don't remember.


When you load the environment before \startcomponent etc. you add your 
command
to the token register before it is flushed but when you load the 
environment after

\startcomponent etc. the register is flushed before you add them.

This doesn’t mean you should use \everystarttext in your document (or in 
a module)
because this stuff shouldn’t depend on the order in which environments 
are loaded.


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
___

Re: [NTG-context] Language dependency in environment-project file

2018-11-27 Thread Wolfgang Schuster



Marco Patzer schrieb am 27.11.18 um 21:37:

Hi,

I do have a project structure with environment, project and component files.
The language of the individual documents is defined in the components using

   \setupdocument
 [language=sv]

The environment needs to adjust language-dependent settings. However, when the
environment file is read, the language is not specified, yet. In the past I've
used

   \appendtoks
 …
   \to\everystarttext

and I belive it has worked that way. In any case, right now it doesn't. I have
attached a not-so-minimal example project.

How to set this up correctly? If possible I'd like to keep the language in the
document settings as shown above.

A nudge in the right direction appreciated.


\appendtoks
  \mainlanguage[\documentvariable{language}]%
%\doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}%
\to \everysetupdocument

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
___

Re: [NTG-context] \everystarttext in components

2018-11-27 Thread Marco Patzer
On Tue, 27 Nov 2018 18:42:51 +0100
Wolfgang Schuster  wrote:

> > Has that changed over the course of the last year or always been
> > that way?  
> 
> This was always the case.

OK, I'm wondering why I set it up that way back then. I'm sure I
tested it. But I don't remember.

> > ... it's not a godo idea to use that hook to add content
> > I'm not adding content, it was just for the MWE. I'll post another
> > thread about what I intend to achieve.  
> 
> When you use \startdocument you can use
> 
> \startsetups [document:start]
> ...
> \stopsetups
> 
> to insert code at the begin of the document.

I tried that, to no avail. I posted my actual issue including MWE as
a new thread.

Thanks for the quick response Hans and Wolfgang.

Marco
___
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] Language dependency in environment-project file

2018-11-27 Thread Marco Patzer
Hi,

I do have a project structure with environment, project and component files.
The language of the individual documents is defined in the components using

  \setupdocument
[language=sv]

The environment needs to adjust language-dependent settings. However, when the
environment file is read, the language is not specified, yet. In the past I've
used

  \appendtoks
…
  \to\everystarttext

and I belive it has worked that way. In any case, right now it doesn't. I have
attached a not-so-minimal example project.

How to set this up correctly? If possible I'd like to keep the language in the
document settings as shown above.

A nudge in the right direction appreciated.

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

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

Re: [NTG-context] can \REGISTER[key]{term} modify typesetting (adding space)?

2018-11-27 Thread Rik Kabel

On 11/27/2018 08:43, Rik Kabel wrote:

On 11/27/2018 05:38, mf wrote:

In my setup, i have an index of names:

\defineregister[Nome][...]

The indexing of names can be toggled with a mode: --mode=AddNames

The setup is something like this:

\startmode[AddNames]
  \Name[key]{term}\xmlflush{#1}
\stopmode
\startnotmode[AddNames]
  \xmlflush{#1}
\stopnotmode

I noticed that \Name[key]{term} adds some space, leading to a 
different typesetting of the paragraph in rare cases (especially in a 
paragraph full of names).


Can \Name[key]{term} add some space, or should i look for a different 
bug in my setup?


Sorry, no MWE; i tried, but i could not reproduce the problem in a 
minimal example.


This has been a long-standing issue with registers in straight 
(non-XML) code. I always follow a \index{} with a % to avoid it. I 
suspect that will help here as well, splitting onto two lines, as


\Name[key]{term}%
\xmlflush{#1}

or perhaps

\Name[key]{term}\letterpercent
\xmlflush{#1}

Have you tried this?

(I cannot construct an MWE at this point either.)

And now I can construct it, so here is a not-necessarily-minimal 
example. Note that the problem occurs in footnotes (and endnotes, left 
as an exercise to the curious).


   \setuppapersize[A9]
   \starttext
   \startparagraph
   Text
   \startfootnote
   Text
   \stopfootnote
   \stopparagraph
   \startparagraph
   \index{Strumpf}
   Text
   \startfootnote
   \index{Strumpf}
   Text
   \stopfootnote
   \stopparagraph\startparagraph
   Text
   \startfootnote
   \index{Strumpf}%
   Text
   \stopfootnote
   \stopparagraph
   \stoptext

With the result:

--
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] \everystarttext in components

2018-11-27 Thread Wolfgang Schuster


Marco Patzer schrieb am 27.11.18 um 18:34:

On Tue, 27 Nov 2018 18:21:45 +0100
Hans Hagen  wrote:


MWE:

\startcomponent *
\appendtoks Foobar \to\everystarttext
\startdocument\null\stopdocument
\stopcomponent

If the first and last line is commented out, it prints “Foobar”,
when compiled as a component it doesn't.

it kicks in when context things a text starts (so earler in this
case)

Has that changed over the course of the last year or always been
that way?


This was always the case.


... it's not a godo idea to use that hook to add content
I'm not adding content, it was just for the MWE. I'll post another
thread about what I intend to achieve.


When you use \startdocument you can use

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

to insert code at the begin of the document.

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
___

Re: [NTG-context] \everystarttext in components

2018-11-27 Thread Marco Patzer
On Tue, 27 Nov 2018 18:21:45 +0100
Hans Hagen  wrote:

> > MWE:
> > 
> > \startcomponent *
> >\appendtoks Foobar \to\everystarttext
> >\startdocument\null\stopdocument
> > \stopcomponent
> > 
> > If the first and last line is commented out, it prints “Foobar”,
> > when compiled as a component it doesn't.  
> it kicks in when context things a text starts (so earler in this
> case)

Has that changed over the course of the last year or always been
that way?

> ... it's not a godo idea to use that hook to add content

I'm not adding content, it was just for the MWE. I'll post another
thread about what I intend to achieve.

Marco
___
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] \everystarttext in components

2018-11-27 Thread Hans Hagen

On 11/27/2018 5:59 PM, Marco Patzer wrote:

Hi!

I've got an issue with my documents after updating context (to
2018.11.18 14:07). I believe it has something to do with
\everystarttext. But I'm still digging.

Question: Is it intended behaviour that \everystarttext doesn't work
in components?

MWE:

\startcomponent *
   \appendtoks Foobar \to\everystarttext
   \startdocument\null\stopdocument
\stopcomponent

If the first and last line is commented out, it prints “Foobar”,
when compiled as a component it doesn't.
it kicks in when context things a text starts (so earler in this case) 
... it's not a godo idea to use that hook to add content


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] checking sources with \input

2018-11-27 Thread Pablo Rodriguez
On 11/27/18 5:54 PM, Hans Hagen wrote:
> On 11/27/2018 5:42 PM, Pablo Rodriguez wrote:
>> [...]
>> Besides asking for "--verbose", I know that we have the following command:
>>
>>  mtxrunjit --autogenerate --script check file.tex
>>
>> But it doesn’t load source files with \input.
>>
>> Would it be possible that the script loads source files the same way
>> ConTeXt does it?
> > it's supposed to be used in an editor ... i have no plans to add more
> parsing to the script

Many thanks for your reply, Hans.

In that case, I’m going to check the 30 source files.

BTW, are other ways to get higher verbosity levels in ConTeXt than
--verbose?

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] \everystarttext in components

2018-11-27 Thread Marco Patzer
Hi!

I've got an issue with my documents after updating context (to
2018.11.18 14:07). I believe it has something to do with
\everystarttext. But I'm still digging.

Question: Is it intended behaviour that \everystarttext doesn't work
in components?

MWE:

\startcomponent *
  \appendtoks Foobar \to\everystarttext
  \startdocument\null\stopdocument
\stopcomponent

If the first and last line is commented out, it prints “Foobar”,
when compiled as a component it doesn't.

Marco
___
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] checking sources with \input

2018-11-27 Thread Hans Hagen

On 11/27/2018 5:42 PM, Pablo Rodriguez wrote:

Hans,

at work, we use ConTeXt to automagically generate PDF documents merging
data from CSV files.

The files are generated from ca. 30 ConTeXt sources and about another 30
Windows batch files.

The system works fine with LuaTeX 1.07, but it doesn’t work either with
LuaTeX 1.08 or 1.09. There is no explicit error message, compilation
only stops.

Besides asking for "--verbose", I know that we have the following command:

 mtxrunjit --autogenerate --script check file.tex

But it doesn’t load source files with \input.

Would it be possible that the script loads source files the same way
ConTeXt does it?
it's supposed to be used in an editor ... i have no plans to add more 
parsing to the script


Hans

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

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

[NTG-context] checking sources with \input

2018-11-27 Thread Pablo Rodriguez
Hans,

at work, we use ConTeXt to automagically generate PDF documents merging
data from CSV files.

The files are generated from ca. 30 ConTeXt sources and about another 30
Windows batch files.

The system works fine with LuaTeX 1.07, but it doesn’t work either with
LuaTeX 1.08 or 1.09. There is no explicit error message, compilation
only stops.

Besides asking for "--verbose", I know that we have the following command:

mtxrunjit --autogenerate --script check file.tex

But it doesn’t load source files with \input.

Would it be possible that the script loads source files the same way
ConTeXt does 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] optical bounds with hanging diacritics

2018-11-27 Thread Pablo Rodriguez
On 11/27/18 12:33 AM, Hans Hagen wrote:
> On 11/24/2018 10:02 PM, Pablo Rodriguez wrote:
>> [...]
>> BTW, to get pure lfbd values, I had to replace line 361 from
>> font-imp-quality lua with:
>>
>> local p = d/1000
> 
> two issues:
> 
> - no 1000 but units
> - we need to be able to go less extreme, so we keep factor
> 
> so something
> 
> local p = lfactor * d/units

Many thanks for your reply, Hans.

The new definition is fine for me.

BTW, I have an issue issue with the font feature. I cannot have both
default and the opbd as font features, such as in:

\setuplayout[topspace=1cm, height=middle, footer=0cm, header=0cm]
\definefontfeature[newfeature]
[protrusion=opentype, opbd=yes, script=grek]
\definefontfamily[mainface][rm]
[GFS Didot][features={default, newfeature}]
\setupbodyfont[mainface, 325pt]
\setupalign[hanging]
\starttext
Α\\Ἇ
\stoptext

I guess this may be related to "script=grek", but I don’t know whehter
I’m doing something wrong.

>> I hope it is clear now why raw values from the font are needed.
> 
> fwiw it looks a  bit too excessive to me (i'm not sure if graphical 
> elements like those accents which are part of the character needs that 
> much protrusion)

I agree. These are excessive values, but this is rather a very
particular case.

Hanging diacritics are used only in poetry, not in prose:
https://www.researchgate.net/publication/2417759_From_Unicode_to_Typography_a_Case_Study_the_Greek_Script
(section “1.6.2 Hanging Diacritics” on page 21).

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] can \REGISTER[key]{term} modify typesetting (adding space)?

2018-11-27 Thread Rik Kabel

On 11/27/2018 05:38, mf wrote:

In my setup, i have an index of names:

\defineregister[Nome][...]

The indexing of names can be toggled with a mode: --mode=AddNames

The setup is something like this:

\startmode[AddNames]
  \Name[key]{term}\xmlflush{#1}
\stopmode
\startnotmode[AddNames]
  \xmlflush{#1}
\stopnotmode

I noticed that \Name[key]{term} adds some space, leading to a 
different typesetting of the paragraph in rare cases (especially in a 
paragraph full of names).


Can \Name[key]{term} add some space, or should i look for a different 
bug in my setup?


Sorry, no MWE; i tried, but i could not reproduce the problem in a 
minimal example.


This has been a long-standing issue with registers in straight (non-XML) 
code. I always follow a \index{} with a % to avoid it. I suspect that 
will help here as well, splitting onto two lines, as


   \Name[key]{term}%
   \xmlflush{#1}

or perhaps

   \Name[key]{term}\letterpercent
   \xmlflush{#1}

Have you tried this?

(I cannot construct an MWE at this point either.)

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

[NTG-context] can \REGISTER[key]{term} modify typesetting (adding space)?

2018-11-27 Thread mf

In my setup, i have an index of names:

\defineregister[Nome][...]

The indexing of names can be toggled with a mode: --mode=AddNames

The setup is something like this:

\startmode[AddNames]
  \Name[key]{term}\xmlflush{#1}
\stopmode
\startnotmode[AddNames]
  \xmlflush{#1}
\stopnotmode

I noticed that \Name[key]{term} adds some space, leading to a different 
typesetting of the paragraph in rare cases (especially in a paragraph 
full of names).


Can \Name[key]{term} add some space, or should i look for a different 
bug in my setup?


Sorry, no MWE; i tried, but i could not reproduce the problem in a 
minimal example.


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