How do I use entities in DocBook in ConTeXt
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.
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 -------------------------------------------------------------------------
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.
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
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.
participants (3)
-
Guy Worthington
-
Hans Hagen
-
Simon Pepping