Re: [NTG-context] xml, language, btx problems

2018-06-17 Thread Alan Braslau
On Sun, 17 Jun 2018 19:52:35 +0200
"Thomas A. Schmitz"  wrote:

> However, this implies a \starttext. And the btxdefinitions need to be 
> loaded before \starttext, or so it seems.

Thomas,

Why would the definitions need to be loaded before \starttext?
The bibliographic data can be loaded independent of any rendering or
use definitions. Also, why don't you write your custom definitions to
handle languages, rather than writing new definition sets based on
language?

Alan
___
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] xml, language, btx problems

2018-06-17 Thread Wolfgang Schuster
One option is to load your document at the beginning with different 
setups where you only process the language information.


Another option is to put the language dependent options in a setups 
block and load them when you process the XML file.


\startbuffer[test]

   test

\stopbuffer

\startxmlsetups [xml:testsetups]
\xmlsetsetup{\xmldocument}{document}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups [xml:document]
\mainlanguage[\xmlatt{#1}{language}]
\startdocument
\xmlflush{#1}
\stopdocument
\stopxmlsetups

% The “document:start” setup is used by default with
% the before key of the \startdocument command

\startsetups [document:start]
\startmodeset
[**de]{This document is in german.\par}
[**en]{This document is in english.\par}
[default] {This document uses the default language.\par}
\stopmodeset
\stopsetups

\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext

Wolfgang

Thomas A. Schmitz 
17. Juni 2018 um 19:52
Hi,

I have a conceptual problem integrating btx into my xml workflow. 
There are too many files involved, so no minimal example, but a 
minimal description. Root of my xml document:



...


I have two files with btx definitions:

publ-imp-deutsch.mkvi

publ-imp-english.mkvi

Loading one of these two should depend on the main language:

\doifelse {\currentlanguage} {en}
{\usebtxdefinitions [english]}
{\usebtxdefinitions [deutsch]}

My problem: the main language is set within the processing rules for 
the root of my xml document:


\startxmlsetups xml:document
   \mainlanguage[\xmlatt{#1}{language}]
\stopxmlsetups

However, this implies a \starttext. And the btxdefinitions need to be 
loaded before \starttext, or so it seems. Which means: the processing 
rules for \usebtxdefinitions need to be set outside of the xml setups. 
But at this moment, the main language is not set yet, and the 
\doifelse fails. Any hints how to get out of this conundrum?


Thanks, and all best

Thomas
___ 

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
___
Pablo Rodriguez 
17. Juni 2018 um 21:37

Hi Thomas,

this may work in your case:

\startxmlsetups xml:document
\mainlanguage[\xmlatt{#1}{language}]
\doifmodeelse{**en}
{\usebtxdefinitions [english]}
{\usebtxdefinitions [deutsch]}
\stopxmlsetups

I have just checked in with another document and it worked as expected.

Of course, "\doifelse{\currentmainlanguage}{en}" also works fine for me.

I hope it helps,

Pablo
Thomas A. Schmitz 
17. Juni 2018 um 22:10


Thank you for your suggestion, Pablo, but this is just a slightly 
different syntax to express the same test, this doesn't change 
anything. Maybe this document is clearer in explaining my problem (and 
results are identical with the \doifmodeelse syntax):


\startbuffer[test]

   test

\stopbuffer

\startxmlsetups xml:testsetups
\xmlsetsetup{\xmldocument}{document}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:document
\mainlanguage[\xmlatt{#1}{language}]
Language settings work correctly here:

\doifelse {\currentmainlanguage} {de}
{\color [blue] {Deutsch}}
{\color [red]  {English}}\par
\xmlflush{#1}
\stopxmlsetups

\starttext
This is where the btx set has to be loaded, and language settings do 
not work as needed:


\doifelse {\currentmainlanguage} {de}
{\color [blue] {Deutsch}}
{\color [red]  {English}}\par

\xmlprocessbuffer{main}{test}{}

\stoptext

Is there any way to set the language before the  element is 
processed? I experimented with this


\startxmlsetups xml:language:initiate
\mainlanguage[\xmlattribute{\xmldocument}{root::/document}{language}]
\stopxmlsetups

\xmlbeforedocumentsetup{\xmldocument}{xml:language:initiate}{xml:testsetups} 



but this doesn't work, and I'm not sure I'm using it the right way.

All best

Thomas
___ 

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 

Re: [NTG-context] xml, language, btx problems

2018-06-17 Thread Thomas A. Schmitz

On 06/17/2018 09:37 PM, Pablo Rodriguez wrote:

Hi Thomas,

this may work in your case:

  \startxmlsetups xml:document
  \mainlanguage[\xmlatt{#1}{language}]
  \doifmodeelse{**en}
{\usebtxdefinitions [english]}
{\usebtxdefinitions [deutsch]}
  \stopxmlsetups

I have just checked in with another document and it worked as expected.


Thank you for your suggestion, Pablo, but this is just a slightly 
different syntax to express the same test, this doesn't change anything. 
Maybe this document is clearer in explaining my problem (and results are 
identical with the \doifmodeelse syntax):


\startbuffer[test]

   test

\stopbuffer

\startxmlsetups xml:testsetups
\xmlsetsetup{\xmldocument}{document}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:document
\mainlanguage[\xmlatt{#1}{language}]
Language settings work correctly here:

\doifelse {\currentmainlanguage} {de}
{\color [blue] {Deutsch}}
{\color [red]  {English}}\par
\xmlflush{#1}
\stopxmlsetups

\starttext
This is where the btx set has to be loaded, and language settings do not 
work as needed:


\doifelse {\currentmainlanguage} {de}
{\color [blue] {Deutsch}}
{\color [red]  {English}}\par

\xmlprocessbuffer{main}{test}{}

\stoptext

Is there any way to set the language before the  element is 
processed? I experimented with this


\startxmlsetups xml:language:initiate
\mainlanguage[\xmlattribute{\xmldocument}{root::/document}{language}]
\stopxmlsetups

\xmlbeforedocumentsetup{\xmldocument}{xml:language:initiate}{xml:testsetups}

but this doesn't work, and I'm not sure I'm using it the right way.

All best

Thomas
___
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] xml, language, btx problems

2018-06-17 Thread Pablo Rodriguez
On 06/17/2018 07:52 PM, Thomas A. Schmitz wrote:
> Hi,
> 
> I have a conceptual problem integrating btx into my xml workflow. There 
> are too many files involved, so no minimal example, but a minimal 
> description. Root of my xml document:
> 
> 
> ...
> 
> 
> I have two files with btx definitions:
> 
> publ-imp-deutsch.mkvi
> publ-imp-english.mkvi
> 
> Loading one of these two should depend on the main language:
> 
> \doifelse {\currentlanguage} {en}
>   {\usebtxdefinitions [english]}
>   {\usebtxdefinitions [deutsch]}
> 
> My problem: the main language is set within the processing rules for the 
> root of my xml document:
> 
> \startxmlsetups xml:document
> \mainlanguage[\xmlatt{#1}{language}]
> \stopxmlsetups

Hi Thomas,

this may work in your case:

 \startxmlsetups xml:document
 \mainlanguage[\xmlatt{#1}{language}]
 \doifmodeelse{**en}
{\usebtxdefinitions [english]}
{\usebtxdefinitions [deutsch]}
 \stopxmlsetups

I have just checked in with another document and it worked as expected.

Of course, "\doifelse{\currentmainlanguage}{en}" also works fine for me.

I hope it helps,

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] xml, language, btx problems

2018-06-17 Thread Thomas A. Schmitz

Hi,

I have a conceptual problem integrating btx into my xml workflow. There 
are too many files involved, so no minimal example, but a minimal 
description. Root of my xml document:



...


I have two files with btx definitions:

publ-imp-deutsch.mkvi

publ-imp-english.mkvi

Loading one of these two should depend on the main language:

\doifelse {\currentlanguage} {en}
{\usebtxdefinitions [english]}
{\usebtxdefinitions [deutsch]}

My problem: the main language is set within the processing rules for the 
root of my xml document:


\startxmlsetups xml:document
   \mainlanguage[\xmlatt{#1}{language}]
\stopxmlsetups

However, this implies a \starttext. And the btxdefinitions need to be 
loaded before \starttext, or so it seems. Which means: the processing 
rules for \usebtxdefinitions need to be set outside of the xml setups. 
But at this moment, the main language is not set yet, and the \doifelse 
fails. Any hints how to get out of this conundrum?


Thanks, and all best

Thomas
___
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] Confusing level change message, why?

2018-06-17 Thread Hans Hagen

On 6/17/2018 2:48 PM, Rik Kabel wrote:

On 6/17/2018 04:35, Pablo Rodriguez wrote:

On 06/15/2018 11:03 PM, Rik Kabel wrote:

The example below is taken from the wiki article "Titles
," with pdf bookmark apparatus
prepended and a second chapter added to the bodymatter.

In the log, this produces the lines:

 backend > bookmarks > confusing level change at level 3
 around '1 body'
 backend > bookmarks > confusing level change at level 3
 around 'A appendix'
 backend > bookmarks > confusing level change at level 3
 around 'back'

That is, one message for each *matter change.

What is the meaning of the message, and how can it be removed (short of
disabling pdf bookmarks)?

Hi Rik,

if you disable bookmarks (by commenting
"\setupinteraction[state=start]"), you won’t get the message.

But I wonder what is the problem besides the log message. From your
sample, I get a PDF document with all the expected content.

What I am missing from your explanation? Or why are these log messages
so relevant if you get the intended output?

Pablo


Indeed, Pablo, there is no visible defect in the document.

I wonder if the message should cause concern because I do not know if 
there is some other issue that it reflects, perhaps something that is 
not visible in the viewed document, but that might impede PDF standards 
compliance.


If there is no fault or typesetting problem indicated by the message, I 
wonder why it is reported.


Again, if there is no problem, I can add it to my log filtering 
routines, but I want to see it if there is something I should do to 
eliminate it.
it's just part of the check .. if you use for instance \section{foo} 
instead of \startsecction there is some guesswork


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] Confusing level change message, why?

2018-06-17 Thread Rik Kabel

On 6/17/2018 04:35, Pablo Rodriguez wrote:

On 06/15/2018 11:03 PM, Rik Kabel wrote:

The example below is taken from the wiki article "Titles
," with pdf bookmark apparatus
prepended and a second chapter added to the bodymatter.

In the log, this produces the lines:

 backend > bookmarks > confusing level change at level 3
 around '1 body'
 backend > bookmarks > confusing level change at level 3
 around 'A appendix'
 backend > bookmarks > confusing level change at level 3
 around 'back'

That is, one message for each *matter change.

What is the meaning of the message, and how can it be removed (short of
disabling pdf bookmarks)?

Hi Rik,

if you disable bookmarks (by commenting
"\setupinteraction[state=start]"), you won’t get the message.

But I wonder what is the problem besides the log message. From your
sample, I get a PDF document with all the expected content.

What I am missing from your explanation? Or why are these log messages
so relevant if you get the intended output?

Pablo


Indeed, Pablo, there is no visible defect in the document.

I wonder if the message should cause concern because I do not know if 
there is some other issue that it reflects, perhaps something that is 
not visible in the viewed document, but that might impede PDF standards 
compliance.


If there is no fault or typesetting problem indicated by the message, I 
wonder why it is reported.


Again, if there is no problem, I can add it to my log filtering 
routines, but I want to see it if there is something I should do to 
eliminate it.


--
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] Confusing level change message, why?

2018-06-17 Thread Pablo Rodriguez
On 06/15/2018 11:03 PM, Rik Kabel wrote:
> The example below is taken from the wiki article "Titles
> ," with pdf bookmark apparatus
> prepended and a second chapter added to the bodymatter.
> 
> In the log, this produces the lines:
> 
> backend > bookmarks > confusing level change at level 3
> around '1 body'
> backend > bookmarks > confusing level change at level 3
> around 'A appendix'
> backend > bookmarks > confusing level change at level 3
> around 'back'
> 
> That is, one message for each *matter change.
> 
> What is the meaning of the message, and how can it be removed (short of
> disabling pdf bookmarks)?

Hi Rik,

if you disable bookmarks (by commenting
"\setupinteraction[state=start]"), you won’t get the message.

But I wonder what is the problem besides the log message. From your
sample, I get a PDF document with all the expected content.

What I am missing from your explanation? Or why are these log messages
so relevant if you get the intended output?

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
___