Gestion des logos en titre et pied de page

This commit is contained in:
Benjamin Bohard 2020-08-07 11:09:11 +02:00
parent 70f77c883b
commit a2db5cca70
7 changed files with 53 additions and 14 deletions

BIN
figures/logos/missing.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -18,12 +18,20 @@
\skbinput[from=sli]{style/preambule} \skbinput[from=sli]{style/preambule}
\newlength{\logospacing}
\setlength{\logospacing}{(\textwidth - 2cm*2)/1}
\logo{
\skbfigure[width=2cm]{logos/MENJ.jpg}~ \hspace{\logospacing}
\skbfigure[width=2cm]{logos/Cadoles.png}~
}
\title[]{Formation tronc commun niveau 1} \title[]{Formation tronc commun niveau 1}
\subtitle{XXX CLIENT XXX} \subtitle{XXX CLIENT XXX}
\author[Equipe Auteur]{Cadoles} \author[Equipe Auteur]{Cadoles}
\institute[Cadoles]{\skbfigure[width=2cm]{cadoles/logo_01.png}} \institute[Cadoles]{\skbfigure[width=2cm]{logos/Cadoles.png}}
\date{{\small \today}} \date{{\small \today}}

View File

@ -18,12 +18,20 @@
\skbinput[from=sli]{style/preambule} \skbinput[from=sli]{style/preambule}
\newlength{\logospacing}
\setlength{\logospacing}{(\textwidth - 2cm*2)/1}
\logo{
\skbfigure[width=2cm]{logos/MENJ.jpg}~ \hspace{\logospacing}
\skbfigure[width=2cm]{logos/Cadoles.png}~
}
\title[]{Formation tronc commun niveau 2} \title[]{Formation tronc commun niveau 2}
\subtitle{XXX CLIENT XXX} \subtitle{XXX CLIENT XXX}
\author[Equipe Auteur]{Cadoles} \author[Equipe Auteur]{Cadoles}
\institute[Cadoles]{\skbfigure[width=2cm]{cadoles/logo_01.png}} \institute[Cadoles]{\skbfigure[width=2cm]{logos/Cadoles.png}}
\date{{\small \today}} \date{{\small \today}}

View File

@ -5,7 +5,7 @@ import argparse
import re import re
import random import random
import time import time
from os import path, makedirs from os import path, makedirs, listdir
from jinja2 import Environment, FileSystemLoader from jinja2 import Environment, FileSystemLoader
LICENSES = {'CC-by-sa-2.0': 'license-cc-by-sa-2.0', LICENSES = {'CC-by-sa-2.0': 'license-cc-by-sa-2.0',
@ -49,6 +49,20 @@ def main():
""" """
init function init function
""" """
def get_institutes_logos(institutes_list=None):
if not institutes_list:
return []
institutes_logos = []
known_logos = {path.splitext(path.basename(l))[0]:l for l in listdir('./figures/logos')}
for institute in institutes_list:
if institute in known_logos:
institutes_logos.append(known_logos[institute])
else:
print(f'Unknown institute {institute}')
print(f'Replacing with missing.png')
institutes_logos.append('missing.png')
return institutes_logos
root = '../' root = '../'
if args.directory: if args.directory:
root = root + re.sub(r'[\w-]+/?', '../', args.directory) root = root + re.sub(r'[\w-]+/?', '../', args.directory)
@ -80,6 +94,9 @@ def main():
else: else:
client = client client = client
institutes = get_institutes_logos(args.institutes)
logos_count = len(institutes) + 1
directory = args.directory directory = args.directory
if not directory: if not directory:
directory = '' directory = ''
@ -95,7 +112,9 @@ def main():
'title': title, 'title': title,
'author': author, 'author': author,
'client': client, 'client': client,
'license': license} 'license': license,
'institutes': institutes,
'logos_count': logos_count}
master = TEMPLATES[document_class]['master'] master = TEMPLATES[document_class]['master']
master_dir = path.join('presentations', directory) master_dir = path.join('presentations', directory)
programme_dir = path.join(master_dir, 'programme') programme_dir = path.join(master_dir, 'programme')
@ -189,6 +208,7 @@ def main():
parser_init.add_argument('-t', '--title', help="Titre de la formation") parser_init.add_argument('-t', '--title', help="Titre de la formation")
parser_init.add_argument('-l', '--license', help="Termes de mise à disposition de la formation") parser_init.add_argument('-l', '--license', help="Termes de mise à disposition de la formation")
parser_init.add_argument('-d', '--directory', help="Sous-répertoires où créer le fichier", required=True) parser_init.add_argument('-d', '--directory', help="Sous-répertoires où créer le fichier", required=True)
parser_init.add_argument('-i', '--institutes', nargs='*', help="Instituts dont les logos sont requis")
parser_init.set_defaults(func=init) parser_init.set_defaults(func=init)
parser_update = subparsers.add_parser('update', help='Mise à jour des fichiers inclus') parser_update = subparsers.add_parser('update', help='Mise à jour des fichiers inclus')
parser_update.add_argument('-m', '--master', help="Emplacement du fichier maître", required=True) parser_update.add_argument('-m', '--master', help="Emplacement du fichier maître", required=True)

