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: getting inside xhtml / mkii
Date: Fri, 9 May 2008 15:14:55 +0200	[thread overview]
Message-ID: <115224fb0805090614s79a5e9c0lc5729ec56023c45e@mail.gmail.com> (raw)
In-Reply-To: <48244967.50206@jhnet.nl>

On Fri, May 9, 2008 at 2:53 PM, Jelle Huisman <jelle@jhnet.nl> wrote:
> Wolfgang Schuster wrote:
>
> \Mywordstyle is a font switch:
> \def\Mywordstyle #1 {\switchtobodyfont[GentiumItalics]{#1}
> \switchtobodyfont[Gentium]}
>
>
> Do you really want a font switch, isn't a style switch enough in your case
> from roman to italic and back.
>
> Since I also need to be able to switch to a Non-Roman script I do need a
> font switch here (that's also the reason why I use XeTeX and MKII.) Anyway
> when I use \Mywordstyle inside the FormatSpan like this:
>
>     [\XMLpar{span}{class}{}]
>     [word=>\let\FormatSpan\Mywordstyle,
>      defenition=>\let\FormatSpan\Mywordstyle,
>      xlanguagetag=>\let\FormatSpan\Mywordstyle]%
>
> the font change is applied to the "word" and "xlanguagetag"-items, but not
> to the definition-item!?(see attachment) Any idea why and how to solve this?
> (And it looks like there is some unwanted extra space inserted between the
> "word" and "xlanguagetag" as well.)

You could also switch between different typescripts. If you really want to relly
on \switchtobodyfont use it inside of a group because the font switch will be
local to the group and you go back to the global font after the group.

\usetypescript[palatino,times]
\setupbodyfont[palatino]

\defineXMLenvironment [span] [class=]
 {\bgroup
 \processaction
   [\XMLpar{span}{class}{}]
   [word=>\let\FormatSpan\italic,
    defenition=>\let\FormatSpan\bold,
    xlanguagetag=>\def\FormatSpan{\switchtotypeface[times]}]%
 \FormatSpan}
 {\egroup}

\starttext
\startXMLdata

<span class="word" lang="nld">papa</span>

<span class="defenition" lang="en">
 <span class="xlanguagetag" lang="en">Eng</span>
 daddy
</span>

\stopXMLdata

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


  reply	other threads:[~2008-05-09 13:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08 21:32 Jelle Huisman
2008-05-08 21:55 ` Hans Hagen
2008-05-09  8:59   ` Jelle Huisman
2008-05-09  9:30     ` Wolfgang Schuster
2008-05-09  9:56       ` Jelle Huisman
2008-05-09 10:06         ` Wolfgang Schuster
2008-05-09 12:53           ` Jelle Huisman
2008-05-09 13:14             ` Wolfgang Schuster [this message]
2008-05-09 13:57               ` Jelle Huisman
2008-05-09 13:05           ` Hans Hagen
2008-05-09 13:54             ` Jelle Huisman
2008-05-15 11:33             ` Jelle Huisman
2008-05-15 13:07               ` Wolfgang Schuster
2008-05-15 13:27                 ` Jelle Huisman
2008-05-15 13:52                   ` Wolfgang Schuster
2008-05-15 19:54                     ` Jelle Huisman
2008-05-16  9:54                       ` Wolfgang Schuster
2008-05-16 10:19                         ` Jelle Huisman
2008-05-16 10:25                           ` Wolfgang Schuster
2008-05-16 10:41                             ` Jelle Huisman

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=115224fb0805090614s79a5e9c0lc5729ec56023c45e@mail.gmail.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).