* combined style?
@ 2012-06-19 10:44 Meer, H. van der
2012-06-19 11:08 ` Wolfgang Schuster
0 siblings, 1 reply; 2+ messages in thread
From: Meer, H. van der @ 2012-06-19 10:44 UTC (permalink / raw)
To: ConTeXt NTG
I had hoped to be able to combine style features in parameters, in this manner:
\macro[param={a,b}]. Doing this with foregroundstyle did not work, see the following examples:
\framed[foregroundstyle=italic]{ABCD} => typesets in italic
\framed[foregroundstyle=small]{ABCD} => typesets small
\framed[foregroundstyle={small,italic}]{ABCD} => typesets not in small-italic but first "small,italic" followed by the framed ABCD
Of course the effect wanted can be obtained by \framed[foregroundstyle={\tfx\it}]{ABCD}
But my problem is the fact that I would like to use style settings from within XML-nodes in the following manner:
<node style="small,italic">
leading to somewhere a call of \setupsomething[foregroundstyle={small,italic}].
It is a pity that <node style="small" style="italic"> does not work, because with two successive calls
\setupsomething[foregroundstyle=small]
\setupsomething[foregroundstyle=italic]
the first setting is lost.
Translating internally smallitallic to \tfx\it is a remote possibility, but then each and every combination has to be provided for. There are simply too many of them if one wants to combine size (small,large) type (mono,calligraphic,serif,sansserif) and (bold, italic, slanted, normal).
Is there a solution?
Hans van der Meer
___________________________________________________________________________________
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] 2+ messages in thread
* Re: combined style?
2012-06-19 10:44 combined style? Meer, H. van der
@ 2012-06-19 11:08 ` Wolfgang Schuster
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2012-06-19 11:08 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 19.06.2012 um 12:44 schrieb Meer, H. van der:
> I had hoped to be able to combine style features in parameters, in this manner:
> \macro[param={a,b}]. Doing this with foregroundstyle did not work, see the following examples:
>
> \framed[foregroundstyle=italic]{ABCD} => typesets in italic
> \framed[foregroundstyle=small]{ABCD} => typesets small
> \framed[foregroundstyle={small,italic}]{ABCD} => typesets not in small-italic but first "small,italic" followed by the framed ABCD
>
> Of course the effect wanted can be obtained by \framed[foregroundstyle={\tfx\it}]{ABCD}
>
> But my problem is the fact that I would like to use style settings from within XML-nodes in the following manner:
> <node style="small,italic">
> leading to somewhere a call of \setupsomething[foregroundstyle={small,italic}].
> It is a pity that <node style="small" style="italic"> does not work, because with two successive calls
> \setupsomething[foregroundstyle=small]
> \setupsomething[foregroundstyle=italic]
> the first setting is lost.
>
> Translating internally smallitallic to \tfx\it is a remote possibility, but then each and every combination has to be provided for. There are simply too many of them if one wants to combine size (small,large) type (mono,calligraphic,serif,sansserif) and (bold, italic, slanted, normal).
>
> Is there a solution?
\definealternativestyle[smallitalic][\itx][\itx]
\starttext
\framed[foregroundstyle=small]{text}
\framed[foregroundstyle=italic]{text}
\framed[foregroundstyle=smallitalic]{text}
\stoptext
or
\starttext
\scratchtoks\emptytoks
\appendtoks\tx\to\scratchtoks % check if the style attribute contains “small”
\appendtoks\it\to\scratchtoks % check if the style attribute contains “italic”
\framed[foregroundstyle=\the\scratchtoks]{text}
\stoptext
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] 2+ messages in thread
end of thread, other threads:[~2012-06-19 11:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-19 10:44 combined style? Meer, H. van der
2012-06-19 11:08 ` 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).