Re: [NTG-context] Parallel output of source data

2016-12-04 Thread Procházka Lukáš Ing .

Great, that's it! Thank you.

Best regards,

Lukas


On Fri, 02 Dec 2016 20:04:56 +0100, Wolfgang Schuster 
 wrote:


Procházka Lukáš Ing. 
2. Dezember 2016 um 08:10
Hello,

is there a way to let ConTeXt to flush the input stream in parallel
into an output buffer, like:


\starttext

A

\startoutput{Test.mkiv}
  Hello!
  \startitemize
\item Item
  \stopitemize
\stopoutput

B

\stoptext


which would produce:

 Test.mkiv
  Hello!
  \startitemize
\item Item
  \stopitemize


You can use a buffer to store content and save it in a external file.

\unexpanded\def\startcontentexport
   {\dosingleempty\dostartcontentexport}

\def\dostartcontentexport[#1]%
   {\iffirstargument
  \edef\contentexportfile{#1}%
\else
  \let\contentexportfile\empty
\fi
\grabbufferdata[contentexport][startcontentexport][stopcontentexport]}

\def\stopcontentexport
{\doifsomething{\contentexportfile}{\savebuffer[list=contentexport,prefix=no,file=\contentexportfile]}%
\getbufferdata[contentexport]}

\starttext

A

\startcontentexport[Test.mkiv]
   Hello!
   \startitemize
 \item Item
   \stopitemize
\stopcontentexport

B

\stoptext

Wolfgang




--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751 (+420 720 951 172)
Fax: +420 244 461 038

___
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] hbox after \page[disable]

2016-12-04 Thread Michael Eidenbenz
Dear Hans,

thank you for your answer, but it doesnt solve the issue. 
(or I dont understand what you mean)

the argument in the macro is acually (not in the MWE) a xtable filled with 
\externalfigures.
so I would like to avoid floats as it makes things more complicated and slower.

I tried finding the \page[disable] definition in the code but could not find 
it. 

any further suggestions how I can solve this issue?

thanks Michael



> Am 04.12.2016 um 18:13 schrieb Hans Hagen :
> 
> On 12/4/2016 2:12 PM, Michael Eidenbenz wrote:
>> I have a doublesided layout.
>> On the right side i place the text, figures (if i have any) go on the left 
>> side.
>> the MWE below works quite nice.
>> 
>> But if i want the figure to be full height, two pages are skipped.
>> This is becaus the hbox right below of the figure.
>> I think it is placed during the \page[disable] pass.
>> 
>> What can I do to avoid this hbox?
> 
> \def\Figure#1{\placefigure[location={page,none}]{}{#1}}
> 
> 
>> Thanks Michael
>> 
>> 
>> \enabletrackers
>> [visualizers.hbox]
>> 
>> \useMPlibrary[dum]
>> 
>> \setuppagenumbering
>> [alternative=doublesided]
>> 
>> \definelayout[odd][width=10cm]
>> \definelayout[even][width=15cm]
>> 
>> \newtoks \EvenPage
>> 
>> \appendtoks
>> \the\EvenPage
>> \global\EvenPage\emptytoks
>> \page[odd]
>> \to\everyafteroutput
>> 
>> \unexpanded\def\Figure#1{%
>>  \appendtoks
>>  \page[even]
>>  #1
>>  \page[disable]
>>  \to\EvenPage}
>> 
>> \showframe
>> 
>> \starttext
>> 
>> \dorecurse{4}{\input{tufte}\par}\page
>> \Figure{\externalfigure[dummy][factor=fit]}
>> \dorecurse{4}{\input{knuth}\par}\page
>> \Figure{\externalfigure[dummy][height=\textheight]}  %
>> \dorecurse{8}{\input{ward}\par}
>> \stoptext
>> 
>> ___
>> 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
>> ___
>> 
> 
> 
> -- 
> 
> -
>  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
> ___

___
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] \setupfooter[color=red]: red color spills with float over next page

2016-12-04 Thread Benjamin Buchmuller
Hi Hans,

