Issue #255 wontfix

\subsection undefined if starting with \section*

Anonymous created an issue

The \subsection command is not defined at the begining of the document if :

  • there is no \section command before

  • there is a \section* command before

Minimal example:

\documentclass{beamer}

\begin{document}


\frame{First}

\section*{An unnumbered section} 
\subsection{Undefined control sequence}

\frame{Second}


\end{document}

Comments (10)

  1. torsten_wagner

    Hi, I face a similar problem, which I believe has the same source. Using \includeonlylecture I receive an error message if the selected lecture starts without an \section (.e.g. first line in the lecture is \subsection{This is a subsection}.

    Thus assuming two lectures week1 and week2. In week1 I introduce

    \section{New topic}

    whereas in week2 I define

    \subsection{This is a subsection}

    using

    \includeonlylecture{week1,week2} -> works correct. \includeonlylecture{week2} -> fails with

    %%%%%%%%%%%%%%%%%%%%%%%%%%%% ERROR: Undefined control sequence.

    --- TeX said --- <write> This is a subsection}{\Parent2 }% 1 %%%%%%%%%%%%%%%%%%%%%%%%%

    Changing the begining of lecture week2 to

    \section{New topic} \subsection{This is a subsection}

    \includeonlylecture{week2} -> works again correct.

    Thus, it seems clearly be a problem that the \section command can't be found. Offering the command \includeonlylecture makes this problem rather painful, since people are encouraged to split the document into individual lectures. The PDF output is still generated and it seems to be correct. However, the error-message screws up the feeback of the LaTeX editor (emacs+auctex) and compiling and debugging becomes more difficulte as it should be.

    Hope this helps a bit

  2. torsten_wagner

    Furthermore, I noticed that if the includeonlylecture command is in place, section and subsection numbers are renumbered. E.g. If the complete TOC is:

    1. Section 1 1.1. A subsection
    2. A new Section 2.1. Great subsection
    3. The third is the best 3.1. This subsection is the last

    If I use \includeonlylecture{my_chapter3} (which i defined by using \lecture) the table of content looks like:

    1. The third is the best 1.1. This subsection is the last

    I am pretty sure this is not desired.

    Furthermore, I notice that a missing \section confuses the header of the beamer slides, e.g. names and dots are not in place

    Thus, it seems to be a problem which triggers multiple problems at different parts in beamer. Would really be glad if this could be fixed.

  3. Joseph Wright

    I've thought about this and discussed with some other people. The bottom line is that having a structure as described is not really logical: numbered subsections need 'parent' numbered sections. As such, this one is a WONTFIX.

  4. torsten_wagner

    Hi,

    thanks for the update. I just want to add that the issue is not that someone tries to start with a subsection without a parent section. The problem is the use of \includeonlylecture{} which effectively truncates the section mechanismen at start and makes it fail. It does not take care that a parent section might be placed in an earlier lecture. In my opinon this is a bug, as otherwise it renders \includeonlylecture rather useless.

    E.g. take a two different lectures

    lecture1: contains \section{FOO}
    lecture2: contains \subection{FOO over BAR}
    
    Compiling the entire document: ok
    using \includeonlylecture{lecture1}: ok
    using \includeonlylecture{lecture2}: fails
    

    in the latter case, the number is wrong, since the final document never saw the defintion of \section{FOO}. As I understood it, we would need to parse all possible lectures first and extract section headers and number them (first run?), after that, we would need to check wich lectures are requested and add all neccecary parent directories just in front of the first starting lecture as well as set the section counter to the correct values to get numbering and sections finally right.

    In my case several lectures can share a single section and subsections, sometimes a single lecture is only a subsection of a much larger parent section. A section number to lecture relation might look like this

      1. lecture 1
    • 1.1. lecture 2
    • 1.2. lecture 3
    • 1.3-1.5 lecture 4
    • 1.6 lecture 5
    • 1.7-1.8 and 2 lecture 6
    • ....

    Would be glad if this could be fixed in a way, since it really troubles me.

    Thanks

  5. Log in to comment