GNU bug report logs -
#29401
11.90.2.2017-07-25; Folding displays errors on valid LaTeX
Previous Next
To reply to this bug, email your comments to 29401 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-auctex <at> gnu.org
:
bug#29401
; Package
auctex
.
(Wed, 22 Nov 2017 16:56:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Koen van Greevenbroek <koenvangreevenbroek <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-auctex <at> gnu.org
.
(Wed, 22 Nov 2017 16:56:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi!
Some valid LaTeX is parsed incorrectly by AUCTeX folding functions
(i.e. 'TeX-fold-region'), and an annoying error is displayed. Here is
an
example:
===========================
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{itemize}
\item \textbf<1>{One}
\item \textbf<1>{Two}
\end{itemize}
\end{frame}
\end{document}
===========================
When folded, this code is displayed as follows:
===========================
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{itemize}
* [Error: No content found]<1>{One}
* [Error: No content found]<2>{Two}
\end{itemize}
\end{frame}
\end{document}
===========================
Another example, which doesn't involve beamer, is the following code:
===========================
\usepackage{titlesec}
\titleformat{\section}{\bfseries}{\thesection}{10pt}{}[\normalfont]
===========================
which displays as:
===========================
\usepackage{titlesec}
\titleformat{[Error: No content
found]}{\bfseries}{\thesection}{10pt}{}[\normalfont]
===========================
Maybe it would be an idea to just not fold things like this where no
content it found, instead of displaying an error?
Thanks!
Koen
Emacs : GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.20)
of 2017-09-11, modified by Debian
Package: 11.90.2.2017-07-25
current state:
==============
(setq
AUCTeX-date "2017-07-25"
window-system 'x
LaTeX-version "2e"
TeX-style-path '("~/.emacs.d/auctex" "/home/koen/.emacs.d/elpa/auctex-
11.91.0/style" "/home/koen/.emacs.d/auctex/auto"
"/home/koen/.emacs.d/auctex/style" "auto" "style")
TeX-auto-save t
TeX-parse-self t
TeX-master t
TeX-command-list '(("TeX" "%(PDF)%(tex) %(file-line-error)
%(extraopts) %`%S%(PDFout)%(mode)%' %t" TeX-run-TeX nil
(plain-tex-mode ams-tex-mode texinfo-mode) :help
"Run plain TeX")
(#("LaTeX" 0 1 (idx 0)) "%`%l%(mode)%' %t" TeX-run-
TeX nil (latex-mode doctex-mode) :help "Run LaTeX")
("Makeinfo" "makeinfo %(extraopts) %t" TeX-run-
compile nil (texinfo-mode) :help "Run Makeinfo with Info output")
("Makeinfo HTML" "makeinfo %(extraopts) --html %t"
TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with HTML
output")
("AmSTeX" "amstex %(PDFout) %(extraopts)
%`%S%(mode)%' %t" TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX")
("ConTeXt" "%(cntxcom) --once --texutil
%(extraopts) %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run
ConTeXt once")
("ConTeXt Full" "%(cntxcom) %(extraopts)
%(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt until
completion")
(#("BibTeX" 0 1 (idx 1)) "bibtex %s" TeX-run-BibTeX
nil t :help "Run BibTeX")
(#("Biber" 0 1 (idx 2)) "biber %s" TeX-run-Biber
nil t :help "Run Biber")
(#("View" 0 1 (idx 3)) "%V" TeX-run-discard-or-
function t t :help "Run Viewer")
(#("Print" 0 1 (idx 4)) "%p" TeX-run-command t t
:help "Print the file")
(#("Queue" 0 1 (idx 5)) "%q" TeX-run-background nil
t :help "View the printer queue" :visible TeX-queue-command)
(#("File" 0 1 (idx 6)) "%(o?)dvips %d -o %f " TeX-
run-dvips t t :help "Generate PostScript file")
(#("Dvips" 0 1 (idx 7)) "%(o?)dvips %d -o %f " TeX-
run-dvips nil t :help "Convert DVI file to PostScript")
(#("Dvipdfmx" 0 1 (idx 8)) "dvipdfmx %d" TeX-run-
dvipdfmx nil t :help "Convert DVI file to PDF with dvipdfmx")
(#("Ps2pdf" 0 1 (idx 9)) "ps2pdf %f" TeX-run-ps2pdf
nil t :help "Convert PostScript file to PDF")
(#("Glossaries" 0 1 (idx 10)) "makeglossaries %s"
TeX-run-command nil t :help "Run makeglossaries to create glossary
file")
(#("Index" 0 1 (idx 11)) "makeindex %s" TeX-run-
index nil t :help "Run makeindex to create index file")
(#("upMendex" 0 1 (idx 12)) "upmendex %s" TeX-run-
index t t :help "Run upmendex to create index file")
(#("Xindy" 0 1 (idx 13)) "texindy %s" TeX-run-
command nil t :help "Run xindy to create index file")
(#("Check" 0 1 (idx 14)) "lacheck %s" TeX-run-
compile nil (latex-mode) :help "Check LaTeX file for correctness")
(#("ChkTeX" 0 1 (idx 15)) "chktex -v6 %s" TeX-run-
compile nil (latex-mode) :help "Check LaTeX file for common mistakes")
(#("Spell" 0 1 (idx 16)) "(TeX-ispell-document
\"\")" TeX-run-function nil t :help "Spell-check the document")
(#("Clean" 0 1 (idx 17)) "TeX-clean" TeX-run-
function nil t :help "Delete generated intermediate files")
(#("Clean All" 0 1 (idx 18)) "(TeX-clean t)" TeX-
run-function nil t :help "Delete generated intermediate and output
files")
(#("Other" 0 1 (idx 19)) "" TeX-run-command t t
:help "Run an arbitrary command"))
)
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#29401
; Package
auctex
.
(Wed, 22 Nov 2017 23:36:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 29401 <at> debbugs.gnu.org (full text, mbox):
Dear Koen,
2017-11-22 17:55 GMT+01:00 Koen van Greevenbroek
<koenvangreevenbroek <at> gmail.com>:
> Hi!
>
> Some valid LaTeX is parsed incorrectly by AUCTeX folding functions
> (i.e. 'TeX-fold-region'), and an annoying error is displayed. Here is
> an
> example:
>
> ===========================
> \documentclass{beamer}
> \begin{document}
> \begin{frame}
> \begin{itemize}
> \item \textbf<1>{One}
> \item \textbf<1>{Two}
> \end{itemize}
> \end{frame}
> \end{document}
> ===========================
>
> When folded, this code is displayed as follows:
>
> ===========================
> \documentclass{beamer}
> \begin{document}
> \begin{frame}
> \begin{itemize}
> * [Error: No content found]<1>{One}
> * [Error: No content found]<2>{Two}
> \end{itemize}
> \end{frame}
> \end{document}
> ===========================
>
> Another example, which doesn't involve beamer, is the following code:
>
> ===========================
> \usepackage{titlesec}
> \titleformat{\section}{\bfseries}{\thesection}{10pt}{}[\normalfont]
> ===========================
>
> which displays as:
>
> ===========================
> \usepackage{titlesec}
> \titleformat{[Error: No content
> found]}{\bfseries}{\thesection}{10pt}{}[\normalfont]
> ===========================
>
> Maybe it would be an idea to just not fold things like this where no
> content it found, instead of displaying an error?
Thanks for the detailed report. I tried at least to track down the
culprit for the beamer case, I think a general solution would be to
teach `TeX-find-macro-boundaries' and related functions about <...>
specifications. Unfortunately, I don't have right now the time to fix
it, but this should be a starting point for anyone willing to tackle
this issue. Regarding the second case, I don't think there is an easy
fix for it.
Bye,
Mosè
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#29401
; Package
auctex
.
(Fri, 01 Dec 2017 07:32:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 29401 <at> debbugs.gnu.org (full text, mbox):
Koen van Greevenbroek <koenvangreevenbroek <at> gmail.com> writes:
> Some valid LaTeX is parsed incorrectly by AUCTeX folding functions
> (i.e. 'TeX-fold-region'), and an annoying error is displayed. Here is
> an
> example:
>
> ===========================
> \documentclass{beamer}
> \begin{document}
> \begin{frame}
> \begin{itemize}
> \item \textbf<1>{One}
> \item \textbf<1>{Two}
> \end{itemize}
> \end{frame}
> \end{document}
> ===========================
Hi Koen,
the example above compiles fine, but I think the syntax you're using is
not correct. beamer doc says:
The \item command is overlay specification-aware. If an overlay
specification is provided, the item will only be shown on the
specified slides, see the following example. If the \item command
is to take an optional argument and an overlay specification, the
overlay specification can either come first as in \item<1>[Cat] or
come last as in \item[Cat]<1>.
I.e., \item<alert specification>[item label]<alert specification>
Why do you put alert spec between \textbf and its argument? This version
looks better to me
\begin{frame}
\begin{itemize}
\item <1>\textbf{One}
\item <2>\textbf{Two}
\end{itemize}
\end{frame}
and looks like this when folded where One and Two are boldified:
\begin{frame}
\begin{itemize}
* <1>One
* <2>Two
\end{itemize}
\end{frame}
> Another example, which doesn't involve beamer, is the following code:
>
> ===========================
> \usepackage{titlesec}
> \titleformat{\section}{\bfseries}{\thesection}{10pt}{}[\normalfont]
> ===========================
>
> which displays as:
>
> ===========================
> \usepackage{titlesec}
> \titleformat{[Error: No content
> found]}{\bfseries}{\thesection}{10pt}{}[\normalfont]
> ===========================
>
> Maybe it would be an idea to just not fold things like this where no
> content it found, instead of displaying an error?
This one is really hard to fix. Correctly folding preamble macros is
almost impossible.
Best, Arash
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#29401
; Package
auctex
.
(Fri, 01 Dec 2017 14:42:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 29401 <at> debbugs.gnu.org (full text, mbox):
Hi Arash,
> \begin{frame}
> \begin{itemize}
> \item <1>\textbf{One}
> \item <2>\textbf{Two}
> \end{itemize}
> \end{frame}
This version does fold correctly, but it doesn't produce the same
output as the original example. In particular, here the overlay is
applied to the items themselves, while when writing something like
`\textbf<1>{foo}', the idea is that `foo' will be displayed in bold on
the first slide, and normally for the rest of the slides. Maybe an
example that illustrates the folding problem even better is:
\begin{frame}
\textbf<1>{One} \\
\textbf<2>{Two}
\end{frame}
This is syntactically correct, see section 9.3 of the Beamer user
guide.
I agree that code in the preamble will be extremely hard to fold
correctly. However, maybe it could be an idea to ignore commands that
cannot be folded correctly indstead of displaying an error? I know that
I could just not try to fold the preamble, but right now I have
something like
(add-hook 'LaTeX-mode-hook
(lambda ()
(TeX-fold-mode t)
(add-hook 'find-file-hook 'TeX-fold-buffer t t)))
in my .emacs, every LaTeX buffer I visit gets folder automatically. I
think it would be nicer to just not see the errors.
Have a nice day,
Koen
This bug report was last modified 7 years and 196 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.