footer.sty 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. % author Matus Necas, October 2026
  2. % original work by Jan Sumsky <jan.sumsky@gmail.com>, August 2024
  3. %
  4. % Description: Beamer footline template configuration and dimension calculations.
  5. % Handles adaptive footer layouts for title and standard slides,
  6. % logo positioning, slide numbering, and navigation symbol removal.
  7. \RequirePackage{calc}
  8. \RequirePackage{adjustbox}
  9. \mode<presentation>
  10. \input{organisation/info.sty}
  11. % ==============================================================================
  12. % Footer Dimension & Ratio Calculations
  13. % ==============================================================================
  14. % Custom length variables for footer dimensions based on scaled design ratios (128mm / 254mm)
  15. \newlength{\footlinedp}
  16. \setlength{\footlinedp}{9.127mm * \ratio{128mm}{254mm}}
  17. \newlength{\footlineht}
  18. \setlength{\footlineht}{19.454mm * \ratio{128mm}{254mm}}
  19. \newlength{\footlinesk}
  20. \setlength{\footlinesk}{3.338mm * \ratio{128mm}{254mm}}
  21. % Footer logo width configuration
  22. \newlength{\logowd}
  23. \setlength{\logowd}{60.046mm * \ratio{128mm}{254mm}}
  24. % Declare and scale footer logo image to fit footer height precisely
  25. \pgfdeclareimage[height=\dimexpr\footlineht + \footlinedp - 2pt\relax]{smalllogo}{\orgLogoFooter}
  26. % Fixed widths for footer text elements and slide number counters
  27. \newlength{\footlinetextwd}
  28. \setlength{\footlinetextwd}{100pt}
  29. \newlength{\numberwd}
  30. \setlength{\numberwd}{20pt}
  31. % Extra right margin offset (used for horizontal alignment correction)
  32. \def\footextraright{3mm}
  33. % ==============================================================================
  34. % Title Slide Toggle & Footline Template
  35. % ==============================================================================
  36. % 1. Boolean switch declaration for title slide detection
  37. \newif\ifuni@onstitle
  38. \uni@onstitlefalse
  39. % 2. Unified global Beamer footline template (adapts layout based on \ifuni@onstitle)
  40. \defbeamertemplate*{footline}{uni}{
  41. \begin{beamercolorbox}[
  42. wd=\paperwidth,
  43. dp=\footlinedp,
  44. ht=\footlineht,
  45. leftskip=\footlinesk,
  46. rightskip=\dimexpr\footlinesk + 3mm\relax
  47. ]{footline}
  48. \usebeamerfont{title in head/foot}%
  49. \ifuni@onstitle
  50. % --- TITLE SLIDE FOOTER: Logo on left, presentation date on right ---
  51. \raisebox{\dimexpr 0.5\footlineht - 0.5\footlinedp - 0.5\height\relax}{\pgfuseimage{smalllogo}}%
  52. \hfill
  53. \raisebox{\dimexpr 0.5\footlineht - 0.5\footlinedp - 0.5\height\relax}{\insertdate}%
  54. \else
  55. % --- STANDARD SLIDE FOOTER: Logo on left, slide number counter on right ---
  56. \raisebox{\dimexpr 0.5\footlineht - 0.5\footlinedp - 0.5\height\relax}{\pgfuseimage{smalllogo}}%
  57. \hfill
  58. \raisebox{\dimexpr 0.5\footlineht - 0.5\footlinedp - 0.5\height\relax}{%
  59. \makebox[\numberwd][r]{\insertframenumber\,/\,\inserttotalframenumber}%
  60. }%
  61. \fi
  62. \end{beamercolorbox}
  63. }
  64. % Remove default Beamer navigation symbols (bottom right corner)
  65. \defbeamertemplate*{navigation symbols}{uni}{}
  66. \mode<all>