ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Simon Pepping <spepping@scaprea.hobby.nl>
Subject: Re: How do I use entities in DocBook in ConTeXt
Date: Thu, 21 Aug 2003 21:49:32 +0200	[thread overview]
Message-ID: <20030821194932.GA2825@scaprea> (raw)
In-Reply-To: <5.2.0.9.1.20030819173135.03317de8@server-1>

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 "&ldquo;" (for the left double
> >quotation character) and "&rdquo;" (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

  parent reply	other threads:[~2003-08-21 19:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-19  7:54 Guy Worthington
2003-08-19 15:31 ` Hans Hagen
2003-08-20 12:58   ` Guy Worthington
2003-08-21 19:49   ` Simon Pepping [this message]
2003-08-22 12:02     ` Guy Worthington

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=20030821194932.GA2825@scaprea \
    --to=spepping@scaprea.hobby.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).