0

When \subsection is used with Beamer together with notes, there is error

! Undefined control sequence.
<write> ...\000w\000e\000d\000\040\000?}{\Parent2 
                                                  }% 1

If \subsection is commented out, the .tex file will be compiled without error. Could you help to comment how to use subsection with Beamer with notes ? Many thanks !

MWE.tex to be processed with xeLatex:

\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[ignorenonframetext,notes]{beamer}
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{caption label separator}{: }
\setbeamercolor{caption name}{fg=normal text.fg}
\beamertemplatenavigationsymbolsempty
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provides euro and other symbols
\else % if luatex or xelatex
  \usepackage{unicode-math}
  \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
    \setmainfont[]{Times New Roman}
  \ifxetex
    \usepackage{xeCJK}
    \setCJKmainfont[]{FangSong}
  \fi
  \ifluatex
    \usepackage[]{luatexja-fontspec}
    \setmainjfont[]{FangSong}
  \fi
\fi
\usefonttheme{serif} % use mainfont rather than sansfont for slide text
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
}
\usepackage{hyperref}
\hypersetup{
            pdftitle={Example proj},
            pdfborder={0 0 0},
            breaklinks=true}
\urlstyle{same}  % don't use monospace font for urls
\newif\ifbibliography
% Prevent slide breaks in the middle of a paragraph:
\widowpenalties 1 10000
\raggedbottom
\setbeamertemplate{part page}{
\centering
\begin{beamercolorbox}[sep=16pt,center]{part title}
  \usebeamerfont{part title}\insertpart\par
\end{beamercolorbox}
}
\setbeamertemplate{section page}{
\centering
\begin{beamercolorbox}[sep=12pt,center]{part title}
  \usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
}
\setbeamertemplate{subsection page}{
\centering
\begin{beamercolorbox}[sep=8pt,center]{part title}
  \usebeamerfont{subsection title}\insertsubsection\par
\end{beamercolorbox}
}
\AtBeginPart{
  \frame{\partpage}
}
\AtBeginSection{
  \ifbibliography
  \else
    \frame{\sectionpage}
  \fi
}
\AtBeginSubsection{
  \frame{\subsectionpage}
}
\setlength{\emergencystretch}{3em}  % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}

% set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother


\title{Example proj}
\date{}

\begin{document}
\frame{\titlepage}

\begin{frame}{%
\protect\hypertarget{my-frame}{%
My frame}}

\subsection{No section allowed ?} % <----------------- error

No content allowed ?

\note{My }

\end{frame}

\end{document}
1

frame in beamer can't be divided on section or sub section. it can be used only outside of frame. for example instead of your

\begin{document}
\frame{\titlepage}

\begin{frame}{%
\protect\hypertarget{my-frame}{My frame}}   
\subsection{No section allowed ?} % <----------------- error
No content allowed ?    
\note{My }    
\end{frame}
\end{document}

you can subsection write only outside of frame:

\begin{document}
\frame{\titlepage}

\subsection{No section allowed ?} % <--- he re is allowed
\begin{frame}{%
\protect\hypertarget{my-frame}{My frame}}   
No content allowed ?    
\note{My }    
\end{frame}
\end{document}

of course, sections (subsections, etc) titles cannot b visible on frames, but it is visible in frame, which contain \tableofcontents. for example:

\documentclass{beamer}

\begin{document}
\begin{frame}
\tableofcontents
\end{frame}

\section{first section}
\begin{frame}\frametitle{frame A}
\end{frame}

\section{second section}
\begin{frame}\frametitle{frame B}
\end{frame}

\section{third section}
\begin{frame}\frametitle{frame C}
\end{frame}
\end{document}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.