0

I would like to use \section{Name of section} which would act as frametitle. This way it would be possible to let automatically do latex to put a numbering and it would be done with command section. Example:

  1. Introduction %<- as frametitle on top of slide (see below)
  2. Exp. Procedure %<- as frametitle on top of slide (see below)
  3. Results %<- as frametitle on top of slide (see below)
  4. and so on.

The second point is that by just changing the definiton of packages and header of the part before \begin{document}, it would be possible to use the document too for article, where \section is being used. Well, \newcommand would be a solution maybe.

I have herewith a basic example.

\documentclass[t]{beamer}
\usetheme{Madrid}
\begin{document}
\begin{frame}
\frametitle{Title}
\begin{itemize}
\item Line 1
\begin{itemize}
\item Line 2
\item Line 2
\end{itemize}
\end{itemize}
\end{frame}
\end{document}

Would you have any ideas?

Thank you very much

-- Rgds

1

You could slightly change the definition of the frametitle template (madrid theme uses the frametitle defined in beamerouterthemedefault.sty) and replace \insertframetitle by something like \thesection.~\insertsection.

\documentclass[t]{beamer}
\usetheme{Madrid}

\makeatletter
\setbeamertemplate{frametitle}{
  \ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
  \@tempdima=\textwidth%
  \advance\@tempdima by\beamer@leftmargin%
  \advance\@tempdima by\beamer@rightmargin%
  \begin{beamercolorbox}[sep=0.3cm,wd=\the\@tempdima]{frametitle}
    \usebeamerfont{frametitle}%
    \vbox{}\vskip-1ex%
    \if@tempswa\else\csname beamer@fteleft\endcsname\fi%
    \strut\thesection.~\insertsection\strut\par%
    {%
      \ifx\insertframesubtitle\@empty%
      \else%
      {\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle\strut\par}%
      \fi
    }%
    \vskip-1ex%
    \if@tempswa\else\vskip-.3cm\fi% set inside beamercolorbox... evil here...
  \end{beamercolorbox}%
}
\makeatother

\begin{document}
\section{bla}
\begin{frame}
\frametitle{Title}
\begin{itemize}
\item Line 1
\begin{itemize}
\item Line 2
\item Line 2
\end{itemize}
\end{itemize}
\end{frame}
\end{document}

enter image description here

  • I am very impressed. My God what a superbe, but high technology, possibility. It is far what I can understand today. Highly complex for me to understand right now the employed technology. Many thnanks. Is there maybe a package that does this maybe too? – user342342 Jul 31 '17 at 19:58
  • @user342342 I don't think there is a package to do exactly this. – user36296 Jul 31 '17 at 20:04
  • @samcarter is there any way how this could work automatically on each frame without the need to call \frametitle? – Skillmon Aug 31 '17 at 18:40
  • @Skillmon Yes - however the solution may require a bit of code. Can you ask a question? – user36296 Aug 31 '17 at 18:59

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.