[NTG-context] useblocks troubles

2010-01-25 Thread Bernhard Vogel
Dear all,

When selecting multiple blocks: \useblocks[someblock,otherblock],
 the blocks are selected but the before and after statements are not 
processed. 

Is the expected behaviour?

Tia, Bernard

Example:

\defineblock[someblock]
\defineblock[otherblock]

\setupblock[someblock]
[before={ -Begin- },
  after={ -End- }]

\hideblocks[someblock,otherblock]

\starttext

\beginsomeblock
SOMEBLOCK
\endsomeblock

\beginotherblock
OTHERBLOCK
\endotherblock

\section{No before or after}

\useblocks[someblock,otherblock]

\useblocks[otherblock,someblock]

\section{Separately they work}

\useblocks[someblock]
\useblocks[otherblock]

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \useblocks in section

2005-12-22 Thread Hans Hagen

David Arnold wrote:

Hans, that worked. Code below. Is this something you will fix in one  
of the core files?


sure, for the moment put the patch in cont-new.tex

(i'll post an update as soon as we have the french interface integrated; 
needs some synchronization)


Hans
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \useblocks in section

2005-12-21 Thread Hans Hagen

David Arnold wrote:


All,

This doesn't seem to work as expected. Replacing the \useblocks with  
\selectblocks also produces an unexpected result. What am I doing  
wrong? I am trying to have only the answers from the chapter show up.


ah, old code, something got lost when i added parameter support ...

\unprotect

