ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* itemize textstyle
@ 2011-07-07 14:21 Christian
  2011-07-07 15:12 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Christian @ 2011-07-07 14:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,
is it possible to assign different styles to each itemgroup or level of
'itemization'?
It is possible when using \head to assign a headstyle, but wouldn't it be
nice to assign a certain textstyle to an item level?

Consider something heavily customized (but still useful IMHO) like this:
1. First Level (bold, small caps)
	- Second level (normal)
		> third level (italic)
			* fourth level (smaller font [\tfx], text color dark
gray)

I somehow can't find a way to achieve this, without applying the style in
the actual list.
I also do not know what these before and after keys do, but I assume they
control more the surroundings than being a command that is insterted
"before" and "after" the item text.

Best Regards!

___________________________________________________________________________________
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] 6+ messages in thread

* Re: itemize textstyle
  2011-07-07 14:21 itemize textstyle Christian
@ 2011-07-07 15:12 ` Wolfgang Schuster
  2011-07-07 16:53   ` Christian
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2011-07-07 15:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 07.07.2011 um 16:21 schrieb Christian:

> Hi all,
> is it possible to assign different styles to each itemgroup or level of
> 'itemization'?
> It is possible when using \head to assign a headstyle, but wouldn't it be
> nice to assign a certain textstyle to an item level?
> 
> Consider something heavily customized (but still useful IMHO) like this:
> 1. First Level (bold, small caps)
> 	- Second level (normal)
> 		> third level (italic)
> 			* fourth level (smaller font [\tfx], text color dark
> gray)
> 
> I somehow can't find a way to achieve this, without applying the style in
> the actual list.

\setupitemize[1][style=\bf\setff{smallcaps}]
\setupitemize[3][style=\it]
\setupitemize[4][style=\tfx,color=darkgray]

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] 6+ messages in thread

* Re: itemize textstyle
  2011-07-07 15:12 ` Wolfgang Schuster
@ 2011-07-07 16:53   ` Christian
  2011-07-07 17:23     ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Christian @ 2011-07-07 16:53 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

> > Consider something heavily customized (but still useful IMHO) like this:
> > 1. First Level (bold, small caps)
> > 	- Second level (normal)
> > 		> third level (italic)
> > 			* fourth level (smaller font [\tfx], text color dark
> > gray)
> >
> > I somehow can't find a way to achieve this, without applying the style
> > in the actual list.
> 
> \setupitemize[1][style=\bf\setff{smallcaps}]
> \setupitemize[3][style=\it]
> \setupitemize[4][style=\tfx,color=darkgray]

I already tried the "sytle" parameter (option?). But it has no effect :(
Does it work for you?

___________________________________________________________________________________
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] 6+ messages in thread

* Re: itemize textstyle
  2011-07-07 16:53   ` Christian
@ 2011-07-07 17:23     ` Wolfgang Schuster
  2011-07-07 18:19       ` Christian
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2011-07-07 17:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 07.07.2011 um 18:53 schrieb Christian:

>> \setupitemize[1][style=\bf\setff{smallcaps}]
>> \setupitemize[3][style=\it]
>> \setupitemize[4][style=\tfx,color=darkgray]
> 
> I already tried the "sytle" parameter (option?). But it has no effect :(
> Does it work for you?

Wrong key, style is for the symbol/number of the item. A real setup
key for the content isn’t available and the best i can do (without
extra markup around each entry) is the following.

\definefontfeature[smcp][smcp=yes]

\setupitemize[1][command=\bf\addff{smcp}]
\setupitemize[2][command=\tf\subfs{smcp}]
\setupitemize[3][command=\it]
\setupitemize[4][command=\tf\darkgray,color=black]

\setupbodyfont[palatino]

\starttext

\startitemize
\item One
	\startitemize
	\item Two
		\startitemize
		\item Three
			\startitemize
			\item Four
			\stopitemize
		\stopitemize
	\stopitemize
\stopitemize

\stoptext

With some extra markup a better result is possible:

\definefontfeature[smcp][smcp=yes]

\definestartstop[itemzero]           [before=\startitem,after=\stopitem,]
\definestartstop[itemone]  [itemzero][style=\bf\addff{smcp}]
\definestartstop[itemtwo]  [itemzero][style=\tf]
\definestartstop[itemthree][itemzero][style=\it]
\definestartstop[itemfour] [itemzero][style=\tfx,color=darkgray]

\setupbodyfont[palatino]

\starttext

\startitemize
\startitemone One \stopitemone
	\startitemize
	\startitemtwo Two \stopitemtwo
		\startitemize
		\startitemthree Three \stopitemthree
			\startitemize
			\startitemfour Four \stopitemfour
			\stopitemize
		\stopitemize
	\stopitemize
\stopitemize

\stoptext

What you can also do is to ask Hans for style and color keys
to change the layout of the itemize content (would then only
be available when you use \startitem ... \stopitem).

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] 6+ messages in thread

* Re: itemize textstyle
  2011-07-07 17:23     ` Wolfgang Schuster
