ambevar-dotfiles/.emacs.d/snippets/latex-mode/beamer.yasnippet

177 lines
5.0 KiB
Plaintext

# -*- mode: snippet -*-
# contributor : Pierre Neidhardt <ambrevar at gmail dot com> 2012-04-27
# key: beamer
# group: skeleton
# name: \documentclass{beamer} ...
# --
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[svgnames]{beamer} % xcolor=latex,table
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{geometry}
\usepackage{lmodern}
\usepackage{marvosym}
\usepackage{textcomp}
\DeclareUnicodeCharacter{20AC}{\EUR{}}
\DeclareUnicodeCharacter{2264}{\leqslant}
\DeclareUnicodeCharacter{2265}{\geqslant}
%%=============================================================================
%% Properties
\title{${1:Title}}
\subtitle{${2:Subtitle}}
\author{${3:\textcolor{structure.fg!60!white}{P.~Neidhardt}}}
\institute{\textcolor{sidebarSection}{${4:Institute}}}
%%==============================================================================
%% Aliases
\usepackage{xspace}
\let\latexbak\LaTeX
\renewcommand{\LaTeX}{{\rm \latexbak}}
\let\texbak\TeX
\renewcommand{\TeX}{{\rm \texbak}}
\def\unix{\textsc{Unix}}
%%==============================================================================
%% Beamer config
%% Remove navigation bar.
\beamertemplatenavigationsymbolsempty
%% Colors
\colorlet{sidebarSection}{orange!100!black}
\colorlet{sidebarSub}{yellow!100!black}
%% Themes
\usecolortheme{whale}
%% Background
\setbeamertemplate{background canvas}[vertical shading][top=white,bottom=white]
%% Bars
\setbeamercolor{frametitle}{bg=black, fg=white}
\useoutertheme[height=0pt]{sidebar}
\setbeamertemplate{sidebar canvas left}[horizontal shading][left=black,right=black]
\setbeamercolor{author in sidebar}{fg=red}
\setbeamercolor{section in sidebar shaded}{fg= sidebarSection}
\setbeamercolor{subsection in sidebar shaded}{fg= sidebarSub}
\setbeamercolor{subsection in sidebar}{fg=white}
\setbeamercolor{title}{fg=white,bg=black}
\setbeamertemplate{title page}[default][colsep=-4bp,rounded=true,shadow=true]
%% Blocks
\setbeamertemplate{blocks}[rounded] [shadow=true]
\setbeamercolor{block title}{fg=white,bg=structure.fg!80!black}
\setbeamercolor{block body}{fg=black,bg=structure.bg!95!black}
\setbeamercolor{block title alerted}{fg=white,bg=DarkRed}
\setbeamercolor{block body alerted}{fg=black,bg=structure.bg!95!black}
\setbeamercolor{block title example}{fg=white,bg=DarkGreen}
\setbeamercolor{block body example}{fg=black,bg=structure.bg!95!black}
%% Footline
\setbeamertemplate{footline}[page number]
%% Lists
%% default, triangle, circle, square, ball
%\setbeamertemplate{itemize item}[ball]
%% Auto add frametitle and framesubtitle according to section and subsection.
%% See below to toggle the effect.
\addtobeamertemplate{frametitle}{
\let\insertframetitle\insertsectionhead}{}
\addtobeamertemplate{frametitle}{
\let\insertframesubtitle\insertsubsectionhead}{}
%%==============================================================================
%% Graphics
%% Load TikZ after xcolor.
% \usepackage[svgnames]{xcolor}
% \usepackage{graphicx}
% \usepackage{tikz}
% \newcommand{\fancybox}[1]{
% \begin{tikzpicture}
% \node[draw,rounded corners]{#1};
% \end{tikzpicture}
% }
%%=============================================================================
%% Listings
% \usepackage{listings}
%% Source code.
% \lstdefinestyle{customc}{
% % numbers=left,
% belowcaptionskip=1\baselineskip,
% breaklines=true,
% frame=L,
% xleftmargin=\parindent,
% % framexleftmargin=\parindent,
% language=C,
% showstringspaces=false,
% basicstyle=\footnotesize\ttfamily,
% keywordstyle=\bfseries\color{green!40!black},
% commentstyle=\itshape\color{purple!40!black},
% identifierstyle=\color{blue},
% stringstyle=\color{orange},
% numberstyle=\ttfamily
% }
% \lstset{escapechar=@,style=customc}
%%==============================================================================
%% Babel
\usepackage[frenchb]{babel}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\titlepage{}
\end{frame}
%% Toggle auto insertion of frametitle and framesubtitle.
\makeatletter
%% \CheckCommand*\beamer@checkframetitle{\@ifnextchar\bgroup\beamer@inlineframetitle{}}
\renewcommand*\beamer@checkframetitle{
\global\let\beamer@frametitle\relax\@ifnextchar\bgroup\beamer@inlineframetitle{}
}
\makeatother
%%==============================================================================
\section{Frame}
\subsection{Classic frame}
\begin{frame}
\begin{alertblock}{Alert block}
Boom!
\end{alertblock}
\end{frame}
\subsection{With source code}
\begin{frame}[shrink,fragile]
\begin{lstlisting}[caption=Hello world!]
int main(int argc, char** argv)
{
printf("Hello world\n");
return 0;
}
\end{lstlisting}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%