2

I am having the following error: Illegal unit of measure (pt inserted). \frame{\titlepage}. The code is:

Does anybody know how to solve this error?

\documentclass[11pt]{beamer}%blackandwhite
\usepackage[spanish,portuguese,english]{babel}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}%gráficas
\usepackage{graphics}%gráficas
\usepackage{hyperref}%hypervinculo
%\usepackage{beamerarticle}
\usepackage{beamerprosper}
\usepackage{multicol}%varias columnas
\newtheorem*{ejem}{Ejemplo} 
\newtheorem*{prop}{Proposición}
\newtheorem*{teor}{Teorema}
\newtheorem*{defin}{Definición}
\newtheorem*{lema}{Lema}
\newtheorem*{algoritmo}{Algoritmo}
\newtheorem*{cor}{Corolario}

 \mode<presentation> {
  \usetheme{Hannover}
  \usefonttheme{serif}
  \usecolortheme{beaver}
}
\setbeamercovered{dynamic}
%\logo{\includegraphics[height=1.5cm]{img.eps}}
\setbeamertemplate{enumerate items}[default]
\setbeamertemplate{theorems}[ams style]

\setbeamercolor{alerted text}{fg=blue}

\expandafter\def\expandafter\insertshorttitle\expandafter{%
   \insertshorttitle\hfill\insertframenumber\,/\,\inserttotalframenumber}  

\title[\textsc{ }]{\textrm{ABBB}} 
\author[\textsc{}]{\textsc{SSSS}}   
\institute[]{ \textsc{s\\ SSSSS}\\ \vspace{0.3cm}}  
\date{}

%\AtBeginSection[]{\frame{\frametitle{Index}\tableofcontents[current]}}

\begin{document}
%\bibliographystyle{amsplain}%Estilo de bibliografia
\frame{\titlepage}
%\part{Talk}
%\frame{\frametitle{Index}\tableofcontents[part=1]}

\section{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Slide 1 
\begin{frame}{Contents} 
    \begin{enumerate}[<+->]
        \item A
        \item Ac
        \item Dc
        \item Fcn
        \item Hc
        \item Hc
        \item Gc
    \end{enumerate}

\pause 

\end{frame}
\part{Talk}
\section{Overview}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Slide 2 
\begin{frame}{Overview}
\end{frame}
\subsection{Introduction}
\begin{frame}
    asbdf
\end{frame}

\end{document}
3
  • 1
    Welcome to TeX.SE. – Mico Feb 28 '20 at 19:57
  • 4
    It very much looks like the instruction \expandafter\def\expandafter\insertshorttitle\expandafter{\insertshorttitle\hfill\insertframenumber\,/\,\inserttotalframenumber} is causing the subsequent breakdown. I must confess to not having a clue what this instruction is supposed to achieve. Do omit it and see if you can live the result. – Mico Feb 28 '20 at 20:07
  • Please remove the packages and usetheorems that aren't needed to reproduce the example. We're all having a hard time understanding the purpose of the complicated def. Is it part of the problem? If not, remove it. If it is part of the problem, why do you have it? What are you trying to do? – Teepeemm Feb 29 '20 at 16:07
4

Thanks Mico.

Minimal code:

\documentclass{beamer}

\usetheme{Hannover}% OR \usetheme{Berkeley}
\usefonttheme{serif}
\usecolortheme{beaver}

\expandafter\def\expandafter\insertshorttitle\expandafter{% 
\insertshorttitle\hfill\insertframenumber\,/\,\inserttotalframenumber}

\begin{document} 

\begin{frame}{title}
   text
\end{frame}

\end{document}

Error:

! Illegal unit of measure (pt inserted).<to be read again> cl.15 \end{frame}

Note: If you write Warsaw theme, the above code is not error.

Write the following command to count the slides:

\setbeamertemplate{page number in head/foot}[totalframenumber]
\setbeamertemplate{navigation symbols}{\footnotesize\usebeamertemplate{page number in head/foot}}

Edit your file:

\documentclass[11pt]{beamer}%blackandwhite
\usepackage[spanish,portuguese,english]{babel}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}%gráficas
\usepackage{graphics}%gráficas
\usepackage{hyperref}%hypervinculo
%\usepackage{beamerarticle}
\usepackage{beamerprosper}
\usepackage{multicol}%varias columnas
\newtheorem*{ejem}{Ejemplo} 
\newtheorem*{prop}{Proposición}
\newtheorem*{teor}{Teorema}
\newtheorem*{defin}{Definición}
\newtheorem*{lema}{Lema}
\newtheorem*{algoritmo}{Algoritmo}
\newtheorem*{cor}{Corolario}

 \mode<presentation> {
  \usetheme{Hannover}
  \usefonttheme{serif}
  \usecolortheme{beaver}
}
\setbeamercovered{dynamic}
%\logo{\includegraphics[height=1.5cm]{img.eps}}
\setbeamertemplate{enumerate items}[default]
\setbeamertemplate{theorems}[ams style]

