GNU bug report logs - #54200
13.0.14; Preview incorrectly folds math environments with TeX-engine LuaTeX

Previous Next

Package: auctex;

Reported by: Liam Hupfer <liam <at> hpfr.net>

Date: Tue, 1 Mar 2022 00:19:01 UTC

Severity: normal

Tags: wontfix

Found in version 13.0.14

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: liam <at> hpfr.net, David Kastrup <dak <at> gnu.org>
Cc: 54200 <at> debbugs.gnu.org
Subject: bug#54200: 13.0.14; Preview incorrectly folds math environments with TeX-engine LuaTeX
Date: Wed, 09 Mar 2022 18:17:00 +0900
Hi Liam and David,

>>>>> David Kastrup <dak <at> gnu.org> writes:
> Liam Hupfer via bug-auctex via Bug reporting list for AUCTeX
> <bug-auctex <at> gnu.org> writes:

>> When I run `preview-buffer` on the attached file, I get a preview that
>> looks like "The probability of an initial subsequence of length 3",
>> where multiple math environments are folded into the "3" preview. If I
>> move the point over the preview, it unfolds and I can see the other
>> previews have been generated, but they are not visible due to the
>> incorrect folding. Any ideas?

When I try the provided sample with pdflatex, it works without problem.
However, when I change `TeX-engine' to use lualatex as the original
report of Liam did, the issue reproduces (TeX Live 2021).

It seems that the different outcomes come from subtle difference of the
format of log output:

Output of pdflatex
                                                  |Aligned
l.6 ...lity of an initial subsequence of length \(
                                                  n\) is \(2^{-n}\). For exa...
                                                  |

Output of lualatex
                                                    |Not aligned
l.6 ...bility of an initial subsequence of length \(
                                                  n\) is \(2^{-n}\). For exa...
                                                  |

As can be seen in the above quotes, the log message from lualatex is two
characters long in the first line than pdflatex, which breaks alignment
of the two lines. This hinders the parse by `preview-parse-messages'.
The relavant portion is:
----------------------------------------------------------------------
                                   (and (re-search-forward "\
^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\(?:\\^*\\(?:[89a-f][0-9a-f]\\|[]@-\\_?]\\)\\|\
\[0-9a-f]?\\)\\)?\\([^\n\r]*?\\)\r?
\\([^\n\r]*?\\)\\(\\(?:\\^+[89a-f]?\\)?\\.\\.\\.\\)?\r?$" nil t)
                                        (string-to-number (match-string 1))))
                            ;; And a string of the context to search for.
                            string (and line (match-string 3))
                            after-string (and line (buffer-substring
                                                    (+ (match-beginning 4)
                                                       (- (match-end 3)
                                                          (match-beginning 0)))
                                                    (match-end 4)))
----------------------------------------------------------------------
This code assumes that the two lines in question are aligned to obtain
`after-string'. I confirmed that it works for lualatex when I modify the
code as:
----------------------------------------------------------------------
                            after-string (and line (buffer-substring
                                                    (+ (match-beginning 4)
						       -2 ;; Ad-hock hack
                                                       (- (match-end 3)
                                                          (match-beginning 0)))
                                                    (match-end 4)))
----------------------------------------------------------------------

David, can you tell which is responsible for these superfluous two
characters, preview.sty or lualatex itself?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine




This bug report was last modified 1 year and 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.