thank you for your help. I tried exactly as you suggested, which worked fine, 
but adopting for the case being with 
\setupfootertexts[\strut{\color[MyColor]{footers}}\strut][][][…same…] (further, 
footer texts change in the course of the document and call markings, page 
numbers etc.), I ended up with the same result as before. 

I will provide a minimal example as soon as possible next week. 

Cheers, Benjamin 

> On 4 Dec 2016, at 12:00, ntg-context-requ...@ntg.nl wrote:
> 
> Send ntg-context mailing list submissions to
>   ntg-context@ntg.nl
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   https://mailman.ntg.nl/mailman/listinfo/ntg-context
> or, via email, send a message with subject or body 'help' to
>   ntg-context-requ...@ntg.nl
> 
> You can reach the person managing the list at
>   ntg-context-ow...@ntg.nl
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ntg-context digest..."
> Today's Topics:
> 
>   1. \setupfooter[color=red]: red color spills with float over
>  next page (Benjamin Buchmuller)
>   2. Re: \setupfooter[color=red]: red color spills with float over
>  next page (Hans Hagen)
> 
> From: Benjamin Buchmuller 
> Subject: [NTG-context] \setupfooter[color=red]: red color spills with float 
> over next page
> Date: 4 December 2016 at 04:05:49 CET
> To: ntg-context@ntg.nl
> Reply-To: mailing list for ConTeXt users 
> 
> 
> When I have
> 
> \setupfooter[color=red, style=bold] (same goes with \setupfooter[style=red])
> 
> and a
> 
> tex text text
> 
> %  page breaks here after typesetting 
> 
> \startplacefigure[
>   %location=force, % no matter what I do here
>   title={Caption.}
> ]
> … something …
> \stopplacefigure
> 
> other text
> 
> that is moved to the following page as first object, the entire page 
> including the figure’s rulers, caption, and the regular text prints in red 
> (but not bold!?) when I incorporate the file via \component … into my 
> project, but not when I typeset from within \startcomponent … \stopcomponent.
> 
> Since “bold” does not seem to float the same way, I guess it is related to 
> color handling at page breaks somehow.
> 
> I already tried to \setupfloats[before=\strut] to “force” black bodyfont 
> right before the figure (at least this is what I intended to do), but did not 
> work.
> 
> I’m sorry not to be able to provide a more elaborate minimal example 
> asserting the exact conditionals of this behaviour at the moment as I need to 
> hand in a report next week. Probably the footers have to go black this time.
> 
> Any suggestions?
> 
> Thank you for your help.
> 
> 
> Benjamin
> 
> 
> 
> From: Hans Hagen 
> Subject: Re: [NTG-context] \setupfooter[color=red]: red color spills with 
> float over next page
> Date: 4 December 2016 at 11:42:19 CET
> To: ntg-context@ntg.nl
> Reply-To: mailing list for ConTeXt users 
> 
> 
>> On 12/4/2016 4:05 AM, Benjamin Buchmuller wrote:
>> When I have
>> 
>> \setupfooter[color=red, style=bold] (same goes with \setupfooter[style=red])
>> 
>> and a
>> 
>> tex text text
>> 
>> %  page breaks here after typesetting 
>> 
>> \startplacefigure[
>>  %location=force, % no matter what I do here
>>  title={Caption.}
>> ]
>> … something …
>> \stopplacefigure
>> 
>> other text
>> 
>> that is moved to the following page as first object, the entire page 
>> including the figure’s rulers, caption, and the regular text prints in red 
>> (but not bold!?) when I incorporate the file via \component … into my 
>> project, but not when I typeset from within \startcomponent … \stopcomponent.
>> 
>> Since “bold” does not seem to float the same way, I guess it is related to 
>> color handling at page breaks somehow.
>> 
>> I already tried to \setupfloats[before=\strut] to “force” black bodyfont 
>> right before the figure (at least this is what I intended to do), but did 
>> not work.
>> 
>> I’m sorry not to be able to provide a more elaborate minimal example 
>> asserting the exact conditionals of this behaviour at the moment as I need 
>> to hand in a report next week. Probably the footers have to go black this 
>> time.
>> 
>> Any suggestions?
> 
> not many as i really need an example
> 
> you can try
> 
> \setupfootertexts[\strut{\red foo}\strut}
> 
> instead
> 
> 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 / 

