GNU bug report logs -
#42209
12.2.4; Text propogated wrong in TeX-fold-mode
Previous Next
Reported by: <gennady.uraltsev <at> gmail.com>
Date: Sun, 5 Jul 2020 00:40:02 UTC
Severity: normal
Tags: wontfix
Found in version 12.2.4
Done: Ikumi Keita <ikumi <at> ikumi.que.jp>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi Gennady, sorry for very late response.
>>>>> <gennady.uraltsev <at> gmail.com> writes:
> I illustrate with examples
> Consider the following LaTeX file (attached as main.tex):
> \documentclass{amsart}
> \begin{document}
> \title{Simple AMSart}
> \author{Author McAuthorface}
> \maketitle
> \section{Section \textit{a} : a \LaTeX macro}
> \begin{equation*}
> \int_{\alpha + \beta = \LaTeX + \dots }
> \end{equation*}
> \end{document}
> 1.
> * The macro \textit{a} folds into an "a" as specified by
> TeX-fold-macro-spec-list (value included below) but it gets rendered much
> larger than the surrounding text
> * I believe because the "enlargement" gets applied twice, but I am not
> sure.
I tried just enabling TeX-fold-mode without your whole init setting, and
the problem doesn't reproduce with the provided sample latex file.
> 2. Auctex makes the subscript of the integral in the equation small and
> lowered.
> * After folding the Greek symbols and the other macros they appear to
> be the same size as "normal" text so they do not inherit the surrounding
> fontification.
I can observe this behavior. It seems that the attached patch fixes the
problem. Could you test whether it works for you or not?
Regards,
Ikumi Keita
[patch (text/x-diff, inline)]
diff --git a/tex-fold.el b/tex-fold.el
index b14ec734..802d1be0 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -824,6 +824,11 @@ That means, put respective properties onto overlay OV."
(skip-chars-forward " \t")
(point))))
(overlay-put ov 'mouse-face 'highlight)
+ (when font-lock-mode
+ ;; Add raise adjustment for superscript and subscript.
+ (put-text-property 0 (length display-string)
+ 'display (get-text-property ov-start 'display)
+ display-string))
(overlay-put ov 'display display-string)
(when font-lock-mode
(overlay-put ov 'face TeX-fold-folded-face))
This bug report was last modified 154 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.