Function: cal-tex-LaTeXify-string

cal-tex-LaTeXify-string is a byte-compiled function defined in cal-tex.el.gz.

Signature

(cal-tex-LaTeXify-string STRING)

Documentation

Protect special characters in STRING from LaTeX.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/cal-tex.el.gz
(defun cal-tex-LaTeXify-string (string)
  "Protect special characters in STRING from LaTeX."
  (if (not string)
      ""
    (let ((head "")
          (tail string)
          (list cal-tex-LaTeX-subst-list)
          ch pair)
      (while (not (string-equal tail ""))
        (setq ch (substring-no-properties tail 0 1)
              pair (assoc ch list))
        (if (and pair (string-equal ch "\""))
            (setq list (reverse list))) ; quote changes meaning each time
        (setq tail (substring-no-properties tail 1)
              head (concat head (if pair (cdr pair) ch))))
      head)))