Re: [NTG-context] hbox after \page[disable]

2016-12-04 Thread Hans Hagen

On 12/4/2016 2:12 PM, Michael Eidenbenz wrote:

I have a doublesided layout.
On the right side i place the text, figures (if i have any) go on the left side.
the MWE below works quite nice.

But if i want the figure to be full height, two pages are skipped.
This is becaus the hbox right below of the figure.
I think it is placed during the \page[disable] pass.

What can I do to avoid this hbox?


\def\Figure#1{\placefigure[location={page,none}]{}{#1}}



Thanks Michael


\enabletrackers
[visualizers.hbox]

\useMPlibrary[dum]

\setuppagenumbering
 [alternative=doublesided]

\definelayout[odd][width=10cm]
\definelayout[even][width=15cm]

\newtoks \EvenPage

\appendtoks
\the\EvenPage
\global\EvenPage\emptytoks
\page[odd]
\to\everyafteroutput

\unexpanded\def\Figure#1{%
  \appendtoks
  \page[even]
  #1
  \page[disable]
  \to\EvenPage}

\showframe

\starttext

\dorecurse{4}{\input{tufte}\par}\page
\Figure{\externalfigure[dummy][factor=fit]}
\dorecurse{4}{\input{knuth}\par}\page
\Figure{\externalfigure[dummy][height=\textheight]}  %
\dorecurse{8}{\input{ward}\par}
\stoptext

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




--

-
  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] hbox after \page[disable]

2016-12-04 Thread Michael Eidenbenz
I have a doublesided layout. 
On the right side i place the text, figures (if i have any) go on the left side.
the MWE below works quite nice.

But if i want the figure to be full height, two pages are skipped.
This is becaus the hbox right below of the figure.
I think it is placed during the \page[disable] pass. 

What can I do to avoid this hbox?

Thanks Michael


\enabletrackers 
[visualizers.hbox]

\useMPlibrary[dum]

\setuppagenumbering
 [alternative=doublesided]

\definelayout[odd][width=10cm]
\definelayout[even][width=15cm]

\newtoks \EvenPage

\appendtoks
\the\EvenPage
\global\EvenPage\emptytoks
\page[odd]
\to\everyafteroutput

\unexpanded\def\Figure#1{%
  \appendtoks
  \page[even]
  #1
  \page[disable]
  \to\EvenPage}
 
\showframe

\starttext

\dorecurse{4}{\input{tufte}\par}\page
\Figure{\externalfigure[dummy][factor=fit]}
\dorecurse{4}{\input{knuth}\par}\page
\Figure{\externalfigure[dummy][height=\textheight]}  %
\dorecurse{8}{\input{ward}\par}
\stoptext

___
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] \setupfooter[color=red]: red color spills with float over next page

2016-12-04 Thread Hans Hagen

On 12/4/2016 4:05 AM, Benjamin Buchmuller wrote:

When I have

\setupfooter[color=red, style=bold] (same goes with \setupfooter[style=red])

and a

tex text text

%  page breaks here after typesetting 

\startplacefigure[
%location=force, % no matter what I do here
title={Caption.}
]
… something …
\stopplacefigure

other text

that is moved to the following page as first object, the entire page including 
the figure’s rulers, caption, and the regular text prints in red (but not 
bold!?) when I incorporate the file via \component … into my project, but not 
when I typeset from within \startcomponent … \stopcomponent.

Since “bold” does not seem to float the same way, I guess it is related to 
color handling at page breaks somehow.

I already tried to \setupfloats[before=\strut] to “force” black bodyfont right 
before the figure (at least this is what I intended to do), but did not work.

I’m sorry not to be able to provide a more elaborate minimal example asserting 
the exact conditionals of this behaviour at the moment as I need to hand in a 
report next week. Probably the footers have to go black this time.

Any suggestions?


not many as i really need an example

you can try

\setupfootertexts[\strut{\red foo}\strut}

instead

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
___