W3C home > Mailing lists > Public > www-math@w3.org > August 1998

&Space;

From: David Carlisle <davidc@nag.co.uk>
Date: Wed, 5 Aug 1998 14:43:37 +0100
Message-Id: <199808051343.OAA03069@nag.co.uk>
To: www-math@w3.org


I am trying to declare entities for MathML:

6.2.1 Non-Marking Entities

Entity name  Unicode Description

 &Space;     0020    one em of space in the current font



Do I follow the second column and declare the entity Space to be a CDATA
entity pointing to hex 20 (decimal 32), in which case &Space; will be
indistinguishable from a space character and typically produce something
around 1/3 em, depending on the font, or should I follow the third
column and declare it to be <mspace width="1em"/> ?

Incidentally does anyone have dtds declaring the CDATA entities for
the symbols in chapter 6?

I am currently producing them as required by running the following emacs
lisp over the html files (the giff-less ones). But If there is a
standard reference set that could be used, that would be better.

David

======================



load up one of the html files (without gifs) from chap6/* and hit
M-x html2dtd  


(defun html2dtd ()
  (interactive)
  (goto-char (point-min))
  (delete-region (point) (progn (re-search-forward "= *$") (point)))
  (delete-region (progn  (re-search-forward "</PRE>") (match-beginning 0))
                         (point-max))
  (unhexify)
  (goto-char (point-min))
  (while (re-search-forward "^[a-zA-Z]" (point-max)  t)
    (beginning-of-line)
    (insert "<!ENTITY ")
    (end-of-line)
    (insert "-->")))

(defun unhexify ()
 (interactive)
 (goto-char (point-min))
 (while (re-search-forward " \\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\) " (point-max) t)
  (let (( h 
    (buffer-substring (match-beginning 1) (match-end 1))))
   (delete-region (- (match-beginning 1) 1) (match-end 1))
   (goto-char (- (match-beginning 1)1))
    (insert "CDATA \"\&\#")
    (insert (int-to-string(hex h 0)))
    (insert (concat ";\" -- u+" h " ")))))
    

(defun hex (h d)
  (let* ((n (string-to-char h))
         (dd  (+ (* 16 d) (- n (if (< n 58) 48 55)))))
  (if (= (length h) 1)
     dd
   (hex (substring h 1 nil) dd))))
Received on Wednesday, 5 August 1998 09:41:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 20 February 2010 06:12:48 GMT