\setbeamercolor{alerted text}{fg=blue}

%\expandafter\def\expandafter\insertshorttitle\expandafter{%
%   \insertshorttitle\hfill\insertframenumber\,/\,\inserttotalframenumber}  


\setbeamertemplate{page number in head/foot}[totalframenumber]
\setbeamertemplate{navigation symbols}{\footnotesize\usebeamertemplate{page number in head/foot}}

\title[\textsc{ }]{\textrm{ABBB}} 
\author[\textsc{}]{\textsc{SSSS}}   
\institute[]{ \textsc{s\\ SSSSS}\\ \vspace{0.3cm}}  
\date{}

%\AtBeginSection[]{\frame{\frametitle{Index}\tableofcontents[current]}}

\begin{document}
%\bibliographystyle{amsplain}%Estilo de bibliografia
\frame{\titlepage}
%\part{Talk}
%\frame{\frametitle{Index}\tableofcontents[part=1]}

\section{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Slide 1 
\begin{frame}{Contents} 
    \begin{enumerate}[<+->]
        \item A
        \item Ac
        \item Dc
        \item Fcn
        \item Hc
        \item Hc
        \item Gc
    \end{enumerate}

\pause 

\end{frame}
\part{Talk}
\section{Overview}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Slide 2 
\begin{frame}{Overview}
\end{frame}
\subsection{Introduction}
\begin{frame}
    asbdf
\end{frame}

\end{document}

Output:

enter image description here

Suggestion: See the answer1 , answer2 to the question And Beamer theme gallery.

Edit: On the Hannover theme \useoutertheme[height=0pt,left]{sidebar} used. with

\expandafter\def\expandafter\insertshorttitle\expandafter{% 
\insertshorttitle\hfill\insertframenumber\,/\,\inserttotalframenumber}

Has created a problem! Indeed with \hfill\insertframenumber\,/\,\inserttotalframenumber

Edit end: Change Hannover theme \useoutertheme[height=0pt,left]{sidebar} to

\useoutertheme[height=0pt,width=0pt,left]{sidebar}

Not error Minimal code.

4
  • 2
    I don't quite follow. What was the problem with the complicated def? What is the solution, other than commenting out the offending lines? (It doesn't help that we don't know what the complicated def was trying to do.) – Teepeemm Feb 28 '20 at 20:48
  • @Teepeemm.Thanks. Edited. – M.Ahmadi Feb 28 '20 at 21:13
  • Thanks a lot for your help. but the comand does not show the slide number: \setbeamertemplate{page number in head/foot}[totalframenumber] \setbeamertemplate{navigation symbols}{\footnotesize\usebeamertemplate{page number in head/foot}} – MIlena Feb 28 '20 at 22:02
  • @ MIlena .ouput show the slide number. Texlive 2019. – M.Ahmadi Feb 28 '20 at 22:21

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.