ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: blocks in itemize
       [not found] <20050822114120.GA19715@blackowl.org>
@ 2005-08-22 11:58 ` r.ermers
  2005-08-22 18:31   ` Brooks Moses
  0 siblings, 1 reply; 7+ messages in thread
From: r.ermers @ 2005-08-22 11:58 UTC (permalink / raw)


Hi Olivier,

Thanks for your reaction. My original proposal was:

\startitemize
  \beginblockA
    \item Apple
  \endblockA
  \beginblockB
    \item Pomme
  \endBlockB
  \beginblockA
    \item Pear
  \endblockA
  \beginblockB
    \item Poire
  \endBlockB
\stopitemize

This does not work.

The advantage of this setup is that in a bilingual document, printed separatedly, I have both languages underneath and thus more control than when I use separate itemize environments, such as proposed by Taco, and what I had thought of earlier:

\beginblockA
\startitemize
....
\stopitemize
\endblockA

\beginblockB
\startitemize
....
\stopitemize
\endblockB

Nevertheless, if my proposal does not work, I guess I'll have to try it this way.

Kind regards,

Rob


> Hi,
> 
> 
> I might be wrong, but I think blocks are intended as buffered text.
> This way it is not good to use
> \item {block A}{bloc B}
> and it is not good as well to use {\item block A}
> {\item block B}
> 
> 
> I think the only good way to use block is
> {\startitemize
> \item block A
> \stoptitemize}
> {\startitemize
> \item block B
> \stoptitemize}
> were good means a natural utilisation of blocks.
> 
> However, I certainly understand that the third solution is not practical
> for your intended usage.
> 
> Maybe a newif is more appropriate to your situation:
> \newif\ifenlang  and \ifenlang \else \fi switches,
> or maybe even cases if you have more than one language.
> 
> Just some thought hoping it helps,
> Olivier
> 
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re: blocks in itemize
  2005-08-22 11:58 ` blocks in itemize r.ermers
@ 2005-08-22 18:31   ` Brooks Moses
  2005-08-22 20:16     ` Rob Ermers
  0 siblings, 1 reply; 7+ messages in thread
From: Brooks Moses @ 2005-08-22 18:31 UTC (permalink / raw)


At 04:58 AM 8/22/2005, you wrote:
>Thanks for your reaction. My original proposal was:
>
>\startitemize
>   \beginblockA
>     \item Apple
>   \endblockA
>   \beginblockB
>     \item Pomme
>   \endBlockB
>   \beginblockA
>     \item Pear
>   \endblockA
>   \beginblockB
>     \item Poire
>   \endBlockB
>\stopitemize
>
>This does not work.

I don't know anything about how blocks work, so this may be completely 
off-base, but if they do any sort of grouping, that would be quite 
sufficient to cause problems in a situation like that.  Does this work?

\startitemize
   \item \beginblockA
     Apple
   \endblockA
   \item \beginblockB
     Pomme
   \endBlockB
   \item \beginblockA
     Pear
   \endblockA
   \item \beginblockB
     Poire
   \endBlockB
\stopitemize

- Brooks

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re: blocks in itemize
  2005-08-22 18:31   ` Brooks Moses
@ 2005-08-22 20:16     ` Rob Ermers
  2005-08-22 20:39       ` Rob Ermers
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Ermers @ 2005-08-22 20:16 UTC (permalink / raw)


Thanks Brooks and Olivier,
I'm afraid the problem has not entirely been solved.

Brooks' solution works in the sense that I can hide BlockA or B 
(\hideblocks[BlockA]), but the \items remain, and empty items are generated.

Olivier's suggestion is processed, the result is only one language. Now 
now I wonder how to hide either one of the languages. The document I 
want to produce is monolingual, either Dutch or English.

Thanks again!

Kind regards,

Robert



