]> git.eshelyaron.com Git - emacs.git/commitdiff
(tex-suscript-height-ratio, tex-suscript-height-minimum): New
authorGlenn Morris <rgm@gnu.org>
Fri, 28 Sep 2007 03:29:59 +0000 (03:29 +0000)
committerGlenn Morris <rgm@gnu.org>
Fri, 28 Sep 2007 03:29:59 +0000 (03:29 +0000)
customizable variables.
(tex-suscript-height): New function.
(superscript, subscript): Set height using tex-suscript-height
rather than fixing at 0.8.

etc/ChangeLog
lisp/ChangeLog
lisp/textmodes/tex-mode.el

index d8ba4fb60dbcb2f83fe60dc79c992ae3ffd812f4..7024efa1967d6e0d0b96362f04eb250a70f3b379 100644 (file)
@@ -1,3 +1,7 @@
+2007-09-28  Glenn Morris  <rgm@gnu.org>
+
+       * PROBLEMS: Mention Tex superscript font issue.
+
 2007-09-25  Johannes Weiner  <hannes@saeurebad.de>
 
        * NEWS: Fix typo.
index babc7ac209d960430ecfd5c9158afd159c6fb17c..2023fa93c4ef90333967b52441e2d186741bbc5d 100644 (file)
@@ -1,3 +1,14 @@
+2007-09-28  Glenn Morris  <rgm@gnu.org>
+
+       * mail/supercite.el (sc-attribs-filter-namelist): Use mapc rather
+       than mapcar.
+
+       * textmodes/tex-mode.el (tex-suscript-height-ratio)
+       (tex-suscript-height-minimum): New customizable variables.
+       (tex-suscript-height): New function.
+       (superscript, subscript): Set height using tex-suscript-height
+       rather than fixing at 0.8.
+
 2007-09-27  Juanma Barranquero  <lekktu@gmail.com>
 
        * progmodes/python.el (python-eldoc-function): Doc fix.
index 110351a6a60b7d2a57391e629300e1eeedaf71e5..8b1538e8ec36fb75c30b33be1483c1c18811f9c7 100644 (file)
@@ -676,12 +676,42 @@ An alternative value is \" . \", if you use a font with a narrow period."
          (put-text-property beg next 'display nil))
       (setq beg next))))
 
+(defcustom tex-suscript-height-ratio 0.8
+  "Ratio of subscript/superscript height to that of the preceding text.
+In nested subscript/superscript, this factor is applied repeatedly,
+subject to the limit set by `tex-suscript-height-minimum'."
+  :type 'float
+  :group 'tex
+  :version "23.1")
+
+(defcustom tex-suscript-height-minimum 0.0
+  "Integer or float limiting the minimum size of subscript/superscript text.
+An integer is an absolute height in units of 1/10 point, a float
+is a height relative to that of the default font.  Zero means no minimum."
+  :type '(choice (integer :tag "Integer height in 1/10 point units")
+                (float :tag "Fraction of default font height"))
+  :group 'tex
+  :version "23.1")
+
+(defun tex-suscript-height (height)
+  "Return the integer height of subscript/superscript font in 1/10 points.
+Not smaller than the value set by `tex-suscript-height-minimum'."
+  (ceiling (max (if (integerp tex-suscript-height-minimum)
+                   tex-suscript-height-minimum
+                 ;; For bootstrapping.
+                 (condition-case nil
+                     (* tex-suscript-height-minimum
+                        (face-attribute 'default :height))
+                   (error 0)))
+               ;; NB assumes height is integer.
+               (* height tex-suscript-height-ratio))))
+
 (defface superscript
-  '((t :height 0.8)) ;; :raise 0.2
+  '((t :height tex-suscript-height)) ;; :raise 0.2
   "Face used for superscripts."
   :group 'tex)
 (defface subscript
-  '((t :height 0.8)) ;; :raise -0.2
+  '((t :height tex-suscript-height)) ;; :raise -0.2
   "Face used for subscripts."
   :group 'tex)