bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: latex mode, nexted subscripts are unreadable


From: Karl Berry
Subject: Re: latex mode, nexted subscripts are unreadable
Date: Thu, 13 Sep 2007 19:24:10 -0500

    I tried evaluating a modified defface definition  (in a temporary file,
    not by changing tex-mode.el) but this had no effect.

I believe that defface is like defvar et al; if the symbol is already
defined, it won't do anything.  You can call modify-face or
set-face-attribute from Elisp to change existing faces.
    
    $a_{b^c}$ makes $c$ elevated at the same level as the $c$ in $a^c$;
    the raising is done relative to $a$ rather than to $b$.
    Maybe this is a separate bug?

Maybe.  I believe this is the code in tex-mode.el that does the raising
and lowering.  I don't see any reason offhand for the different face to
affect it, but unfortunately I really can't say for sure.

(defun tex-font-lock-suscript (pos)
  (unless (or (memq (get-text-property pos 'face)
                    '(font-lock-constant-face font-lock-builtin-face
                      font-lock-comment-face tex-verbatim))
              ;; Check for backslash quoting
              (let ((odd nil)
                    (pos pos))
                (while (eq (char-before pos) ?\\)
                  (setq pos (1- pos) odd (not odd)))
                odd))
    (if (eq (char-after pos) ?_)
        '(face subscript display (raise -0.3))
      '(face superscript display (raise +0.3)))))

Sorry I can't help more.

Best,
Karl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]