@ 2011-07-07 18:19       ` Christian
  2011-07-07 18:35         ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Christian @ 2011-07-07 18:19 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

> >> \setupitemize[1][style=\bf\setff{smallcaps}]
> >> \setupitemize[3][style=\it]
> >> \setupitemize[4][style=\tfx,color=darkgray]
> >
> > I already tried the "sytle" parameter (option?). But it has no effect
> > :( Does it work for you?
> 
> Wrong key, style is for the symbol/number of the item. A real setup key
for
> the content isn't available and the best i can do (without extra markup
> around each entry) is the following.
> 
> \definefontfeature[smcp][smcp=yes]
> 
> \setupitemize[1][command=\bf\addff{smcp}]
> \setupitemize[2][command=\tf\subfs{smcp}]
> \setupitemize[3][command=\it]
> \setupitemize[4][command=\tf\darkgray,color=black]
> 
> \setupbodyfont[palatino]
> 
> \starttext
> 
> \startitemize
> \item One
> 	\startitemize
> 	\item Two
> 		\startitemize
> 		\item Three
> 			\startitemize
> 			\item Four
> 			\stopitemize
> 		\stopitemize
> 	\stopitemize
> \stopitemize
> 
> \stoptext
> 
> With some extra markup a better result is possible:
> 
> \definefontfeature[smcp][smcp=yes]
> 
> \definestartstop[itemzero]           [before=\startitem,after=\stopitem,]
> \definestartstop[itemone]  [itemzero][style=\bf\addff{smcp}]
> \definestartstop[itemtwo]  [itemzero][style=\tf]
> \definestartstop[itemthree][itemzero][style=\it]
> \definestartstop[itemfour] [itemzero][style=\tfx,color=darkgray]
> 
> \setupbodyfont[palatino]
> 
> \starttext
> 
> \startitemize
> \startitemone One \stopitemone
> 	\startitemize
> 	\startitemtwo Two \stopitemtwo
> 		\startitemize
> 		\startitemthree Three \stopitemthree
> 			\startitemize
> 			\startitemfour Four \stopitemfour
> 			\stopitemize
> 		\stopitemize
> 	\stopitemize
> \stopitemize
> 
> \stoptext
> 
> What you can also do is to ask Hans for style and color keys to change the
> layout of the itemize content (would then only be available when you use
> \startitem ... \stopitem).

Thank you very much for this example!
This is already more than enough for a starting point. I guess the style and
color keys for items might be an idea to hold on to. But at the moment I
neither do want to push this, nor is there the urgent need because of your
code. Also, there is surely enough work to do with more important stuff ;)
Thanks again!

___________________________________________________________________________________
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] 6+ messages in thread

* Re: itemize textstyle
  2011-07-07 18:19       ` Christian
@ 2011-07-07 18:35         ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2011-07-07 18:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 07.07.2011 um 20:19 schrieb Christian:

> Thank you very much for this example!
> This is already more than enough for a starting point. I guess the style and
> color keys for items might be an idea to hold on to. But at the moment I
> neither do want to push this, nor is there the urgent need because of your
> code. Also, there is surely enough work to do with more important stuff ;)

To be on the save side i suggest to use the second method because the first
can result in wrong spacing when you change the font size 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] 6+ messages in thread

end of thread, other threads:[~2011-07-07 18:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-07 14:21 itemize textstyle Christian
2011-07-07 15:12 ` Wolfgang Schuster
2011-07-07 16:53   ` Christian
2011-07-07 17:23     ` Wolfgang Schuster
2011-07-07 18:19       ` Christian
2011-07-07 18:35         ` Wolfgang Schuster

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