preambule.tex 2.23 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}


% Beamer themes on custom folder
% @see https://tex.stackexchange.com/a/284157
% @usage For a theme "MYTHEME" in a subfolder named "Theme"
% \usefolder{Theme}
% \usetheme{MYTHEME}
\makeatletter
  \def\beamer@calltheme#1#2#3{%
    \def\beamer@themelist{#2}
    \@for\beamer@themename:=\beamer@themelist\do
    {\usepackage[{#1}]{\beamer@themelocation/#3\beamer@themename}}}

  \def\usefolder#1{
    \def\beamer@themelocation{#1}
  }
  \def\beamer@themelocation{}


27
% Choose the custom folder for beamer theme
28
29
\usefolder{presentation_inrae}
\usetheme{INRAE}
30

31
32
33
34
35
36
% Reduce spacing in table of contents (beamer)
% https://tex.stackexchange.com/a/51458
\usepackage{etoolbox}
\makeatletter
\patchcmd{\beamer@sectionintoc}{\vskip1.5em}{\vskip1em}{}{}
\makeatother
37
38
39
40
41
42
43
44
45
46
47
48

% Automatic frame titles and subtitles from section and subsection
% @see https://tex.stackexchange.com/a/15429
\addtobeamertemplate{frametitle}{
   \let\insertframetitle\insertsectionhead}{}
\addtobeamertemplate{frametitle}{
   \let\insertframesubtitle\insertsubsectionhead}{}
\makeatletter
  \CheckCommand*\beamer@checkframetitle{\@ifnextchar\bgroup\beamer@inlineframetitle{}}
  %\renewcommand*\beamer@checkframetitle{\global\let\beamer@frametitle\relax\@ifnextchar\bgroup\beamer@inlineframetitle{}}
\makeatother

49
50
% Definition of custom Frame Title for INRAE
\newcommand{\INRAEFrameTitle}[2]{
51
  \begin{beamercolorbox}[wd=\paperwidth,ht=1.2cm]{frametitle}
52
  \begin{tikzpicture}
53
54
  \node[anchor=south west] (gimmick_inrae) at (1,0)
    {\includegraphics[width=1cm,keepaspectratio]{presentation_inrae/CouvCadreMarineGH}};
55
56
57
58
59
60
  \useasboundingbox(0,0) rectangle(\the\paperwidth,1.2);
\def\tempa{1#2}% Third example https://tex.stackexchange.com/a/286903/124910
\if\tempa1%
      {\node[anchor=west, gris,font=\Large] at (1.5,0.41){#1};}%
\else%
      {\node[anchor= west, gris,font=\Large] at (1.5,0.61){#1};%
61
       \node[anchor= west, inrae,font=\large] at (1.5,0.11){\textcolor{inrae}{\textsc{#2}}};}%
62
63
64
\fi
  \end{tikzpicture}
  \end{beamercolorbox}
65
66
}

67
68
% Definition of custom frame for INRAE Frame Title
\newcommand{\INRAEFrame}[1]{
69
70
71
72
\frame{
	\frametitle{~}
#1
}
73
}