1 ;;; latex-math-symbol.el --- LaTeX math symbol decoder
3 ;; Copyright (C) 1996 MORIOKA Tomohiko
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;; $Id: latex-math-symbol.el,v 1.2 1996/09/02 16:03:43 morioka Exp $
9 ;; Keywords: LaTeX, math, mule
11 ;; This file is part of MU (Message Utilities).
13 ;; This program is free software; you can redistribute it and/or
14 ;; modify it under the terms of the GNU General Public License as
15 ;; published by the Free Software Foundation; either version 2, or (at
16 ;; your option) any later version.
18 ;; This program is distributed in the hope that it will be useful, but
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 ;; General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with this program; see the file COPYING. If not, write to
25 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA.
31 ;; bytecompile this file and copy it to the apropriate directory.
33 ;; If you use tm, please put following to your ~/.emacs:
34 ;; (autoload 'latex-math-decode-buffer "latex-math-symbol" nil t)
35 ;; (add-hook 'mime-viewer/plain-text-preview-hook
36 ;; 'latex-math-decode-buffer)
37 ;; Of course, it may be available for other hooks to filter messages.
41 (defvar latex-math-symbol-table-alist
42 '(("\\pi" . "
\e$B&P
\e(B")
44 ("\\{" . "
\e$B!P
\e(B")("\\}" . "
\e$B!Q
\e(B")
46 ("\\cdot" . "
\e$B!&
\e(B")
47 ("\\times" . "
\e$B!_
\e(B")
48 ("\\cap" . "
\e$B"A
\e(B")("\\cup" . "
\e$B"@
\e(B")
50 ("\\leq" . "
\e$(C!B
\e(B")("\\geq" . "
\e$(C!C
\e(B")
51 ("\\le" . "
\e$(C!B
\e(B")("\\ge" . "
\e$(C!C
\e(B")
52 ("\\subseteq" . "
\e$B"<
\e(B")("\\supseteq" . "
\e$B"=
\e(B")
53 ("\\subset" . "
\e$B">
\e(B")("\\supset" . "
\e$B"?
\e(B")
54 ("\\in" . "
\e$B":
\e(B")("\\ni" . "
\e$B";
\e(B")
55 ("\\mid" . "
\e$B!C
\e(B")
56 ("\\neq" . "
\e$B!b
\e(B")("\\ne" . "
\e$B!b
\e(B")
58 ("\\forall" . "
\e$B"O
\e(B")
60 ("\\leftarrow" . "
\e$B"+
\e(B")("\\rightarrow" . "
\e$B"*
\e(B")
61 ("\\gets" . "
\e$B"+
\e(B")("\\to" . "
\e$B"*
\e(B")
68 (defun latex-math-decode-region (beg end)
71 (narrow-to-region beg end)
72 (let ((rest latex-math-symbol-table-alist)
75 (setq cell (car rest))
77 (while (search-forward (car cell) nil t)
78 (replace-match (cdr cell))
80 (setq rest (cdr rest))
83 (defun latex-math-decode-buffer ()
85 (latex-math-decode-region (point-min)(point-max))
92 (provide 'latex-math-symbol)
94 ;;; latex-math-symbol.el ends here