GNU bug report logs - #29401
11.90.2.2017-07-25; Folding displays errors on valid LaTeX

Previous Next

Package: auctex;

Reported by: Koen van Greevenbroek <koenvangreevenbroek <at> gmail.com>

Date: Wed, 22 Nov 2017 16:56:02 UTC

Severity: normal

Found in version 11.90.2.2017

Full log


View this message in rfc822 format

From: Arash Esbati <arash <at> gnu.org>
To: Koen van Greevenbroek <koenvangreevenbroek <at> gmail.com>
Cc: 29401 <at> debbugs.gnu.org
Subject: bug#29401: 11.90.2.2017-07-25; Folding displays errors on valid LaTeX
Date: Fri, 01 Dec 2017 08:30:44 +0100
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




This bug report was last modified 7 years and 197 days ago.

Previous Next


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