\def\getblockstatus#1% is this still ok
 {\dosetfilterlevel{\@@bscriterium}\empty
  \expanded{\doifblklevelelse[#1\sectionseparator\sectionseparator0]}
{\global\blockpermittedtrue}
{\global\blockpermittedfalse}%
  \def\blockstatus{#1}}

\def\doselectblocks[#1][#2][#3]%
 {\begingroup
  \doifelsenothing{#3}
{\getparameters[\??bs][\c!criterium=\v!all,#2]%
 \dodouseblocks[#1][]}
{\getparameters[\??bs][\c!criterium=\v!all,#3]%
 \dodouseblocks[#1][#2]}}%

\def\selectblocks
 {\dotripleempty\doselectblocks}

\protect

use \selectblocks when you want a criterium



%output=pdf

\defineenumeration[question][location=serried,text=Question]
\defineenumeration[answer][location=serried,text=Answer]
\defineblock[question,answer]
\hideblocks[answer]

\starttext

\chapter{First Chapter}

\input tufte

\beginquestion
\startquestion
  What is the square root of 4?
\stopquestion
\endquestion

\beginanswer
\startanswer
  2
\stopanswer
\endanswer

\section{Answers}

\useblocks[answer][criterium=chapter]

\chapter{Second Chapter}

\input tufte

\beginquestion
\startquestion
  What is the square root of 9?
\stopquestion
\endquestion

\beginanswer
\startanswer
  3
\stopanswer
\endanswer

\section{Answers}

\useblocks[answer][criterium=chapter]

\stoptext

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context



___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] \useblocks in section

2005-12-21 Thread David Arnold
Hans, that worked. Code below. Is this something you will fix in one  
of the core files?


%output=pdf

\unprotect

\def\getblockstatus#1% is this still ok
{\dosetfilterlevel{\@@bscriterium}\empty
  \expanded{\doifblklevelelse[#1\sectionseparator\sectionseparator0]}
{\global\blockpermittedtrue}
{\global\blockpermittedfalse}%
  \def\blockstatus{#1}}

\def\doselectblocks[#1][#2][#3]%
{\begingroup
  \doifelsenothing{#3}
{\getparameters[\??bs][\c!criterium=\v!all,#2]%
 \dodouseblocks[#1][]}
{\getparameters[\??bs][\c!criterium=\v!all,#3]%
 \dodouseblocks[#1][#2]}}%

\def\selectblocks
{\dotripleempty\doselectblocks}

\protect


\starttext

\defineenumeration[question][location=serried,text=Question]
\defineenumeration[answer][location=serried,text=Answer]
\defineblock[question,answer]
\hideblocks[answer]

\chapter{First Chapter}

\input tufte

\beginquestion
\startquestion
  What is the square root of 4?
\stopquestion
\endquestion

\beginanswer
\startanswer
  2
\stopanswer
\endanswer

\section{Answers}

\selectblocks[answer][criterium=chapter]

\chapter{Second Chapter}

\input tufte

\beginquestion
\startquestion
  What is the square root of 9?
\stopquestion
\endquestion

\beginanswer
\startanswer
  3
\stopanswer
\endanswer

\section{Answers}

\selectblocks[answer][criterium=chapter]

\stoptext


On Dec 21, 2005, at 1:29 AM, Hans Hagen wrote:


David Arnold wrote:


All,

This doesn't seem to work as expected. Replacing the \useblocks  
with  \selectblocks also produces an unexpected result. What am I  
doing  wrong? I am trying to have only the answers from the  
chapter show up.


ah, old code, something got lost when i added parameter support ...

\unprotect

\def\getblockstatus#1% is this still ok
 {\dosetfilterlevel{\@@bscriterium}\empty
  \expanded{\doifblklevelelse[#1\sectionseparator\sectionseparator0]}
{\global\blockpermittedtrue}
{\global\blockpermittedfalse}%
  \def\blockstatus{#1}}

\def\doselectblocks[#1][#2][#3]%
 {\begingroup
  \doifelsenothing{#3}
{\getparameters[\??bs][\c!criterium=\v!all,#2]%
 \dodouseblocks[#1][]}
{\getparameters[\??bs][\c!criterium=\v!all,#3]%
 \dodouseblocks[#1][#2]}}%

\def\selectblocks
 {\dotripleempty\doselectblocks}

\protect

use \selectblocks when you want a criterium



%output=pdf

\defineenumeration[question][location=serried,text=Question]
\defineenumeration[answer][location=serried,text=Answer]
\defineblock[question,answer]
\hideblocks[answer]

\starttext

\chapter{First Chapter}

\input tufte

\beginquestion
\startquestion
  What is the square root of 4?
\stopquestion
\endquestion

\beginanswer
\startanswer
  2
\stopanswer
\endanswer

\section{Answers}

\useblocks[answer][criterium=chapter]

\chapter{Second Chapter}

\input tufte

\beginquestion
\startquestion
  What is the square root of 9?
\stopquestion
\endquestion

\beginanswer
\startanswer
  3
\stopanswer
\endanswer

\section{Answers}

\useblocks[answer][criterium=chapter]

\stoptext

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context



___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] \useblocks in section

2005-12-20 Thread David Arnold

All,

This doesn't seem to work as expected. Replacing the \useblocks with  
\selectblocks also produces an unexpected result. What am I doing  
wrong? I am trying to have only the answers from the chapter show up.


%output=pdf

\defineenumeration[question][location=serried,text=Question]
\defineenumeration[answer][location=serried,text=Answer]
\defineblock[question,answer]
\hideblocks[answer]

\starttext

\chapter{First Chapter}

\input tufte

\beginquestion
\startquestion
  What is the square root of 4?
\stopquestion
\endquestion

\beginanswer
\startanswer
  2
\stopanswer
\endanswer

\section{Answers}

\useblocks[answer][criterium=chapter]

\chapter{Second Chapter}

\input tufte

\beginquestion
\startquestion
  What is the square root of 9?
\stopquestion
\endquestion

\beginanswer
\startanswer
  3
\stopanswer
\endanswer

\section{Answers}

\useblocks[answer][criterium=chapter]

\stoptext

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: Struggles with \useblocks

2003-09-22 Thread Willi Egger
Hi Pattrick,

From: Patrick Gundlach [EMAIL PROTECTED]
 Hello Willi,

  In the environment file there is a block defined as
\defineblock[Impressum]
  and the block is immediately hidden with \hideblocks[Impressum]

 It looks as if you can only define blocks within
 \starttext...\stoptext. Do you load your environment inside or
 outside \starttext...\stoptext?

Ii do not know precisely. Ii have an environment file where the block
resides.
The environment file is loaded OUTSIDE the \starttext .. \stoptext.

In the meantime I tested this and found out, that the definition of the
block as well as the block itself must be placed within the \starttext ...
\stoptext.


 Please provide a minimal but complete example if you still have
 problems.

Thanks for your tips!

Willi

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Struggles with \useblocks

2003-09-15 Thread Willi Egger
Hi gang!

I do not know why this does not work therefore the following:

I have a document with several chapters.
At the beginning an environment file is loaded.

In the environment file there is a block defined as \defineblock[Impressum]
and the block is immediately hidden with \hideblocks[Impressum]

At the end of the document there is the chapter Colofoon

\Chapter{Colofoon}

\useblocks[Impressum]

So far so good. But after compilation with texexec --final  of the document
there is the following statement in the log file.

chapter: 14 Colofoon
textblocks : second pass needed

No block Impressum is typeset.

By the way I am using: ConTeXt  ver: 2003.8.21  fmt: 2003.8.22  int: english
mes: english

How is this to be explained?

Willi

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context