View File

@ -12,5 +12,4 @@
ou écrivez à Creative Commons, 444 Castro Street, Suite 900, ou écrivez à Creative Commons, 444 Castro Street, Suite 900,
Mountain View, California, 94041, USA. Mountain View, California, 94041, USA.
\end{block} \end{block}
\pnote{test des notes standard}
\end{frame} \end{frame}

View File

@ -16,6 +16,7 @@
\usepackage{xcolor} \usepackage{xcolor}
\usepackage{hyperref} \usepackage{hyperref}
\usepackage{hyperxmp} \usepackage{hyperxmp}
\usepackage{calc}
%\usepackage{pdfpcnotes} % Indisponible dans les paquets, installation manuelle requise %\usepackage{pdfpcnotes} % Indisponible dans les paquets, installation manuelle requise
\hypersetup{% \hypersetup{%
@ -47,8 +48,6 @@
{\skbinput[from=fig]{cadoles/simple_dash}} {\skbinput[from=fig]{cadoles/simple_dash}}
\institute[Cadoles]{\skbfigure[width=2cm]{cadoles/logo-01.png}}
\institute[MENJ]{\skbfigure[width=2cm]{en/logo_MENJ.jpg}}
\date{{\small \today}} \date{{\small \today}}
@ -84,11 +83,6 @@
\end{frame} \end{frame}
} }
\logo{
\skbfigure[width=2cm]{en/logo_MENJ.jpg}~ \hspace{220pt}
\skbfigure[width=2cm]{cadoles/logo_01.png}~
}
\addtobeamertemplate{frametitle}{% \addtobeamertemplate{frametitle}{%
\begin{tikzpicture}[remember picture,overlay] \begin{tikzpicture}[remember picture,overlay]
\node[anchor=north west,yshift=2pt,text opacity=0.5, scale=0.8] at (current page.north west) {\insertsubsection}; \node[anchor=north west,yshift=2pt,text opacity=0.5, scale=0.8] at (current page.north west) {\insertsubsection};

View File

@ -16,15 +16,25 @@
\newcommand{\pdftitle}{(((title)))} \newcommand{\pdftitle}{(((title)))}
\newcommand{\pdfkeywords}{EOLE} \newcommand{\pdfkeywords}{EOLE}
\skbinput[from=(((content)))]{style/preambule} \skbinput[from=(((content)))]{style/preambule}
\newlength{\logospacing}
\setlength{\logospacing}{(\textwidth - 2cm*(((logos_count))))/(((logos_count - 1)))}
\logo{
((* for institute in institutes *))
\skbfigure[width=2cm]{logos/(((institute)))}~ \hspace{\logospacing}
((* endfor *))
\skbfigure[width=2cm]{logos/Cadoles.png}~
}
\title[]{(((title)))} \title[]{(((title)))}
\subtitle{(((client)))} \subtitle{(((client)))}
\author[Equipe Auteur]{(((author)))} \author[Equipe Auteur]{(((author)))}
\institute[Cadoles]{\skbfigure[width=2cm]{cadoles/logo_01.png}} \institute[Cadoles]{\skbfigure[width=2cm]{logos/Cadoles.png}}
\date{{\small \today}} \date{{\small \today}}