ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How do I use entities in DocBook in ConTeXt
@ 2003-08-19  7:54 Guy Worthington
  2003-08-19 15:31 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Guy Worthington @ 2003-08-19  7:54 UTC (permalink / raw)


Although I use emacs as a text editor, I'm not confident in using
utf-8 encodings.  So if I can I'd prefer to use entities for the
characters not defined in ASCII.

How can I define entities such as "“" (for the left double
quotation character) and "”" (for the right double quotation
character) so as the context-processor can process them.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I use entities in DocBook in ConTeXt
  2003-08-19  7:54 How do I use entities in DocBook in ConTeXt Guy Worthington
@ 2003-08-19 15:31 ` Hans Hagen
  2003-08-20 12:58   ` Guy Worthington
  2003-08-21 19:49   ` Simon Pepping
  0 siblings, 2 replies; 5+ messages in thread
From: Hans Hagen @ 2003-08-19 15:31 UTC (permalink / raw)


At 15:54 19/08/2003 +0800, you wrote:
>Although I use emacs as a text editor, I'm not confident in using
>utf-8 encodings.  So if I can I'd prefer to use entities for the
>characters not defined in ASCII.
>
>How can I define entities such as "“" (for the left double
>quotation character) and "”" (for the right double quotation
>character) so as the context-processor can process them.

see xtag-ent.tex



-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I use entities in DocBook in ConTeXt
  2003-08-19 15:31 ` Hans Hagen
@ 2003-08-20 12:58   ` Guy Worthington
  2003-08-21 19:49   ` Simon Pepping
  1 sibling, 0 replies; 5+ messages in thread
From: Guy Worthington @ 2003-08-20 12:58 UTC (permalink / raw)


Hans Hagen wrote:

> Guy Worthington wrote:
>>How can I define entities such as "“" (for the left double
>>quotation character) and "”" (for the right double quotation
>>character) so as the context-processor can process them.

> see xtag-ent.tex

(Look mom -- I'm reading the source files.)



Thanks for the pointer Hans, 

I wound up defining "“" as:

   \defineXMLentity [ldquo] {``} 

and it seems to be doing what I want.  

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I use entities in DocBook in ConTeXt
  2003-08-19 15:31 ` Hans Hagen
  2003-08-20 12:58   ` Guy Worthington
@ 2003-08-21 19:49   ` Simon Pepping
  2003-08-22 12:02     ` Guy Worthington
  1 sibling, 1 reply; 5+ messages in thread
From: Simon Pepping @ 2003-08-21 19:49 UTC (permalink / raw)


On Tue, Aug 19, 2003 at 05:31:47PM +0200, Hans Hagen wrote:
> At 15:54 19/08/2003 +0800, you wrote:
> >Although I use emacs as a text editor, I'm not confident in using
> >utf-8 encodings.  So if I can I'd prefer to use entities for the
> >characters not defined in ASCII.
> >
> >How can I define entities such as "“" (for the left double
> >quotation character) and "”" (for the right double quotation
> >character) so as the context-processor can process them.
> 
> see xtag-ent.tex

Docbook comes with a lot of entities defined, see the subdirectory ent
in the docbookx distribution.

Unfortunately, DocbookInContext does not yet recognize those
entities. I suppose I should make an effort to translate the entity
files to Context.

xtag-ent can only be used if it agrees with the entity definitions in
the DTD.

emacs 21 is really a good utf-8 editor. It has the TeX input method,
meaning that many characters can be input by giving their TeX name,
e.g. \sum. Loading utf-8 files is a bit clumsy, with the command `C-x
RET c' (universal-coding-system-argument).

If you put this at the end of the file, it is automatically read in
utf-8 encoding next time:

%% Local Variables:
%% current-language-environment: UTF-8
%% coding: utf-8
%% default-input-method: TeX
%% End:

And this is a better way to read it in utf-8 encoding
non-automatically (commands to be put in .emacs):

;; find a file (read-only) with utf-8 coding system
(defun find-file-utf-8 (file)
  "Find file FILE with utf-8 coding system."
  (interactive "FFile name: ")
  (let ((coding-system-for-read 'utf-8))
	(find-file file)))

(defun find-file-read-only-utf-8 (file)
  "Find file FILE read-only with utf-8 coding system."
  (interactive "FFile name read-only: ")
  (let ((coding-system-for-read 'utf-8))
	(find-file-read-only file)))

;; bind C-x C-f and C-x C-r to these functions
(global-set-key [(control ?x)(control ?f)]
				'find-file-utf-8)
(global-set-key [(control ?x)(control ?r)]
				'find-file-read-only-utf-8)

Regards, Simon

-- 
Simon Pepping
email: spepping@scaprea.hobby.nl
home page: scaprea.hobby.nl

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How do I use entities in DocBook in ConTeXt
  2003-08-21 19:49   ` Simon Pepping
@ 2003-08-22 12:02     ` Guy Worthington
  0 siblings, 0 replies; 5+ messages in thread
From: Guy Worthington @ 2003-08-22 12:02 UTC (permalink / raw)


Simon Pepping wrote:

> emacs 21 is really a good utf-8 editor. It has the TeX input method,
> meaning that many characters can be input by giving their TeX name,
> e.g. \sum. Loading utf-8 files is a bit clumsy, with the command `C-x
> RET c' (universal-coding-system-argument).

You're a great evangelist for utf-8.  However Hans and you have made
it easy to customize a TeX-stylesheet (if that's the right word for
the TeX file that wraps the XML file).  And consequently I'm not yet
ready to dump my faithful (and fast) NTEmacs for TEI-emacs, which has
all the bells and whistles you're talking about.

I guess that I'm just too comfortable in my 7-bit world.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-08-22 12:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-19  7:54 How do I use entities in DocBook in ConTeXt Guy Worthington
2003-08-19 15:31 ` Hans Hagen
2003-08-20 12:58   ` Guy Worthington
2003-08-21 19:49   ` Simon Pepping
2003-08-22 12:02     ` Guy Worthington

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).