updated slides template
89
packages/README.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# Slides
|
||||
|
||||
Compile `main.tex` with LuaLaTeX (and Biber for references).
|
||||
|
||||
## Footer
|
||||
|
||||
Set the names shown in the footer in the preamble:
|
||||
|
||||
```latex
|
||||
\title[Short title]{Long title}
|
||||
\author[Short name]{Full author block}
|
||||
```
|
||||
|
||||
1. The left zone holds about 70 pt of text and the middle zone about 280 pt. Longer text is scaled down.
|
||||
2. The middle zone shows the section and its dots from the first `\section` onwards. Above 20 frames in a section, the dots become a count such as `3/25`.
|
||||
3. Plain frames have no footer: the title page, section pages and `standout` frames.
|
||||
4. Compile twice after adding frames, so that the dots are complete.
|
||||
|
||||
## Partner and funding logos
|
||||
|
||||
Enable partners in the preamble, in the desired display order:
|
||||
|
||||
```latex
|
||||
\partner{labsticc}\partner{ubo}\partner{aid}\partner{ifremer}
|
||||
```
|
||||
|
||||
Logos for the following partners are included in `packages/partners/`:
|
||||
|
||||
| Identifier | Partner |
|
||||
| --- | --- |
|
||||
| `labsticc` | Lab-STICC |
|
||||
| `ubo` | Université de Bretagne Occidentale |
|
||||
| `ensta` | ENSTA, Institut Polytechnique de Paris |
|
||||
| `aid` | Agence de l'innovation de défense |
|
||||
| `ifremer` | Ifremer |
|
||||
| `lip6` | Laboratoire d'informatique de Sorbonne Université |
|
||||
| `sorbonne` | Sorbonne Université |
|
||||
| `academia-sinica` | Academia Sinica |
|
||||
| `taipei` | University of Taipei |
|
||||
| `ubo-open-factory` | UBO Open Factory |
|
||||
|
||||
For example, enable the additional four with:
|
||||
|
||||
```latex
|
||||
\partner{lip6}\partner{sorbonne}\partner{academia-sinica}\partner{taipei}
|
||||
```
|
||||
|
||||
Enable ENSTA with `\partner{ensta}`.
|
||||
|
||||
Asset sources are recorded in [`partners/README.md`](partners/README.md).
|
||||
|
||||
To add a logo to the bundled set, add it to `packages/partners/` in the template
|
||||
repository, named after its identifier (for example `packages/partners/my-funder.png`).
|
||||
In a project, leave `packages/` untouched and register the logo as shown below, so
|
||||
that it survives a template update.
|
||||
|
||||
PNG, PDF, JPG and JPEG are supported, searched in that order. All ten bundled
|
||||
assets are transparent PNGs. Prefer high-resolution transparent PNGs or vector
|
||||
PDFs, tightly cropped to the artwork;
|
||||
embedded white space counts towards a logo's dimensions. SVGs should first be
|
||||
exported to PDF. The existing `img/logos.png` is a combined UBO/Lab-STICC image,
|
||||
not two independently selectable logos.
|
||||
|
||||
For a project-specific logo, register a path (with or without its extension) and
|
||||
then enable the partner:
|
||||
|
||||
```latex
|
||||
\declarepartner{my-funder}{img/custom-funder.pdf}
|
||||
\partner{my-funder}
|
||||
```
|
||||
|
||||
The title page places the logos at the bottom right, inside the theme's margins.
|
||||
Column count, logo sizes, cell sizes, spacing and row wrapping are computed from
|
||||
the number of available logos, their aspect ratios, the column width and the
|
||||
slide height. Logos have equal bounding-box area for comparable visual weight:
|
||||
wide wordmarks are shorter than square seals, rather than dominating the block.
|
||||
Aspect ratios are preserved; logos are centred within evenly spaced grid cells.
|
||||
The final row is right-aligned and stays within a bounded title-page area.
|
||||
Repeated selections are ignored. Missing files produce warnings and are skipped,
|
||||
without inserting placeholder logos. Partners do not appear on ordinary slides.
|
||||
|
||||
With no partners selected, the existing `\titlegraphic{...}` is still used.
|
||||
When partners are selected, they replace the legacy title graphic.
|
||||
|
||||
### Additional information
|
||||
|
||||
No additional logo files are needed for the ten included partners. If a funder
|
||||
requires a specific logo variant, minimum size, ordering or acknowledgement text,
|
||||
provide those project-specific requirements. No manual layout dimensions are needed.
|
||||
1
packages/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
2026.11
|
||||
63
packages/lab-common.sty
Normal file
@@ -0,0 +1,63 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{packages/lab-common}[2026/11/02 Macros shared by all templates]
|
||||
|
||||
% This file is byte-identical in every template. Edit one copy in the template
|
||||
% repository, then copy it to the others (see the root README.md).
|
||||
%
|
||||
% Load order: after babel, and after minted where minted is used. Load xcolor
|
||||
% with its options before this package, or pass them with \PassOptionsToPackage.
|
||||
|
||||
% engine: every template compiles with LuaLaTeX
|
||||
\ExplSyntaxOn
|
||||
\msg_new:nnn { lab-common } { require-luatex }
|
||||
{ This~template~requires~LuaLaTeX.~Set~the~compiler~to~LuaLaTeX~
|
||||
(on~Overleaf:~Menu,~then~Compiler). }
|
||||
\sys_if_engine_luatex:F { \msg_fatal:nn { lab-common } { require-luatex } }
|
||||
\ExplSyntaxOff
|
||||
|
||||
% quotes
|
||||
\RequirePackage[autostyle]{csquotes}
|
||||
\MakeOuterQuote{"}
|
||||
|
||||
% colours, from the cmyk values in dvipsnam.def, so that the macros below work
|
||||
% whichever options xcolor was loaded with
|
||||
\RequirePackage{xcolor}
|
||||
\definecolor{labDone}{cmyk}{0.50,0,1,0} % LimeGreen
|
||||
\definecolor{labTodo}{cmyk}{0,0.10,0.84,0} % Goldenrod
|
||||
\definecolor{labFixme}{cmyk}{0,1,1,0} % Red
|
||||
\definecolor{labYes}{cmyk}{0.44,0,0.74,0} % YellowGreen
|
||||
\definecolor{labNo}{cmyk}{0,0.89,0.94,0.28}% BrickRed
|
||||
\definecolor{labMaybe}{cmyk}{0,0.61,0.87,0}% Orange
|
||||
|
||||
% circles
|
||||
\RequirePackage{circledsteps}
|
||||
\pgfkeys{/csteps/inner color=white}
|
||||
\pgfkeys{/csteps/fill color=black}
|
||||
|
||||
% markers
|
||||
\RequirePackage{pifont}
|
||||
\newcommand{\cmark}{{\color{labYes}\ding{51}}}
|
||||
\newcommand{\xmark}{{\color{labNo}\ding{55}}}
|
||||
\newcommand{\imark}{{\color{labMaybe}\ding{109}}}
|
||||
|
||||
% status pills: \TODO, \TODO{text}, likewise \FIXME and \DONE
|
||||
\RequirePackage{xparse} % for the optional {text} argument
|
||||
\RequirePackage{xspace}
|
||||
\NewDocumentCommand{\pill}{m m m g}{%
|
||||
\CircledParamOpts{inner color=#1, outer color=#2, fill color=#2}{1}{%
|
||||
\textbf{#3}\IfValueT{#4}{ \textbf{--} #4}%
|
||||
}%
|
||||
\IfNoValueT{#4}{\xspace}% keep the space in "\TODO bla"
|
||||
}
|
||||
\newcommand{\DONE}{\pill{black}{labDone}{DONE}}
|
||||
\newcommand{\TODO}{\pill{black}{labTodo}{TODO}}
|
||||
\newcommand{\FIXME}{\pill{white}{labFixme}{FIXME}}
|
||||
|
||||
% table columns: L{width}, C{width} and R{width} wrap text, F fills the line
|
||||
\RequirePackage{array}
|
||||
\newcolumntype{F}{>{\arraybackslash}m{\linewidth}}
|
||||
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}}
|
||||
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
|
||||
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}m{#1}}
|
||||
|
||||
\endinput
|
||||
31
packages/partners/README.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Partner logo sources
|
||||
|
||||
Downloaded from official institutional websites on 2026-10-11. Logos remain the
|
||||
property of their respective institutions; availability here does not grant
|
||||
unrestricted use or imply endorsement. Follow the applicable branding rules.
|
||||
|
||||
| File | Official asset source |
|
||||
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `labsticc.png` | [IMT Atlantique / Lab-STICC](https://www.imt-atlantique.fr/sites/default/files/users/user1867/logo-lab-sticc.png) |
|
||||
| `ubo.png` | Official inline SVG labelled `Logo UBO` on [UBO's branding page](https://www.univ-brest.fr/fr/page/charte-graphique-ubo-et-logos-disposition-des-partenaires), rendered to a transparent 3,161 × 1,299 PNG at 600 DPI |
|
||||
| `ensta.png` | Official blue vertical ENSTA / IP Paris transparent PNG (`Ensta-logotype-05-bleu-rvb.png`) from the [ENSTA RGB logo archive](https://www.ensta.fr/sites/default/files/content/article/pdf/LogoENSTA_RVB.zip), linked from [ENSTA's branding page](https://www.ensta.fr/logo-et-charte-graphique); cropped to 3,638 × 2,286 pixels |
|
||||
| `aid.png` | [Ministère des Armées / AID](https://www.defense.gouv.fr/sites/default/files/aid/logo.png), displayed on [AID's RAPID page](https://www.defense.gouv.fr/aid/deposez-votre-projet/rapid-regime-dappui-linnovation-duale) |
|
||||
| `ifremer.png` | Inline `logo-ifremer` SVG from [Ifremer](https://www.ifremer.fr/fr); rendered using the site's brand colour `#0032c6` |
|
||||
| `lip6.png` | Inline `LIP6` SVG from [LIP6](https://www.lip6.fr/); rendered using `--LIP6_logo_color: #25314F` from the site's `css/common.css` |
|
||||
| `sorbonne.png` | [Sorbonne Université SVG](https://www.sorbonne-universite.fr/sites/default/files/media/2019-10/logo_4.svg), rendered to PNG |
|
||||
| `academia-sinica.png` | [Academia Sinica](https://www.sinica.edu.tw/images/AS_logo_2.png), referenced by its [official website](https://www.sinica.edu.tw/en) |
|
||||
| `taipei.png` | [University of Taipei masthead](https://www.utaipei.edu.tw/var/file/0/1000/img/1583/366369593.jpg), linked from its [official website](https://www.utaipei.edu.tw/) |
|
||||
| `ubo-open-factory.png` | [UBO Open Factory logo](https://www.univ-brest.fr/ubo-open-factory/sites/ubo-open-factory.www.univ-brest.fr/files/2023-10/logo-ubo-open-factory.png), linked from its [official website](https://www.univ-brest.fr/ubo-open-factory/fr) |
|
||||
|
||||
All ten files are tightly cropped RGBA PNGs with actual transparent pixels,
|
||||
not just an alpha channel containing an opaque white background. Existing alpha
|
||||
was preserved. For opaque sources, only white background connected to the outer
|
||||
edge was removed; white artwork inside the Academia Sinica seal was retained,
|
||||
and antialiased contour pixels were unmatted to avoid white fringes.
|
||||
|
||||
The SVG-derived assets were rendered at high resolution (at least 1,900 pixels
|
||||
wide). UBO was re-rendered from vector paths, not upscaled from the old 489-pixel
|
||||
PNG; its SVG viewport was extended to preserve the descender in “Bretagne”.
|
||||
LIP6's white circular website backdrop was omitted, keeping the plain
|
||||
logotype; glyph paths, proportions and lettering were not changed. Compilation
|
||||
needs no SVG converter, network access or additional shell commands.
|
||||
BIN
packages/partners/academia-sinica.png
Normal file
|
After Width: | Height: | Size: 181 KiB |
BIN
packages/partners/aid.png
Normal file
|
After Width: | Height: | Size: 744 KiB |
BIN
packages/partners/ensta.png
Normal file
|
After Width: | Height: | Size: 125 KiB |
BIN
packages/partners/ifremer.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
BIN
packages/partners/labsticc.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
packages/partners/lip6.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
packages/partners/sorbonne.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
BIN
packages/partners/taipei.png
Normal file
|
After Width: | Height: | Size: 464 KiB |
BIN
packages/partners/ubo-open-factory.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
packages/partners/ubo.png
Normal file
|
After Width: | Height: | Size: 169 KiB |
203
packages/slides-partners.sty
Normal file
@@ -0,0 +1,203 @@
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{packages/slides-partners}[2026/10/11 Automatic title-page partner logos]
|
||||
\RequirePackage{graphicx}
|
||||
\RequirePackage{expl3}
|
||||
\RequirePackage{xparse}
|
||||
|
||||
\ExplSyntaxOn
|
||||
\seq_new:N \g__slides_partners_seq
|
||||
\prop_new:N \g__slides_partner_files_prop
|
||||
\seq_new:N \l__slides_partner_files_seq
|
||||
\seq_new:N \l__slides_partner_ratios_seq
|
||||
\box_new:N \l__slides_partner_box
|
||||
\tl_new:N \l__slides_partner_file_tl
|
||||
\tl_new:N \l__slides_partner_resolved_tl
|
||||
\int_new:N \l__slides_partner_count_int
|
||||
\int_new:N \l__slides_partner_columns_int
|
||||
\int_new:N \l__slides_partner_rows_int
|
||||
\fp_new:N \l__slides_partner_minratio_fp
|
||||
\fp_new:N \l__slides_partner_maxratio_fp
|
||||
\fp_new:N \l__slides_partner_candidate_fp
|
||||
\fp_new:N \l__slides_partner_scale_fp
|
||||
\dim_new:N \l__slides_partner_width_dim
|
||||
\dim_new:N \l__slides_partner_maxheight_dim
|
||||
\dim_new:N \l__slides_partner_xgap_dim
|
||||
\dim_new:N \l__slides_partner_ygap_dim
|
||||
\dim_new:N \l__slides_partner_cellwidth_dim
|
||||
\dim_new:N \l__slides_partner_cellheight_dim
|
||||
|
||||
% Selection is ordered and idempotent. File lookup is delayed until rendering,
|
||||
% so a declaration can appear before or after its corresponding selection.
|
||||
\NewDocumentCommand{\partner}{m}
|
||||
{
|
||||
\seq_if_in:NnF \g__slides_partners_seq {#1}
|
||||
{ \seq_gput_right:Nn \g__slides_partners_seq {#1} }
|
||||
}
|
||||
\NewDocumentCommand{\declarepartner}{mm}
|
||||
{ \prop_gput:Nnn \g__slides_partner_files_prop {#1} {#2} }
|
||||
|
||||
\cs_new_protected:Npn \__slides_partners_collect:
|
||||
{
|
||||
\seq_clear:N \l__slides_partner_files_seq
|
||||
\seq_clear:N \l__slides_partner_ratios_seq
|
||||
\seq_map_inline:Nn \g__slides_partners_seq
|
||||
{
|
||||
\prop_get:NnNF \g__slides_partner_files_prop {##1}
|
||||
\l__slides_partner_file_tl
|
||||
{ \tl_set:Nn \l__slides_partner_file_tl {packages/partners/##1} }
|
||||
\tl_clear:N \l__slides_partner_resolved_tl
|
||||
\file_if_exist:VTF \l__slides_partner_file_tl
|
||||
{ \tl_set_eq:NN \l__slides_partner_resolved_tl \l__slides_partner_file_tl }
|
||||
{
|
||||
\clist_map_inline:nn {png,pdf,jpg,jpeg}
|
||||
{
|
||||
\file_if_exist:nT {\l__slides_partner_file_tl .####1}
|
||||
{
|
||||
\tl_set:Nx \l__slides_partner_resolved_tl
|
||||
{\l__slides_partner_file_tl .####1}
|
||||
\clist_map_break:
|
||||
}
|
||||
}
|
||||
}
|
||||
\tl_if_empty:NTF \l__slides_partner_resolved_tl
|
||||
{
|
||||
\PackageWarning{slides-partners}
|
||||
{Logo~for~partner~`##1'~not~found~at~
|
||||
`\tl_use:N \l__slides_partner_file_tl'.~Skipping~it}
|
||||
}
|
||||
{
|
||||
\seq_put_right:NV \l__slides_partner_files_seq
|
||||
\l__slides_partner_resolved_tl
|
||||
\hbox_set:Nn \l__slides_partner_box
|
||||
{ \includegraphics{\tl_use:N \l__slides_partner_resolved_tl} }
|
||||
\seq_put_right:Nx \l__slides_partner_ratios_seq
|
||||
{
|
||||
\fp_eval:n
|
||||
{ \dim_to_fp:n {\box_wd:N \l__slides_partner_box} /
|
||||
\dim_to_fp:n {\box_ht:N \l__slides_partner_box +
|
||||
\box_dp:N \l__slides_partner_box} }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
% Equal-area logos in equal-width cells give seals and wide wordmarks comparable
|
||||
% visual weight. Try every column count, maximizing the common area scale while
|
||||
% fitting the tallest and widest logos into the available title-page rectangle.
|
||||
\cs_new_protected:Npn \__slides_partners_layout:
|
||||
{
|
||||
\int_set:Nn \l__slides_partner_count_int
|
||||
{ \seq_count:N \l__slides_partner_files_seq }
|
||||
% Keep a margin on the left so a full grid stays clear of the affiliations.
|
||||
\dim_set:Nn \l__slides_partner_width_dim {.82\linewidth}
|
||||
\dim_set:Nn \l__slides_partner_maxheight_dim {.24\paperheight}
|
||||
\dim_set:Nn \l__slides_partner_xgap_dim
|
||||
{ \fp_to_dim:n {min(.04 * \dim_to_fp:n {\linewidth},
|
||||
.25 * \dim_to_fp:n {\linewidth} / max(1,\l__slides_partner_count_int-1))} }
|
||||
\dim_set:Nn \l__slides_partner_ygap_dim
|
||||
{ \fp_to_dim:n {min(.015 * \dim_to_fp:n {\paperheight},
|
||||
.25 * \dim_to_fp:n {\l__slides_partner_maxheight_dim} /
|
||||
max(1,\l__slides_partner_count_int-1))} }
|
||||
\fp_set:Nn \l__slides_partner_minratio_fp {inf}
|
||||
\fp_zero:N \l__slides_partner_maxratio_fp
|
||||
\seq_map_inline:Nn \l__slides_partner_ratios_seq
|
||||
{
|
||||
\fp_set:Nn \l__slides_partner_minratio_fp
|
||||
{min(\l__slides_partner_minratio_fp,##1)}
|
||||
\fp_set:Nn \l__slides_partner_maxratio_fp
|
||||
{max(\l__slides_partner_maxratio_fp,##1)}
|
||||
}
|
||||
\fp_zero:N \l__slides_partner_scale_fp
|
||||
\int_set:Nn \l__slides_partner_columns_int {1}
|
||||
\int_step_inline:nnnn {\l__slides_partner_count_int} {-1} {1}
|
||||
{
|
||||
\int_set:Nn \l__slides_partner_rows_int
|
||||
{ \fp_eval:n {ceil(\l__slides_partner_count_int / ##1)} }
|
||||
\fp_set:Nn \l__slides_partner_candidate_fp
|
||||
{ min(.14 * \dim_to_fp:n {\paperheight},
|
||||
(\dim_to_fp:n {\l__slides_partner_maxheight_dim} -
|
||||
(\l__slides_partner_rows_int-1) *
|
||||
\dim_to_fp:n {\l__slides_partner_ygap_dim}) /
|
||||
\l__slides_partner_rows_int * sqrt(\l__slides_partner_minratio_fp),
|
||||
(\dim_to_fp:n {\l__slides_partner_width_dim} -
|
||||
(##1-1) * \dim_to_fp:n {\l__slides_partner_xgap_dim}) /
|
||||
##1 / sqrt(\l__slides_partner_maxratio_fp)) }
|
||||
% Break equal-size ties by minimizing unused cells in the final row.
|
||||
\fp_compare:nT
|
||||
{ \l__slides_partner_candidate_fp > \l__slides_partner_scale_fp + .0001 ||
|
||||
(abs(\l__slides_partner_candidate_fp - \l__slides_partner_scale_fp) <= .0001 &&
|
||||
##1 * \l__slides_partner_rows_int <
|
||||
\l__slides_partner_columns_int *
|
||||
ceil(\l__slides_partner_count_int / \l__slides_partner_columns_int)) }
|
||||
{
|
||||
\fp_set_eq:NN \l__slides_partner_scale_fp \l__slides_partner_candidate_fp
|
||||
\int_set:Nn \l__slides_partner_columns_int {##1}
|
||||
}
|
||||
}
|
||||
% Size cells to the widest rendered logo, not the entire available column.
|
||||
% The enclosing row still right-aligns the compact grid in the title footer.
|
||||
\dim_set:Nn \l__slides_partner_cellwidth_dim
|
||||
{ \fp_to_dim:n {\l__slides_partner_scale_fp * sqrt(\l__slides_partner_maxratio_fp)} }
|
||||
\dim_set:Nn \l__slides_partner_cellheight_dim
|
||||
{ \fp_to_dim:n {\l__slides_partner_scale_fp / sqrt(\l__slides_partner_minratio_fp)} }
|
||||
}
|
||||
|
||||
\cs_new_protected:Npn \__slides_partners_typeset:
|
||||
{
|
||||
\vbox
|
||||
{
|
||||
\offinterlineskip
|
||||
\int_step_inline:nn {\l__slides_partner_count_int}
|
||||
{
|
||||
\int_compare:nNnT
|
||||
{\int_mod:nn {##1-1} {\l__slides_partner_columns_int}} = {0}
|
||||
{
|
||||
\int_compare:nNnT {##1} > {1}
|
||||
{ \vskip \l__slides_partner_ygap_dim }
|
||||
\hbox_to_wd:nn {\linewidth}
|
||||
{
|
||||
\hfil
|
||||
\int_step_inline:nnn {##1}
|
||||
{\int_min:nn {##1+\l__slides_partner_columns_int-1}
|
||||
{\l__slides_partner_count_int}}
|
||||
{
|
||||
\int_compare:nNnT {####1} > {##1}
|
||||
{ \hskip \l__slides_partner_xgap_dim }
|
||||
\vbox_to_ht:nn {\l__slides_partner_cellheight_dim}
|
||||
{
|
||||
\vfil
|
||||
\hbox_to_wd:nn {\l__slides_partner_cellwidth_dim}
|
||||
{
|
||||
\hfil
|
||||
\includegraphics[height=\fp_to_dim:n
|
||||
{\l__slides_partner_scale_fp / sqrt(
|
||||
\seq_item:Nn \l__slides_partner_ratios_seq {####1})}]
|
||||
{\seq_item:Nn \l__slides_partner_files_seq {####1}}
|
||||
\hfil
|
||||
}
|
||||
\vfil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
\NewDocumentCommand{\insertpartnerlogos}{}
|
||||
{
|
||||
\group_begin:
|
||||
\seq_if_empty:NTF \g__slides_partners_seq
|
||||
{ \inserttitlegraphic } % Backwards compatibility with existing slides.
|
||||
{
|
||||
\__slides_partners_collect:
|
||||
\seq_if_empty:NF \l__slides_partner_files_seq
|
||||
{
|
||||
\__slides_partners_layout:
|
||||
\__slides_partners_typeset:
|
||||
}
|
||||
}
|
||||
\group_end:
|
||||
}
|
||||
\ExplSyntaxOff
|
||||
\endinput
|
||||
328
packages/slides.cls
Normal file
@@ -0,0 +1,328 @@
|
||||
\ProvidesClass{packages/slides}[2025/01/27 v1]
|
||||
|
||||
\PassOptionsToPackage{dvipsnames, table}{xcolor}
|
||||
\PassOptionsToPackage{unicode}{hyperref}
|
||||
\PassOptionsToPackage{naturalnames}{hyperref}
|
||||
\LoadClass[aspectratio=169,10pt]{beamer}
|
||||
|
||||
% speaker notes
|
||||
% open pdf in dual screen using pympress (https://github.com/Cimbali/pympress)
|
||||
% \setbeameroption{show notes on second screen=right}
|
||||
|
||||
% listings (should be loaded before csquotes)
|
||||
\RequirePackage{minted}
|
||||
\setmintedinline{breaklines, breakanywhere, breakanywheresymbolpre={}}
|
||||
|
||||
% language and encoding
|
||||
\RequirePackage[french]{babel}
|
||||
\RequirePackage{packages/lab-common}
|
||||
|
||||
% biblatex for references on slides
|
||||
\RequirePackage[backend=biber]{biblatex}
|
||||
% clean, short citations in footnotes (cf. https://tex.stackexchange.com/a/587604)
|
||||
\renewbibmacro{in:}{}
|
||||
% \AtEveryCitekey{\clearfield{journaltitle}}
|
||||
\AtEveryCitekey{\clearfield{volume}}
|
||||
\AtEveryCitekey{\clearfield{number}}
|
||||
% \AtEveryCitekey{\clearfield{booktitle}}
|
||||
% \AtEveryCitekey{\clearfield{series}}
|
||||
\AtEveryCitekey{\clearfield{pages}}
|
||||
\AtEveryCitekey{\clearfield{month}}
|
||||
\AtEveryCitekey{\clearlist{publisher}}
|
||||
\AtEveryCitekey{\clearname{editor}}
|
||||
\AtEveryCitekey{\clearlist{location}}
|
||||
\AtEveryCitekey{\clearfield{doi}}
|
||||
\AtEveryCitekey{\clearfield{isbn}}
|
||||
\AtEveryCitekey{\clearfield{issn}}
|
||||
\AtEveryCitekey{\clearfield{eprint}}
|
||||
\AtEveryCitekey{\clearfield{url}}
|
||||
\AtEveryCitekey{\clearfield{urlyear}}
|
||||
\AtEveryCitekey{\clearfield{urlmonth}}
|
||||
\AtEveryCitekey{\clearfield{urlday}}
|
||||
% include reference number in citations (cf. https://tex.stackexchange.com/a/176295)
|
||||
\DeclareCiteCommand{\fullcite}
|
||||
{\usebibmacro{prenote}}
|
||||
{{\printtext[labelnumberwidth]{%
|
||||
\printfield{prefixnumber}%
|
||||
\printfield{labelnumber}}} %
|
||||
\usedriver
|
||||
{\DeclareNameAlias{sortname}{default}}
|
||||
{\thefield{entrytype}}}
|
||||
{\multicitedelim}
|
||||
{\usebibmacro{postnote}}
|
||||
|
||||
% captions
|
||||
\RequirePackage{caption}
|
||||
\captionsetup{font=scriptsize,labelfont=scriptsize}
|
||||
% do not prepend "Figure X:" in captions
|
||||
\captionsetup[figure]{labelformat=empty}
|
||||
|
||||
% beamer theme
|
||||
\usetheme{moloch}
|
||||
\RequirePackage{appendixnumberbeamer}
|
||||
\RequirePackage{fontspec}
|
||||
\setsansfont[
|
||||
Extension=.otf,
|
||||
UprightFont=*-Regular,
|
||||
ItalicFont=*-Italic,
|
||||
BoldFont=*-SemiBold,
|
||||
BoldItalicFont=*-SemiBoldItalic
|
||||
]{IBMPlexSans}
|
||||
\setmonofont[
|
||||
Extension=.otf,
|
||||
UprightFont=*-Regular,
|
||||
ItalicFont=*-Italic,
|
||||
BoldFont=*-SemiBold,
|
||||
BoldItalicFont=*-SemiBoldItalic
|
||||
]{IBMPlexMono}
|
||||
% \setmonofont{Fantasque Sans Mono}
|
||||
\AtBeginEnvironment{tabular}{%
|
||||
\addfontfeature{Numbers={Monospaced}}
|
||||
}
|
||||
% https://steeven9.github.io/USI-LaTeX/html/packages_hyperref_babel_xcolor3.html
|
||||
% Section 3.2 of:
|
||||
% https://mirror.ibcp.fr/pub/CTAN/macros/latex/contrib/beamer-contrib/themes/moloch/moloch.pdf
|
||||
\definecolor{ubo}{HTML}{5e548e}
|
||||
\setbeamercolor{progress bar}{fg=ubo}
|
||||
\setbeamercolor{title separator}{fg=ubo}
|
||||
\setbeamercolor{frametitle}{bg=ubo}
|
||||
% \setbeamercolor{progress bar}{fg=BrickRed}
|
||||
% \setbeamercolor{title separator}{fg=BrickRed}
|
||||
% footnote font size
|
||||
\setbeamerfont{footnote}{size=\tiny}
|
||||
% footer bar: author | short title, section and dots | frame count
|
||||
% Set the short names with \author[short]{...} and \title[short]{...}.
|
||||
\setbeamerfont{footline}{size=\fontsize{6}{7.5}\selectfont}
|
||||
\setbeamercolor{footline}{
|
||||
use=normal text,
|
||||
fg=normal text.fg!80!normal text.bg,
|
||||
bg=ubo!10!normal text.bg
|
||||
}
|
||||
\setbeamercolor{footline frame count}{fg=white, bg=ubo}
|
||||
% The left inset matches the frame title. The depth centres the capitals.
|
||||
\newcommand*{\slides@footinset}{7.7pt}
|
||||
\newcommand*{\slides@footheight}{7.6pt}
|
||||
\newcommand*{\slides@footdepth}{3.4pt}
|
||||
\newcommand*{\slides@footmaxdots}{20}
|
||||
% Count the frames of each section as they are typeset. The totals come from
|
||||
% the aux file, so the dots are complete from the second compilation onwards.
|
||||
% The template runs several times per frame, hence the comparison with the
|
||||
% previous frame. It also runs for plain frames, such as section pages, which
|
||||
% have no footer and do not count. \part and \appendix restart the section numbers.
|
||||
\newcount\slides@footframe
|
||||
\gdef\slides@footlastsection{}
|
||||
\gdef\slides@footlastframe{}
|
||||
\newcommand*{\slides@sectionframes}[2]{\global\@namedef{slides@frames@#1}{#2}}
|
||||
\newcommand*{\slides@footcount}{%
|
||||
\ifbeamer@plainframe\else\slides@footcountframe\fi
|
||||
}
|
||||
\newcommand*{\slides@footcountframe}{%
|
||||
\edef\slides@footcurrent{\the\c@part-\the\c@section}%
|
||||
\ifx\slides@footcurrent\slides@footlastsection\else
|
||||
\global\let\slides@footlastsection\slides@footcurrent
|
||||
\global\slides@footframe=0\relax
|
||||
\gdef\slides@footlastframe{}%
|
||||
\fi
|
||||
\edef\slides@footcurrent{\the\c@framenumber}%
|
||||
\ifx\slides@footcurrent\slides@footlastframe\else
|
||||
\global\let\slides@footlastframe\slides@footcurrent
|
||||
\global\advance\slides@footframe by 1\relax
|
||||
\if@filesw
|
||||
\immediate\write\@auxout{\string\slides@sectionframes
|
||||
{\slides@footlastsection}{\the\slides@footframe}}%
|
||||
\fi
|
||||
\fi
|
||||
}
|
||||
% Dots for the frames of the section, with a count when there are too many.
|
||||
\newcommand*{\slides@footdots}{%
|
||||
\edef\slides@foottotal{%
|
||||
\ifcsname slides@frames@\slides@footlastsection\endcsname
|
||||
\csname slides@frames@\slides@footlastsection\endcsname
|
||||
\else
|
||||
\the\slides@footframe
|
||||
\fi
|
||||
}%
|
||||
\ifnum\slides@foottotal>\slides@footmaxdots\relax
|
||||
\the\slides@footframe/\slides@foottotal
|
||||
\else
|
||||
\tikzexternaldisable
|
||||
\begin{tikzpicture}[baseline=-1.55pt, x=4.4pt]
|
||||
\mmzUnmemoizable
|
||||
\foreach \slides@dot in {1,...,\slides@foottotal}{
|
||||
\ifnum\slides@dot=\slides@footframe\relax
|
||||
\fill (\slides@dot,0) circle[radius=1.5pt];
|
||||
\else
|
||||
\draw[line width=.35pt] (\slides@dot,0) circle[radius=1.3pt];
|
||||
\fi
|
||||
}
|
||||
\end{tikzpicture}%
|
||||
\tikzexternalenable
|
||||
\fi
|
||||
}
|
||||
% Typeset #2, scaled down if it is wider than #1.
|
||||
\newsavebox{\slides@footbox}
|
||||
\newcommand*{\slides@footfit}[2]{%
|
||||
\sbox{\slides@footbox}{#2}%
|
||||
\ifdim\wd\slides@footbox>#1\relax
|
||||
\resizebox{#1}{!}{\usebox{\slides@footbox}}%
|
||||
\else
|
||||
\usebox{\slides@footbox}%
|
||||
\fi
|
||||
}
|
||||
% A long author block is too tall for the bar: leave it out and warn once.
|
||||
\newif\ifslides@footauthorwarned
|
||||
\newcommand*{\slides@footauthor}{%
|
||||
\sbox{\slides@footbox}{\insertshortauthor}%
|
||||
\ifdim\dimexpr\ht\slides@footbox+\dp\slides@footbox\relax>1.5\baselineskip
|
||||
\ifslides@footauthorwarned\else
|
||||
\global\slides@footauthorwarnedtrue
|
||||
\ClassWarningNoLine{slides}{The author is too tall for the footer.
|
||||
Set a short name with \string\author[short]{...}}%
|
||||
\fi
|
||||
\else
|
||||
\slides@footfit{\dimexpr.19\paperwidth-2\dimexpr\slides@footinset\relax\relax}
|
||||
{\insertshortauthor}%
|
||||
\fi
|
||||
}
|
||||
\newcommand*{\slides@footmiddle}{%
|
||||
\insertshorttitle
|
||||
\ifnum\c@section>0\relax
|
||||
\enspace\textbullet\enspace\insertsectionhead\enspace\slides@footdots
|
||||
\fi
|
||||
}
|
||||
% One rule for the whole bar: adjacent boxes can leave a seam in PDF viewers.
|
||||
\setbeamertemplate{footline}{%
|
||||
\slides@footcount
|
||||
\usebeamerfont{footline}%
|
||||
\hbox to\paperwidth{%
|
||||
\vrule width0pt height\dimexpr\slides@footheight+3pt\relax % clear footnotes
|
||||
\rlap{%
|
||||
\usebeamercolor[bg]{footline}%
|
||||
\vrule width\paperwidth height\slides@footheight depth\slides@footdepth
|
||||
}%
|
||||
\usebeamercolor[fg]{footline}%
|
||||
\hbox to.19\paperwidth{\hskip\slides@footinset\slides@footauthor\hss}%
|
||||
\hbox to.62\paperwidth{%
|
||||
\hss\slides@footfit{.62\paperwidth}{\slides@footmiddle}\hss
|
||||
}%
|
||||
\hskip.11\paperwidth
|
||||
\hbox to.08\paperwidth{%
|
||||
\usebeamercolor[bg]{footline frame count}%
|
||||
\rlap{\vrule width.08\paperwidth height\slides@footheight depth\slides@footdepth}%
|
||||
\usebeamercolor[fg]{footline frame count}%
|
||||
\hss\insertframenumber\,/\,\inserttotalframenumber\hss
|
||||
}%
|
||||
}%
|
||||
}
|
||||
% denser title bar. The bottom margin starts at the baseline and the top margin
|
||||
% starts above the capitals, so the bottom one is larger to centre the text.
|
||||
\setbeamerfont{frametitle}{size=\fontsize{11}{13}\selectfont}
|
||||
\molochset{
|
||||
frametitle margin top=5.5pt,
|
||||
frametitle margin bottom=7pt
|
||||
}
|
||||
% solid background for blocks
|
||||
\molochset{block=fill}
|
||||
% remove section frames
|
||||
% \molochset{sectionpage=none}
|
||||
% enable subsection frames
|
||||
\molochset{subsectionpage=progressbar}
|
||||
% table of contents
|
||||
\setbeamertemplate{section in toc}[sections numbered]
|
||||
\makeatletter
|
||||
\patchcmd{\beamer@sectionintoc}{\vskip1.5em}{\vskip0.3em}{}
|
||||
{\ClassWarning{slides}{Could not tighten section spacing in the table of contents}}
|
||||
\makeatother
|
||||
% smaller first-level bullet points
|
||||
\setbeamertemplate{itemize item}{\textbullet}
|
||||
% smaller bibliography entries
|
||||
\renewcommand*{\bibfont}{\scriptsize}
|
||||
|
||||
% figures uncover animation (cf. https://tex.stackexchange.com/a/354033/95423)
|
||||
\setbeamercovered{transparent}
|
||||
\newcommand<>{\uncovergraphics}[2][{}]{
|
||||
\begin{tikzpicture}
|
||||
\node[anchor=south west,inner sep=0] (B) at (4,0)
|
||||
{\includegraphics[#1]{#2}};
|
||||
\alt#3{}{%
|
||||
\fill [draw=none, fill=bg, fill opacity=0.9] (B.north west) -- (B.north east) -- (B.south east) -- (B.south west) -- (B.north west) -- cycle;
|
||||
}
|
||||
\end{tikzpicture}
|
||||
}
|
||||
|
||||
% fonts and symbols
|
||||
\RequirePackage{emoji}
|
||||
% custom font size for a slide (cf. https://tex.stackexchange.com/a/401409)
|
||||
\newcommand{\customframefont}[1]{
|
||||
\setbeamertemplate{itemize/enumerate body begin}{#1}
|
||||
\setbeamertemplate{itemize/enumerate subbody begin}{#1}
|
||||
}
|
||||
\NewDocumentEnvironment{framefont}{m +b}{
|
||||
\customframefont{#1} % for itemize/enumerate
|
||||
{#1 % For the text outside itemize/enumerate
|
||||
#2
|
||||
}
|
||||
\customframefont{\normalsize}
|
||||
}{}
|
||||
% tikz
|
||||
\usetikzlibrary{arrows.meta}
|
||||
% math
|
||||
\RequirePackage{amsmath,amssymb}
|
||||
% resizebox
|
||||
\RequirePackage{graphicx}
|
||||
\RequirePackage{packages/slides-partners}
|
||||
\RequirePackage{subcaption}
|
||||
% tables
|
||||
\RequirePackage{array}
|
||||
\RequirePackage{tabularx}
|
||||
\RequirePackage{booktabs}
|
||||
% avoid spacing between rules and row background
|
||||
\setlength{\abovetopsep}{0pt}
|
||||
\setlength{\belowrulesep}{0pt}
|
||||
\setlength{\aboverulesep}{0pt}
|
||||
\setlength{\belowbottomsep}{0pt}
|
||||
% vertical row padding
|
||||
\renewcommand{\arraystretch}{1.5} % scales vertical row spacing
|
||||
% vertical centering of text in all tabularx columns
|
||||
\renewcommand\tabularxcolumn[1]{m{#1}}
|
||||
% alternate row color
|
||||
\definecolor{rowgray}{gray}{0.94}
|
||||
% links
|
||||
\RequirePackage{hyperref}
|
||||
\hypersetup{
|
||||
colorlinks,
|
||||
anchorcolor=ubo,
|
||||
citecolor=ubo,
|
||||
linkcolor=,
|
||||
urlcolor=ubo
|
||||
}
|
||||
|
||||
% redefine title page
|
||||
% https://tex.stackexchange.com/a/396409
|
||||
% Section 6.2.3 of:
|
||||
% https://ctan.math.illinois.edu/macros/latex/contrib/beamer-contrib/themes/moloch/moloch.pdf
|
||||
\makeatletter
|
||||
\setbeamertemplate{title page}{
|
||||
% Use the theme's margins rather than a full-paper-height box, which placed
|
||||
% the footer almost on the page edge. Stretch only the space above the footer.
|
||||
% If the content is too tall, shrink the top space so the footer keeps its
|
||||
% bottom margin and the title moves up instead.
|
||||
\begin{minipage}[t][\dimexpr\paperheight-2\beamer@leftmargin\relax][s]{\textwidth}
|
||||
\vspace*{\dimexpr .04\paperheight\relax minus 1fill}
|
||||
\ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
|
||||
\ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
|
||||
\vspace{.2cm}
|
||||
\ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
|
||||
\usebeamertemplate*{title separator}
|
||||
\ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
|
||||
\vfill
|
||||
\begin{columns}[b,onlytextwidth]
|
||||
\column{0.52\linewidth}
|
||||
\ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
|
||||
\column{0.44\linewidth}
|
||||
\insertpartnerlogos
|
||||
\end{columns}
|
||||
\vspace*{0pt}
|
||||
\end{minipage}
|
||||
}
|
||||
\makeatother
|
||||