;;; tex-math-preview.el --- preview TeX math expressions.
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2015, 2016 Kevin Ryde
;; Author: Kevin Ryde
;; Version: 17
;; Keywords: tex, maths
;; URL: http://user42.tuxfamily.org/tex-math-preview/index.html
;; EmacsWiki: TexMathPreview
;; Compatibility: Emacs 21, Emacs 22
;; Incompatibility: XEmacs 21
;; tex-math-preview.el is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as published
;; by the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;; tex-math-preview.el is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
;; Public License for more details.
;;
;; You can get a copy of the GNU General Public License online at
;; .
;;; Commentary:
;; M-x tex-math-preview previews TeX math expressions. Put point in a TeX,
;; LaTeX, Texinfo, Wikipedia or DBTexMath math expression and M-x
;; tex-math-preview shows either an image or TeX error messages.
;;
;; `tex-mode' has its own far more substantial buffer and region previewing,
;; but tex-math-preview is intentionally simpler and is geared towards
;; unsophisticated TeX users.
;;
;; This started for Texinfo as a way to check how "@tex $$ $$ @end tex"
;; forms come out, and @math{} after it became TeX-ified. The LaTeX bits
;; haven't had quite as much use, and there might be better ways to choose
;; between TeX or LaTeX. See also latex-math-preview.el for an adaption
;; designed specifically for that, http://www.emacswiki.org/LaTeXMathPreview
;;
;; See also latex-math-symbol.el (which comes with mu-cite) for just turning
;; TeX character forms such as \alpha into Unicode characters.
;;; Emacsen:
;; Designed for Emacs 21 up.
;;
;; Doesn't work in XEmacs due to some absent functions there and because
;; `shell-command' doesn't return an exit status. Could add the extra
;; functions but redoing shell-command would be hard work.
;;
;; Can work in Emacs 20, with external viewer, if you load poe.el for
;; `make-temp-file', and from a later Emacs get `derived-mode-p'
;; (from derived.el) and `replace-regexp-in-string' (from subr.el).
;;; Install:
;; To make M-x tex-math-preview available put tex-math-preview.el in one of
;; your `load-path' directories and add following to your .emacs
;;
;; (autoload 'tex-math-preview "tex-math-preview" nil t)
;;
;; There's an autoload cookie for this, if you try `update-file-autoloads'
;; and friends.
;;
;; Bind the command to a key if desired, eg. f8 in texinfo-mode,
;;
;; (add-hook 'texinfo-mode-hook
;; (lambda ()
;; (define-key texinfo-mode-map [f8] 'tex-math-preview)))
;;; History:
;; Version 1 - the first version
;; Version 2 - multi-line