ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \startitemize[columns] broken with backgrounds?
@ 2012-01-23  7:39 Otared Kavian
  2012-01-23  7:45 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Otared Kavian @ 2012-01-23  7:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

It seems that when using background, \startitemize[columns] does not work as expected: there are no columns, and the numbers of the items are pushed to the left. 
Below is a not so minimal example: the resulting PDF can be found here:
	http://dl.dropbox.com/u/4316076/enumeration-background-exo.pdf
I am not sure whether this behaviour began with a recent beta or  not. 
The version I am using is: ConTeXt  ver: 2012.01.16 18:33 MKIV.

Best regards: OK
%%% begin enumeration-background-exo.pdf
\definenumber[MyExoNumber][way=bysection,sectionumber=yes]
\setuptextrules[rulecolor=darkred]
\define\ExoCommand{\incrementnumber[MyExoNumber]
	\textrule[top]{Exercise \getnumber[MyExoNumber]}
	\startbackground[frame=off,leftframe=on,
		framecolor=darkred]}

\defineenumeration[exo]
	[location=hanging,
	width=fit,
	text={}, 
	number=hide,
	number=no,
	before={\ExoCommand}, 
	after={\stopbackground\blank}]

\defineconversion[exercice][\numbers]
\def\StartQuestions{%
	\startitemize[exercice][width=2em,packed,style=bold,stopper=,right=)]}
\def\StopQuestions{\stopitemize}
\def\q{\item}

\starttext

%%%%%%%%%%%%%%%%%
\startexo
Prove that
\startformula
\cos(nt) + {\rm i}\sin(nt) = (\cos(t) + {\rm i}\sin(t))^n.
\stopformula
\StartQuestions
\dorecurse{5}{\q This is question \recurselevel. }
\StopQuestions
\stopexo
%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%
\startexo Solve the following equations or inequations:
\startitemize[r,packed,columns][stopper=,left={(},right={)},distance=1em]
\item $3x - 5 = 4$.
\item $(x-1)(x+3) = 5$.
\item $2 - 3x \geq 2 x - 8$.
\item $(x - 1) \leq (x-1)(x+2)$.
\item $2x^2 - 3x +1 < 0$.
\item $x^2 - 4x \geq x - x^2 - 1$.
\stopitemize
\stopexo
%%%%%%%%%%%%%%%%%

\stoptext
%%% end enumeration-background-exo.pdf
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: \startitemize[columns] broken with backgrounds?
  2012-01-23  7:39 \startitemize[columns] broken with backgrounds? Otared Kavian
@ 2012-01-23  7:45 ` Wolfgang Schuster
  2012-01-23  9:47   ` Otared Kavian
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2012-01-23  7:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 23.01.2012 um 08:39 schrieb Otared Kavian:

> Hi all,
> 
> It seems that when using background, \startitemize[columns] does not work as expected: there are no columns, and the numbers of the items are pushed to the left. 

You can use the columns environment (which is used by itemize) in a framed, framed text or background environment.

What you can do is to replace the background environment with text background or you use the simple columns environment which does work in framed etc.

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


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

* Re: \startitemize[columns] broken with backgrounds?
  2012-01-23  7:45 ` Wolfgang Schuster
@ 2012-01-23  9:47   ` Otared Kavian
  2012-01-23 10:29     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Otared Kavian @ 2012-01-23  9:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 23 janv. 2012, at 08:45, Wolfgang Schuster wrote:

> 
> Am 23.01.2012 um 08:39 schrieb Otared Kavian:
> 
>> Hi all,
>> 
>> It seems that when using background, \startitemize[columns] does not work as expected: there are no columns, and the numbers of the items are pushed to the left. 
> 
> You can use the columns environment (which is used by itemize) in a framed, framed text or background environment.

Thanks Wolfgang for your attention.
Now that you mention this, I understand that the columns environment cannot be used at the same time as framed or background environments. Is this a definite barrier? 
As a matter of fact changing background to textbackground (as you suggested) did not work neither.

Have a nice day: OK

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


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

* Re: \startitemize[columns] broken with backgrounds?
  2012-01-23  9:47   ` Otared Kavian
@ 2012-01-23 10:29     ` Wolfgang Schuster
  2012-01-23 14:11       ` Otared Kavian
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2012-01-23 10:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 23.01.2012 um 10:47 schrieb Otared Kavian:

> On 23 janv. 2012, at 08:45, Wolfgang Schuster wrote:
> 
>> 
>> Am 23.01.2012 um 08:39 schrieb Otared Kavian:
>> 
>>> Hi all,
>>> 
>>> It seems that when using background, \startitemize[columns] does not work as expected: there are no columns, and the numbers of the items are pushed to the left. 
>> 
>> You can use the columns environment (which is used by itemize) in a framed, framed text or background environment.
> 
> Thanks Wolfgang for your attention.
> Now that you mention this, I understand that the columns environment cannot be used at the same time as framed or background environments. Is this a definite barrier? 

It’s not a limitation of the mechanism \startcolumns uses to make multiple columns because the same mechanism is also used by \startsimplecolumns but of the implementation of the command. When you search the list archive you can find examples with streams which permit columns in \framed etc.

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


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

* Re: \startitemize[columns] broken with backgrounds?
  2012-01-23 10:29     ` Wolfgang Schuster
@ 2012-01-23 14:11       ` Otared Kavian
  0 siblings, 0 replies; 5+ messages in thread
From: Otared Kavian @ 2012-01-23 14:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On 23 janv. 2012, at 11:29, Wolfgang Schuster wrote:
> It’s not a limitation of the mechanism \startcolumns uses to make multiple columns because the same mechanism is also used by \startsimplecolumns but of the implementation of the command. When you search the list archive you can find examples with streams which permit columns in \framed etc.
> 
> Wolfgang

Thanks fo rthe explanations: indeed with my previous setups for having each exercise with a vertical rule at its left, the following modification works fine when I need items in two columns:

\startsimplecolumns
\startitemize[r,packed][margin=standard,stopper=,left={(},right={)},distance=1em]
\item $3x - 5 = 4$.
\item $(x-1)(x+3) = 5$.
\item $2 - 3x \geq 2 x - 8$.
\item $(x - 1) \leq (x-1)(x+2)$.
\item $2x^2 - 3x +1 < 0$.
\item $x^2 - 4x \geq x - x^2 - 1$.
\stopitemize
\stopsimplecolumns

Best regards: OK
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2012-01-23 14:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-23  7:39 \startitemize[columns] broken with backgrounds? Otared Kavian
2012-01-23  7:45 ` Wolfgang Schuster
2012-01-23  9:47   ` Otared Kavian
2012-01-23 10:29     ` Wolfgang Schuster
2012-01-23 14:11       ` Otared Kavian

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).