Brooks Moses wrote:
> At 04:58 AM 8/22/2005, you wrote:
> 
>> Thanks for your reaction. My original proposal was:
>>
>> \startitemize
>>   \beginblockA
>>     \item Apple
>>   \endblockA
>>   \beginblockB
>>     \item Pomme
>>   \endBlockB
>>   \beginblockA
>>     \item Pear
>>   \endblockA
>>   \beginblockB
>>     \item Poire
>>   \endBlockB
>> \stopitemize
>>
>> This does not work.
> 
> 
> I don't know anything about how blocks work, so this may be completely 
> off-base, but if they do any sort of grouping, that would be quite 
> sufficient to cause problems in a situation like that.  Does this work?
> 
> \startitemize
>   \item \beginblockA
>     Apple
>   \endblockA
>   \item \beginblockB
>     Pomme
>   \endBlockB
>   \item \beginblockA
>     Pear
>   \endblockA
>   \item \beginblockB
>     Poire
>   \endBlockB
> \stopitemize
> 
> - Brooks
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re: blocks in itemize
  2005-08-22 20:16     ` Rob Ermers
@ 2005-08-22 20:39       ` Rob Ermers
  2005-08-23 19:32         ` Mojca Miklavec
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Ermers @ 2005-08-22 20:39 UTC (permalink / raw)


Hi,

If I make sure there is enough space, i.e. more than one space, between 
the \begin... and the text, it works! However in the pdf the item drops 
a line down, like this:


*
     Ik vraag me af ...

Does anyone have a workaround?

Kind regards,

Robert


\defineblock[Nederlandsblok, Engelsblok]

\starttext
\startitemize
\item    \beginNederlandsblok         Ik vraag me af of ze ook appels 
verkopen
         \endNederlandsblok
         \beginEngelsblok         I really wonder if they do sell apples
         \endEngelsblok
\item         \beginNederlandsblok         Ik vraag me af of ze ook 
appels verkopen
         \endNederlandsblok
         \beginEngelsblok         I really wonder if they do sell apples
         \endEngelsblok
\stopitemize
\stoptext


Rob Ermers wrote:
> Thanks Brooks and Olivier,
> I'm afraid the problem has not entirely been solved.
> 
> Brooks' solution works in the sense that I can hide BlockA or B 
> (\hideblocks[BlockA]), but the \items remain, and empty items are 
> generated.
> 
> Olivier's suggestion is processed, the result is only one language. Now 
> now I wonder how to hide either one of the languages. The document I 
> want to produce is monolingual, either Dutch or English.
> 
> Thanks again!
> 
> Kind regards,
> 
> Robert
> 
> 
> 
> Brooks Moses wrote:
> 
>> At 04:58 AM 8/22/2005, you wrote:
>>
>>> Thanks for your reaction. My original proposal was:
>>>
>>> \startitemize
>>>   \beginblockA
>>>     \item Apple
>>>   \endblockA
>>>   \beginblockB
>>>     \item Pomme
>>>   \endBlockB
>>>   \beginblockA
>>>     \item Pear
>>>   \endblockA
>>>   \beginblockB
>>>     \item Poire
>>>   \endBlockB
>>> \stopitemize
>>>
>>> This does not work.
>>
>>
>>
>> I don't know anything about how blocks work, so this may be completely 
>> off-base, but if they do any sort of grouping, that would be quite 
>> sufficient to cause problems in a situation like that.  Does this work?
>>
>> \startitemize
>>   \item \beginblockA
>>     Apple
>>   \endblockA
>>   \item \beginblockB
>>     Pomme
>>   \endBlockB
>>   \item \beginblockA
>>     Pear
>>   \endblockA
>>   \item \beginblockB
>>     Poire
>>   \endBlockB
>> \stopitemize
>>
>> - Brooks
>>
>> _______________________________________________
>> 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
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: blocks in itemize
  2005-08-22 20:39       ` Rob Ermers
@ 2005-08-23 19:32         ` Mojca Miklavec
  2005-08-23 21:36           ` Rob Ermers
  2005-08-24  6:15           ` Hans Hagen Outside
  0 siblings, 2 replies; 7+ messages in thread
From: Mojca Miklavec @ 2005-08-23 19:32 UTC (permalink / raw)



Rob Ermers wrote:
> Hi,
> 
> If I make sure there is enough space, i.e. more than one space, between 
> the \begin... and the text, it works! However in the pdf the item drops 
> a line down, like this:

See \def\dodefineblock in core-buf.tex.

Does
     \setupblock[Nederlandsblok][before=,after=]
     \setupblock[Engelsblok][before=,after=]
solve your problem?

Besides that, I would prefer to define something like
   \def\NlEn#1#2{%
     \beginNederlandsblok%
       {#1}%
     \endNederlandsblok%
     \beginEngelsblok%
       {#2}%
     \endEngelsblok}

in your case, but you should ask someone else why this doesn't work (I 
guess it's some strange expansion problem again - I never understood 
that topic).

Another extremely lightweight TeX solution:

\newif\ifenglish
\englishtrue % \englishfalse

\def\NlEn#1#2{\ifenglish{#2}\else{#1}\fi}
\starttext
\NlEn{Dutch}{English}
\stoptext

However, if you want to have more complex stuff in it, you probably have 
to use a more complex definition (send an exaple that fails).

Mojca

> \defineblock[Nederlandsblok, Engelsblok]
> 
> \starttext
> \startitemize
> \item    \beginNederlandsblok         Ik vraag me af of ze ook appels 
> verkopen
>         \endNederlandsblok
>         \beginEngelsblok         I really wonder if they do sell apples
>         \endEngelsblok
> \item         \beginNederlandsblok         Ik vraag me af of ze ook 
> appels verkopen
>         \endNederlandsblok
>         \beginEngelsblok         I really wonder if they do sell apples
>         \endEngelsblok
> \stopitemize
> \stoptext

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: blocks in itemize
  2005-08-23 19:32         ` Mojca Miklavec
