GNU bug report logs -
#20773
11.88.6; Preview fails on nested \include{} using \documentclass{sigplanconf}
Previous Next
Reported by: Alex Rozenshteyn <rpglover64 <at> gmail.com>
Date: Mon, 8 Jun 2015 20:46:02 UTC
Severity: normal
Tags: notabug
Found in version 11.88.6
Done: Arash Esbati <arash <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi all,
At last I managed to figure out the roots of this wierd symptom. And it
also turned out that bug#20773 has the same origin, so I'm cc'ing to
20773 <at> debbugs.gnu.org, too.
>>>>> Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
> Preview-latex fails if the length of the file name or the amount of the
> document is sufficiently large.
> [How to reproduce]
> (0) Enable preview-latex.
> (1) Save the attached file "preview-section-test.tex" in /tmp/ and open it.
> (2) Type C-c C-p C-d and answer with "n" to "Cache preamble?" question.
> (3) The ghostscript process hangs with error message "No bounding box"
> and the process buffer is displayed. Only the partial "\section{xxx}"
> are covered by the expected images and rests remains icons of road
> construction sign. See the attached screenshot.
> It is really strage to me that the length of the file name seems to be
> related to this symptom. If the *same* file is saved under the file
> name "xxxxxxxxxxxxxxxxxx.tex" (18 x's), no errors occur and all
> "\section{xxx}" are covered by suitable images after C-c C-p C-d. But
> the symptom occurs again if the file name is "xxxxxxxxxxxxxxxxxxx.tex"
> (19 x's).
[Analysis]
When LaTeX runs it always outputs a lot of messages to console and log
file, and it inserts line breaks in the 80th column when it outputs long
messages. Here are some samples:
----------------------------------------------------------------------
./preview-section-test.tex:10: Preview: Snippet 4 ended.(655359+183500x22609920
).
----------------------------------------------------------------------
./xxxxxxxxxxxxxxxxxxxABC.tex:8: Preview: Snippet 3 ended.(655359+183500x2260992
0).
----------------------------------------------------------------------
./formalism_atranslation.tex:1: Preview: Snippet 1 ended.(541848+14544x15728640
).
----------------------------------------------------------------------
It is this line break that makes preview-latex to fail. The part which
parses the LaTeX messages in `preview-parse-messages' of preview.el is:
----------------------------------------------------------------------
(if (looking-at "\
\\(?:Preview\\|Package Preview Error\\): Snippet \\([---0-9]+\\) \\(started\\|ended\\(\
\\.? *(\\([---0-9]+\\)\\+\\([---0-9]+\\)x\\([---0-9]+\\))\\)?\\)\\.")
(progn
... (snip) ...
(setq snippet (string-to-number (match-string 1))
box (unless
(string= (match-string 2) "started")
(if (match-string 4)
(mapcar #'(lambda (x)
(* (preview-get-magnification)
(string-to-number x)))
(list
(match-string 4)
(match-string 5)
(match-string 6)))
t))
----------------------------------------------------------------------
Comparing the regexp and the examples quoted above, you can tell that
the regexp fails to pick up the numbers embedded in the LaTeX messages
such as "655359+183500x22609920" due to the extra line break. This the
reason that preview-latex cannot provide the necessary information to
ghostscript and complains that "No bounding box".
[Solution]
Thanks to
https://tex.stackexchange.com/questions/52988/avoid-linebreaks-in-latex-console-log-output
, I learned that we can (effectively) inhibit to insert extra line
breaks by setting environment variable max_print_line to sufficiently
large value.
I confirmed that the attached patch solves the both bug#20773 and
bug#27088. I will install this fix in a week or so. According to the
article above, MikTeX also understands max_print_line, so I think this
fix is effective regardless of TeX distribution. As always, any
comments and suggestions are welcome.
And I also expect that the same prescription can be applied to solve
reliably similar problem handled in `TeX-format-filter' at the part
"Remove line breaks at columns 79 and 80" comment. We can get rid of
heuristic logic used there.
Regards,
Ikumi Keita
[preview-latex-fix (text/x-diff, attachment)]
This bug report was last modified 1 year and 116 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.