[Top][All Lists]

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

Re: How to get rid of some font effects

From: Stefan Monnier
Subject: Re: How to get rid of some font effects
Date: Wed, 17 Oct 2007 14:12:38 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

>>> In the same vein, is there any way to globally disallow vertical
>>> shifting of text? Being very specific, tex-mode shifts superscript and
>>> subscript material vertically, and I find this inadequate. Is there
>>> any clean way to turn this off? I have found this in tex-mode.el:
>> You can play with font-lock-maximum-decoration (the super/subscript in
>> latex-mode are only enabled with the very top decoration level).

> Thank you for the tip. Meanwhile, I have used this *ugly* thing:

> (require 'tex-mode)
> (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.0))
>       '(face superscript display (raise +0.0)))))

You could also just remove the " display (raise -0.0)" parts.
In Emacs-CVS (and maybe in Emacs-22.2 as well), you can just configure
tex-font-script-display instead.


reply via email to

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