@ 2005-08-23 21:36           ` Rob Ermers
  2005-08-24  6:15           ` Hans Hagen Outside
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Ermers @ 2005-08-23 21:36 UTC (permalink / raw)


Hi everybody,

The solution below works. Thanks a lot!

Using Mojca's solution plus a newline after the command apparently does 
the trick.

After that, I didn't try the other solution, which resembles Olivier's.

Kind regards,

Robert



\defineblock[Nederlandsblok]
\defineblock[Engelsblok]
\setupblock[Nederlandsblok][before=,after=]
\setupblock[Engelsblok][before=,after=]

\hideblocks[Nederlandsblok]
%\hideblocks[Engelsblok]

\starttext

there
  \beginNederlandsblok
  Ik vraag me af of ze ook appels verkopen 1
  \endNederlandsblok
\beginEngelsblok
I really wonder if they do sell apples  1
\endEngelsblok
there there

\startitemize
\item         \beginNederlandsblok%
Ik vraag me af of ze ook appels verkopen 2
\endNederlandsblok
\beginEngelsblok
I really wonder if they do sell apples 2
\endEngelsblok

\item     \beginNederlandsblok
Ik vraag me af of ze ook appels verkopen 3
\endNederlandsblok
               \beginEngelsblok
               I really wonder if they do sell apples  3
               \endEngelsblok
\stopitemize

\stoptext
Mojca Miklavec wrote:
> 
> Rob Ermers wrote:
> 
>> Hi,
>>
>> If I make sure there is enough space, i.e. more than one space, 
>> between the \begin... and the text, it works! However in the pdf the 
>> item drops a line down, like this:
> 
> 
> See \def\dodefineblock in core-buf.tex.
> 
> Does
>     \setupblock[Nederlandsblok][before=,after=]
>     \setupblock[Engelsblok][before=,after=]
> solve your problem?
> 
> Besides that, I would prefer to define something like
>   \def\NlEn#1#2{%
>     \beginNederlandsblok%
>       {#1}%
>     \endNederlandsblok%
>     \beginEngelsblok%
>       {#2}%
>     \endEngelsblok}
> 
> in your case, but you should ask someone else why this doesn't work (I 
> guess it's some strange expansion problem again - I never understood 
> that topic).
> 
> Another extremely lightweight TeX solution:
> 
> \newif\ifenglish
> \englishtrue % \englishfalse
> 
> \def\NlEn#1#2{\ifenglish{#2}\else{#1}\fi}
> \starttext
> \NlEn{Dutch}{English}
> \stoptext
> 
> However, if you want to have more complex stuff in it, you probably have 
> to use a more complex definition (send an exaple that fails).
> 
> Mojca
> 
>> \defineblock[Nederlandsblok, Engelsblok]
>>
>> \starttext
>> \startitemize
>> \item    \beginNederlandsblok         Ik vraag me af of ze ook appels 
>> verkopen
>>         \endNederlandsblok
>>         \beginEngelsblok         I really wonder if they do sell apples
>>         \endEngelsblok
>> \item         \beginNederlandsblok         Ik vraag me af of ze ook 
>> appels verkopen
>>         \endNederlandsblok
>>         \beginEngelsblok         I really wonder if they do sell apples
>>         \endEngelsblok
>> \stopitemize
>> \stoptext
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: blocks in itemize
  2005-08-23 19:32         ` Mojca Miklavec
  2005-08-23 21:36           ` Rob Ermers
@ 2005-08-24  6:15           ` Hans Hagen Outside
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen Outside @ 2005-08-24  6:15 UTC (permalink / raw)


Mojca Miklavec wrote:

>
> Besides that, I would prefer to define something like
>   \def\NlEn#1#2{%
>     \beginNederlandsblok%
>       {#1}%
>     \endNederlandsblok%
>     \beginEngelsblok%
>       {#2}%
>     \endEngelsblok}
>
> in your case, but you should ask someone else why this doesn't work (I 
> guess it's some strange expansion problem again - I never understood 
> that topic).

because there is parsing involved (how else to determine the end condition 

you may try: 

\usememorybuffers

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-08-24  6:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20050822114120.GA19715@blackowl.org>
2005-08-22 11:58 ` blocks in itemize r.ermers
2005-08-22 18:31   ` Brooks Moses
2005-08-22 20:16     ` Rob Ermers
2005-08-22 20:39       ` Rob Ermers
2005-08-23 19:32         ` Mojca Miklavec
2005-08-23 21:36           ` Rob Ermers
2005-08-24  6:15           ` Hans Hagen Outside

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).