From: Hans Hagen <pragma@wxs.nl>
Subject: Re: ConTeXt, XML en-dash
Date: Tue, 29 Nov 2005 10:15:32 +0100 [thread overview]
Message-ID: <438C1C34.1070502@wxs.nl> (raw)
In-Reply-To: <dmgd05$6d8$1@sea.gmane.org>
Johannes Graumann wrote:
>Hello,
>
>I just started to experiment with typesetting XML using ConTeXt ...
>I ran into this problem which I'm unable to solve:
>1) I added the following rule to my xml map file:
> \defineXMLentity [en] --
>2) yet calling &en; in my document results in the TeX equivalent of "-"
>rather than "--" being typeset.
>
>Any pointers?
>
>
add this to type-exa.tex (or to your doc file)
\starttypescript [serif,sans,mono] [handling] [noligs]
\setupfontsynonym [\typescriptprefix\typescriptone ]
[handling=\typescriptthree]
\setupfontsynonym [\typescriptprefix\typescriptone Bold]
[handling=\typescriptthree]
\setupfontsynonym [\typescriptprefix\typescriptone Slanted]
[handling=\typescriptthree]
\setupfontsynonym [\typescriptprefix\typescriptone Italic]
[handling=\typescriptthree]
\setupfontsynonym [\typescriptprefix\typescriptone BoldSlanted]
[handling=\typescriptthree]
\setupfontsynonym [\typescriptprefix\typescriptone BoldItalic]
[handling=\typescriptthree]
\stoptypescript
explanation for David Arnold (who is eager to know the obscure
typescript features -): the macro \typescriptprefix{serif} will expand
to Serif, because in type-def we have the definition:
\definetypescriptprefix [serif] [Serif]
\definetypescriptprefix [sans] [Sans]
\definetypescriptprefix [mono] [Mono]
so, instead of defining 3 times n_of_encodings we can stick to one
typescriptdefinition which is much more efficient.
ok, after this is done, you need to define a typeface using this
handling; because of the nature of the underlying tex font mechanism
(global optimizations in tex itself) we need to do it this way:
\usetypescript[serif][handling][noligs]
\definetypeface[mine][rm][serif][latin-modern][default][encoding=texnansi]
\definetypeface[mine][rm][serif][latin-modern][default][encoding=texnansi]
\setupbodyfont[mine,10pt]
\starttext
asjemenou-het--lijkt---te----werken
\stoptext
The noligs handling is selective (only ? ! - -- --- are taken care of,
so you keep the fi ligatures)
Hans
next prev parent reply other threads:[~2005-11-29 9:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-29 2:04 Johannes Graumann
2005-11-29 7:08 ` Taco Hoekwater
2005-11-29 19:46 ` Johannes Graumann
2005-11-29 9:15 ` Hans Hagen [this message]
2005-11-29 19:59 ` Johannes Graumann
2005-11-29 21:14 ` Hans Hagen
2005-11-29 22:37 ` Johannes Graumann
2005-11-30 8:16 ` Hans Hagen
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=438C1C34.1070502@wxs.nl \
--to=pragma@wxs.nl \
--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).