auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] Re: Fontifying of titles...


From: Ralf Angeli
Subject: [AUCTeX-devel] Re: Fontifying of titles...
Date: Fri, 08 Apr 2005 09:49:35 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

* Reiner Steib (2005-04-07) writes:

> I'm using `height' for `font-latex-fontify-script', but in some
> situations, I don't like the appearance:
>
> - When the number of characters in the line (macro plus title) is
>   close to my window width.  I.e. with `color', it would fit, but with
>   `height' it is wrapped.

In such cases I tend to format the lines in concern manually.

> - Similar for longish section titles: Two such big lines are too
>   heavy.
>
> - When using the optional argument of \section, the result is quite bad:
>
> --8<---------------cut here---------------start------------->8---
> \section[Ein nicht ganz so extrem langer Name]{Aber hier kommt der doch etwas
>   lang geratene Titel den man nicht kürzen kann}
>
> \section[Ein nicht ganz so extrem langer Name]%
> {Aber hier kommt der doch etwas lang geratene Titel den man nicht kürzen kann}
> --8<---------------cut here---------------end--------------->8---
>
>   The second example isn't fontified correctly.

That's because of the trailing comment character in the first line.
Should be fixed in CVS.  I hope `forward-comment' is not a performance
hog.

> - The factor 1.2 seems to be appropriate for `Info-title-*-face', but
>   for `font-latex-title-*-face', a smaller factor (say 1.05-1.1) would
>   be better.  At least `font-latex-title-1-face' (for \part or
>   \chapter) are too large, especially because often another \chapter
>   or \section line follows.
>
> Here is a patch that allows `font-latex-title-fontify' to be a number
> which is used instead as the scaling factor instead of the default
> value (now: 1.2; my suggestion: 1.05-1.1).  Even with 1.05, the titles
> stand out enough too make it recognizable easily, I think.

This only holds true if you have scalable fonts or the right bitmap
fonts in a lot of sizes.  In my case (yes, I know, my setup is not
really standard) this makes the levels 2 to 4 indistinguishable.  Here
is a list of fonts I get:

With patch:

1: -Adobe-Helvetica-Bold-R-Normal--24-240-75-75-P-138-ISO8859-1
2: -Adobe-Helvetica-Bold-R-Normal--20-140-100-100-P-105-ISO8859-1
3: -Adobe-Helvetica-Bold-R-Normal--20-140-100-100-P-105-ISO8859-1
4: -Adobe-Helvetica-Bold-R-Normal--18-180-75-75-P-103-ISO8859-1

Without patch:

1: -Adobe-Helvetica-Bold-R-Normal--34-240-100-100-P-182-ISO8859-1
2: -Adobe-Helvetica-Bold-R-Normal--25-180-100-100-P-138-ISO8859-1
3: -Adobe-Helvetica-Bold-R-Normal--20-140-100-100-P-105-ISO8859-1
4: -Adobe-Helvetica-Bold-R-Normal--18-180-75-75-P-103-ISO8859-1

The 18 and 20 pixel sizes of the font look nearly identically.  Oh
well, I guess I could live with that (or customize it if I need the
difference) in case people find this more appealing.

> +(defcustom font-latex-title-fontify 'height
> +  "Whether to fontify LaTeX titles with varying height faces or a color face.
> +
> +If it is a number, use varying height faces scaled with this number.
> +Setting this variable does not take effect unless you call
> +\\[font-lock-fontify-buffer]."
> +  :type '(choice (const height)
> +              (number :tag "Scale factor")
> +                 (const color))
> +  :group 'font-latex)

Hm, I don't think many people will have 'height as a customized value,
so we might just drop this from the defcustom and only provide the
scale factor with a proper default value.  For backwards compatibility
the (indirect) check for 'height in `font-latex-make-title-faces'
could stay.  BTW, you will have to change the XEmacs-related code as
well.

-- 
Ralf





reply via email to

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