From 8a9bbddf952d3096bbffb9b3c343fffd0257bf07 Mon Sep 17 00:00:00 2001
From: Cedric Ware <cedric.ware@telecom-paristech.fr>
Date: Sat, 16 May 2020 12:33:47 +0200
Subject: [PATCH] Rename and clean up footline dimensions.

---
 texinputs/beamerthemetptnew.sty | 35 +++++++++++++++------------------
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/texinputs/beamerthemetptnew.sty b/texinputs/beamerthemetptnew.sty
index 162a178..5046844 100644
--- a/texinputs/beamerthemetptnew.sty
+++ b/texinputs/beamerthemetptnew.sty
@@ -99,14 +99,11 @@
 \newcommand\extralogo[1]{\gdef\insertextralogo{#1}}
 \extralogo{}
 
-\newlength{\footerlogoheight}
-\newlength{\brownblockwidth}
-
 % Pour Modifier les logos des affiliations
 % Il faut que footerlogoheight soit défini avant qu'on l'utilise... Ici la valeur avec affiliation
 % Quand le logo des affiliations est utilisé, il faut réduire la taille à 5% de la largeur de la slide
-\setlength{\footerlogoheight}{.05118\paperwidth}
-\setlength{\brownblockwidth}{.42\paperwidth}
+\tpt@deflength{\footerlogoheight}{.05118\paperwidth}
+\tpt@deflength{\footerlogomargin}{1em}% Marge horizontale droite.
 
 % Au cas où le nom du fichier contiendrait des _ on passe par une macro pour modifier
 % son interprétation
@@ -143,11 +140,10 @@
 \fi
 
 \iftpt@affiliation
-   \newcommand\insertAffLogo{\hspace{1em}\pgfuseimage{footerAffiliation}\hspace{1em}}
+   \newcommand\insertAffLogo{\hspace{1em}\pgfuseimage{footerAffiliation}}
 \else
 % le logo fait 1cm de haut soit 7.8% des 12.8cm de large d'un beamer 4/3 standard
    \setlength{\footerlogoheight}{.07812\paperwidth}
-   \setlength{\brownblockwidth}{.44\paperwidth}
    \newcommand\insertAffLogo{}
 \fi
 
@@ -283,11 +279,12 @@
 %
 
 \tpt@deflength{\tptbottomboxsep}{\footlinespacing}
+\tpt@deflength{\tptbottomboxesmargin}{3pt}
 \tpt@deflength{\tptleftbottomboxwidth}{.15\paperwidth}
 \tpt@deflength{\tptmidbottomboxwidth}{.27\paperwidth}
-\tpt@deflength{\tptbottomboxdepth}{1ex}
-\tpt@deflength{\tptbottomboxheight}{%
-  \dimexpr \footlineheight + \tptbottomboxdepth \relax}
+\tpt@deflength{\tptbottomboxesbase}{1ex}
+\tpt@deflength{\tptbottomboxesheight}{%
+  \dimexpr \footlineheight + \tptbottomboxesbase \relax}
 \tpt@deflength{\tptfooterlogoyshift}{-2pt}
 
 % Macros génériques et spécialisées pour faire une boîte.
@@ -299,13 +296,13 @@
 }
 \newcommand*\tpt@bottombox@centered[4][]{%
   \tpt@bottombox{wd={#3},#1}{#2}{%
-    \vbox to\tptbottomboxheight{\vfil#4\vfil}%
+    \vbox to\tptbottomboxesheight{\vfil#4\vfil}%
   }%
 }
 \newcommand*\tpt@bottombox@aligned[4][]{%
-  \raisebox{\tptbottomboxdepth}{%
-    \tpt@bottombox{wd={#3},dp=\tptbottomboxdepth,ht={%
-        \dimexpr\tptbottomboxheight-\tptbottomboxdepth\relax},#1}{#2}{%
+  \raisebox{\tptbottomboxesbase}{%
+    \tpt@bottombox{wd={#3},dp=\tptbottomboxesbase,ht={%
+        \dimexpr \tptbottomboxesheight - \tptbottomboxesbase \relax},#1}{#2}{%
       #4%
     }%
   }%
@@ -328,7 +325,7 @@
   \hspace*{\tptbottomboxsep}%
   \tptbottombox{title in head/foot}{%
     \dimexpr \@tempdima - \tptleftbottomboxwidth - \tptmidbottomboxwidth
-    - 2\tptbottomboxsep\relax}{%
+    - 2\tptbottomboxsep - \footerlogomargin \relax}{%
     \insertshorttitle
   }%
 }
@@ -343,24 +340,24 @@
   %
   % On commence par typesetter le logo pour calculer la largeur restante.
   \sbox\tpt@tempbox{\insertlogo\insertAffLogo}%
-  \setlength\@tempdima{\dimexpr \paperwidth - \wd\tpt@tempbox}%
+  \setlength\@tempdima{\dimexpr \paperwidth - \wd\tpt@tempbox \relax}%
   %
   % FIXME nav symbols
   %
-  \iftpt@navsymbols\vskip 2pt%
+  \iftpt@navsymbols
+  \vskip 2pt%
   \begin{beamercolorbox}%
     [wd=\@tempdima,\tpt@navsymbols@align]{navigation symbols}
     \usebeamertemplate***{navigation symbols}%
   \end{beamercolorbox}
   \fi
-  \leavevmode
   \mbox{%
     \tptbottomboxes{\@tempdima}%
     \hspace*{\footlinespacing}%
     \hfill%
     \smash{\raisebox{\tptfooterlogoyshift}{\usebox{\tpt@tempbox}}}%
   }%
-  \vskip3pt%
+  \vskip\tptbottomboxesmargin%
 }
 
 
-- 
GitLab