Open cderv opened 11 months ago
Technically these are not sections but slides. (In the LaTeX source you have \begin{slide}
, not \section
.
Definitely more accurate. Thank you. Aim is to number slides' headers.
Should I understand that --number-sections
is expected to have no effect for beamer
output then ?
I am just observing no specific message that it will have no effect, and from the default.latex
template, the conditional with numbersections
applies and insert \setcounter{secnumdepth}
inside LaTeX source. I was surprised about this.
Check the beamer manual to see if there's a way to number slides?
If you'd like to number the frame titles, you could redefine the frametitle
template and include the frame number there:
\documentclass{beamer}
\makeatletter
\setbeamertemplate{frametitle}{%
\ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
\@tempdima=\textwidth%
\advance\@tempdima by\beamer@leftmargin%
\advance\@tempdima by\beamer@rightmargin%
\begin{beamercolorbox}[sep=0.3cm,left,wd=\the\@tempdima]{frametitle}
\usebeamerfont{frametitle}%
\vbox{}\vskip-1ex%
\if@tempswa\else\csname beamer@fteleft\endcsname\fi%
\strut\insertframenumber~\insertframetitle\strut\par%
{%
\ifx\insertframesubtitle\@empty%
\else%
{\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\strut\insertframesubtitle\strut\par}%
\fi
}%
\vskip-1ex%
\if@tempswa\else\vskip-.3cm\fi% set inside beamercolorbox... evil here...
\end{beamercolorbox}%
}
\makeatother
\begin{document}
\begin{frame}
\frametitle{Title}
test
\end{frame}
\end{document}
It seems LaTeX template does not differentiate section numbering with Beamer or not
https://github.com/jgm/pandoc/blob/a19cd39a6fae3f5595c7935fbc83d4edc82300d8/data/templates/default.latex#L312-L316
This means that with this
test.md
fileand using pandoc 3.1.8
we get
\setcounter{secnumdepth}{3}
in the tex file but it seems to have no effectThere is no error of
--number-sections
not working with beamer, and though no numbering.Not sure how to number section in beamer, so don't know if
\setcounter{secnumdepth}{3}
is really supposed to work.