* ConTeXt, XML en-dash
@ 2005-11-29 2:04 Johannes Graumann
2005-11-29 7:08 ` Taco Hoekwater
2005-11-29 9:15 ` Hans Hagen
0 siblings, 2 replies; 8+ messages in thread
From: Johannes Graumann @ 2005-11-29 2:04 UTC (permalink / raw)
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?
Thanks for your help,
Joh
--
+----------------------------------------------------------------------+
| Johannes Graumann, Dipl. Biol. |
| |
| Graduate Student Tel.: ++1 (626) 395 6602 |
| Deshaies Lab Fax.: ++1 (626) 395 5739 |
| Department of Biology |
| CALTECH, M/C 156-29 |
| 1200 E. California Blvd. |
| Pasadena, CA 91125 |
| USA |
+----------------------------------------------------------------------+
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ConTeXt, XML en-dash
2005-11-29 2:04 ConTeXt, XML en-dash Johannes Graumann
@ 2005-11-29 7:08 ` Taco Hoekwater
2005-11-29 19:46 ` Johannes Graumann
2005-11-29 9:15 ` Hans Hagen
1 sibling, 1 reply; 8+ messages in thread
From: Taco Hoekwater @ 2005-11-29 7:08 UTC (permalink / raw)
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] --
That should have been:
\defineXMLentity [en] {--}
Cheers, Taco
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ConTeXt, XML en-dash
2005-11-29 7:08 ` Taco Hoekwater
@ 2005-11-29 19:46 ` Johannes Graumann
0 siblings, 0 replies; 8+ messages in thread
From: Johannes Graumann @ 2005-11-29 19:46 UTC (permalink / raw)
Thanks!
Fixed now!
Did Hans really mean to write the novel in this thread as a response to my
problem?
Joh
Taco Hoekwater wrote:
> 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] --
>
> That should have been:
>
> \defineXMLentity [en] {--}
>
> Cheers, Taco
--
+----------------------------------------------------------------------+
| Johannes Graumann, Dipl. Biol. |
| |
| Graduate Student Tel.: ++1 (626) 395 6602 |
| Deshaies Lab Fax.: ++1 (626) 395 5739 |
| Department of Biology |
| CALTECH, M/C 156-29 |
| 1200 E. California Blvd. |
| Pasadena, CA 91125 |
| USA |
+----------------------------------------------------------------------+
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ConTeXt, XML en-dash
2005-11-29 2:04 ConTeXt, XML en-dash Johannes Graumann
2005-11-29 7:08 ` Taco Hoekwater
@ 2005-11-29 9:15 ` Hans Hagen
2005-11-29 19:59 ` Johannes Graumann
1 sibling, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2005-11-29 9:15 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ConTeXt, XML en-dash
2005-11-29 9:15 ` Hans Hagen
@ 2005-11-29 19:59 ` Johannes Graumann
2005-11-29 21:14 ` Hans Hagen
0 siblings, 1 reply; 8+ messages in thread
From: Johannes Graumann @ 2005-11-29 19:59 UTC (permalink / raw)
Gee ... Tacos fix (see thread) worked just fine ... when would I need this?
Joh
Hans Hagen wrote:
> 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
--
+----------------------------------------------------------------------+
| Johannes Graumann, Dipl. Biol. |
| |
| Graduate Student Tel.: ++1 (626) 395 6602 |
| Deshaies Lab Fax.: ++1 (626) 395 5739 |
| Department of Biology |
| CALTECH, M/C 156-29 |
| 1200 E. California Blvd. |
| Pasadena, CA 91125 |
| USA |
+----------------------------------------------------------------------+
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Re: ConTeXt, XML en-dash
2005-11-29 19:59 ` Johannes Graumann
@ 2005-11-29 21:14 ` Hans Hagen
2005-11-29 22:37 ` Johannes Graumann
0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2005-11-29 21:14 UTC (permalink / raw)
Johannes Graumann wrote:
>Gee ... Tacos fix (see thread) worked just fine ... when would I need this?
>
>
>
taco's fix deals with entities; the other method is meant for direct
input (say three -'s in the input stream)
Hans
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Re: ConTeXt, XML en-dash
2005-11-29 21:14 ` Hans Hagen
@ 2005-11-29 22:37 ` Johannes Graumann
2005-11-30 8:16 ` Hans Hagen
0 siblings, 1 reply; 8+ messages in thread
From: Johannes Graumann @ 2005-11-29 22:37 UTC (permalink / raw)
Hans Hagen wrote:
>>Gee ... Tacos fix (see thread) worked just fine ... when would I need
>>this?
>>
> taco's fix deals with entities; the other method is meant for direct
> input (say three -'s in the input stream)
>
I see. I was hoping to find some way of mapping my (custom) XML eventually
somehow into ooffice as well (any pointers on how one might create a style
sheet for that are HIGHLY appreciated) and think the entity method is
therefore more future proof for me.
Joh
--
+----------------------------------------------------------------------+
| Johannes Graumann, Dipl. Biol. |
| |
| Graduate Student Tel.: ++1 (626) 395 6602 |
| Deshaies Lab Fax.: ++1 (626) 395 5739 |
| Department of Biology |
| CALTECH, M/C 156-29 |
| 1200 E. California Blvd. |
| Pasadena, CA 91125 |
| USA |
+----------------------------------------------------------------------+
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Re: Re: ConTeXt, XML en-dash
2005-11-29 22:37 ` Johannes Graumann
@ 2005-11-30 8:16 ` Hans Hagen
0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2005-11-30 8:16 UTC (permalink / raw)
Johannes Graumann wrote:
>Hans Hagen wrote:
>
>
>
>>>Gee ... Tacos fix (see thread) worked just fine ... when would I need
>>>this?
>>>
>>>
>>>
>>taco's fix deals with entities; the other method is meant for direct
>>input (say three -'s in the input stream)
>>
>>
>>
>I see. I was hoping to find some way of mapping my (custom) XML eventually
>somehow into ooffice as well (any pointers on how one might create a style
>sheet for that are HIGHLY appreciated) and think the entity method is
>therefore more future proof for me.
>
>
definitely, but when you deal with third part (utf-8 encoded) xml, you
can expect anything (a dozen of different dashes to start with -)
Hans
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-11-30 8:16 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-29 2:04 ConTeXt, XML en-dash Johannes Graumann
2005-11-29 7:08 ` Taco Hoekwater
2005-11-29 19:46 ` Johannes Graumann
2005-11-29 9:15 ` Hans Hagen
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
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).