ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: combined style?
Date: Tue, 19 Jun 2012 13:08:31 +0200	[thread overview]
Message-ID: <C78F1153-6073-47FE-9C91-B52C222276E1@googlemail.com> (raw)
In-Reply-To: <4ED20042-DA8D-4B6B-A73C-A4D9EFB2CAE9@uva.nl>


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
___________________________________________________________________________________


      reply	other threads:[~2012-06-19 11:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19 10:44 Meer, H. van der
2012-06-19 11:08 ` Wolfgang Schuster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C78F1153-6073-47FE-9C91-B52C222276E1@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).