finish simple and bar16 and readme

This commit is contained in:
zbowang 2018-11-29 12:28:09 +08:00
parent a66026b364
commit 141e20b54a
38 changed files with 302 additions and 156 deletions

247
README.md
View File

@ -2,54 +2,223 @@
## Introduction
This project include two themes, long and short version. When you are making a long slide, a sidebar with table of content and the current section you are talking about is necessary. Then, you can write your file based on `template_long.tex`, otherwise `template_short.tex`.
Beamer has a lot of themes which are build-in([Beamer Matrix](https://hartwork.org/beamer-theme-matrix/)) or developed by others([overleaf](https://www.overleaf.com/gallery/tagged/presentation), [github](https://github.com/martinbjeldbak/ultimate-beamer-theme-list)). But there is almost no satisfaction for me. What I mainly focus on is just **simple colors** and **clear navigation**. So I made a simple theme for myself by modifying the defaut theme. I will be encouraged if you like it too.
`.pdf` files in `examples` folder and demos below show the baisc style of this beamer theme.
The value of this project is as follows
## Usage
You can run `example_short.tex` and `example_long.tex` directly to see the demos.
When writing your own files, just input one of the template files and define colors you like to inherit this theme. Just like what `example_*.tex`s do.
For example
```
\documentclass[aspectratio=169]{beamer}
\input{template_long.tex}
\colorlet{main}{green!50!black}
%-------------------main body-------------------------%
\author{Your Name}
\title{Presentation Title}
\begin{document}
\end{document}
```
(Hint: Make sure that template_long.tex and your tex file is in the same folder.)
Of course, you can modify the theme based on the two template files to extend new styles. For each element you want to modify, just google it! There are a lot of answers to help you.
Next, let's see some demos.
- a template easy to be applied, easy to change color, easy to change way of navigation
- a content tex file to test the beauty of other themes
## Demos
### long green version
Here, I will show two main kinds of output with different aspect ratio(ratio of width to height). You can change the theme color and the way of navigation conveniently. See more [examples](examples) here.
![](imgs/long_green.jpg)
![simple](imgs/simple_bluegreen.jpg)
### long red version
[simple source](simple.tex)
![](imgs/long_red.jpg)
![sidebar16:9](imgs/bar169_red.jpg)
### short green version
[sidebar source](bar169.tex)
![](imgs/short_green.jpg)
## Usage
### short red version
The main file is `beamerthemeSimple.sty`. Make sure it is in the same folder as your tex file(Or [global path](https://tex.stackexchange.com/questions/1137/where-do-i-place-my-own-sty-or-cls-files-to-make-them-available-to-all-my-te/214080)). Here is a simplfied tex file.
![](imgs/short_red.jpg)
```latex
\documentclass{beamer}
\usepackage[english]{babel}
\usetheme{Simple}
% customize your own color and navigation
\definecolor{main}{RGB}{12 72 66} % overall color
\useoutertheme{tree} % navigation
\author{Your Name}
\title{Your title}
\date{November 29th, 2018}
\begin{document}
\frame[plain]{\titlepage}
\section{Introduction}
\begin{frame}
\frametitle{Latex and Beamer}
LaTeX is a high-quality typesetting system;
it includes features designed for the production of
technical and scientific documentation.
\end{frame}
\end{document}
```
You can change the color and the way of navigation as you like. I will talk about the two topics in detail.
You can find the source code of the demos in `simple.tex` and `bar169.tex` which just split the slides into several parts.
## Color
There will be only one unified color in the slides with this theme. You can change the overall color by setting RGB.
```
\definecolor{main}{RGB}{163 0 0} % red
```
Or HEX
```
\definecolor{main}{HTML}{A30000}
```
Here are some colors I like. You can see the output in [examples](examples).
```
\definecolor{main}{HTML}{096148} % green
\definecolor{main}{RGB}{12 72 66} % bluegreen
\definecolor{main}{HTML}{8D742A} % brown
\definecolor{main}{RGB}{163 0 0} % red
```
You can search for beautiful colors [here](http://nipponcolors.com).
## Navigation
For a long-time presentation, a suitable navigation is necessary. I selected four ways of navigation with different advantages.
### 1. split
All sections and subsections for the current section are displayed on the top of each page. It contains a lot of information. But it will become too fat if there are too many sections. Maybe deviding the presentation into several parts with command `\part` will help.
![split](imgs/split.PNG)
Load this navigation by
```
\useoutertheme{split}
```
### 2. tree
It is concise for only displaying the current section and subsection. It's recommended when the structure of this presentation is clear itself.
![tree](imgs/tree.PNG)
Load this navigation by
```
\useoutertheme{tree}
```
### 3. miniframes
This navigation displays all sections and the current subsection. More importantly, the navigation dots can show the progress of each subsection.
![miniframes1](imgs/miniframes1.PNG)
Load this navigation by
```
\useoutertheme{miniframes}
```
However, the dots placed in two lines may confuse those who have never touched it. Therefore, I recommend to use it when there are no subsections so that the dots will be placed in one line. The navigation dots will work for section if you set as follows.
```
\useoutertheme[subsection=false]{miniframes}
```
![miniframes1](imgs/miniframes2.PNG)
### 4. sidebar
It will display all sections and subsections on the right bar. It contains most information comparing with ways before. But it is not proper if there are too many topics to display.
![sidebar](imgs/sidebar.PNG)
Comparing with the previous outerthemes, I modified more after loading the built-in `sidebar` outertheme which I am not quite satisfied with. However, it may bring some side effect such as complict with Chinese and some settings of layout. But we can play with it well in most cases.
Here are the setting of this theme which is kind of different from before.
```
\documentclass[aspectratio=169]{beamer}
\usepackage[english]{babel}
\usetheme{Bar169}
\definecolor{main}{RGB}{163 0 0} % red
\author{Your Name}
\title{Your Title}
\date{November 29th, 2018}
\begin{document}
\frame[plain]{\titlepage}
\section{Introduction}
\begin{frame}
\frametitle{Latex and Beamer}
LaTeX is a high-quality typesetting system;
it includes features designed for the production of
technical and scientific documentation.
\end{frame}
\end{document}
```
Several points to pay attention to.
- Specify the ratio at the beginning `aspectratio=169`.
- Use theme `Bar169` rather than `Simple`.
- Don't need to specify the outertheme.
Other things are the same. You can change the color in the same way.
## Test other themes
The `content.tex` contents many patterns in beamer and enough sections to test what a theme looks like.
### Built-in themes
Build a `test.tex` file in this folder and fill in the code below.
```
\documentclass{beamer}
\usetheme{Berlin}
\usecolortheme{beaver}
\input{pkgs.tex}
\author{Your Name}
\title{Beamer Theme}
\begin{document}
\input{content.tex}
\end{document}
```
You will get
![Berlin-beaver](imgs/Berlin_beaver.jpg)
### Download themes
For example, we test [this theme](https://github.com/matze/mtheme)
```
\documentclass{beamer}
\usetheme{metropolis}
\input{pkgs.tex}
\author{Your Name}
\title{Beamer Theme}
\begin{document}
\input{content.tex}
\end{document}
```
You will get
![metropolis](imgs/metropolis.jpg)
I have to say that it is quite beautiful! But without navigation, it may be more appropriate to be used when having a short presentation.
However, you can achieve most of this effect by changing the 'simple' theme.
![simple-metropolis](imgs/simple_metropolis.jpg)
Besides, you can be more flexible to add the navigation.
![simple-tree-metropolis](imgs/simple_tree_metropolis.jpg)

View File

@ -1,7 +1,10 @@
\documentclass[aspectratio=169]{beamer}
\input{pkgs.tex}
\input{setting169.tex}
\input{global.tex}
\usetheme{Bar169}
\definecolor{main}{RGB}{163 0 0} % red
\begin{document}
\input{content.tex}
\end{document}

View File

@ -1,29 +1,7 @@
% footline
% delete navigation below
\setbeamertemplate{navigation symbols}{}
% define footline
\makeatother
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.4\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor
\end{beamercolorbox}
\begin{beamercolorbox}[wd=.6\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle\hspace*{13em}
\insertframenumber{} / \inserttotalframenumber\hspace*{0ex}
\end{beamercolorbox}}
\vskip0pt%
}
\makeatletter
% footline color
\setbeamercolor{author in head/foot}{fg=black, bg=mygrey!5!white}
\setbeamercolor{title in head/foot}{fg=black, bg=mygrey!5!white}
% sidebar color
\setbeamercolor{structure}{fg=main, bg=mygrey!10!white}
% Copyright 2018 by Zhibo Wang
%
% This file may be distributed and/or modified
% under the LaTeX Project Public License
% sidebar
@ -41,47 +19,51 @@
\setbeamersize{sidebar width left=2cm}
% footline
% delete navigation below
\setbeamertemplate{navigation symbols}{}
% define footline
% \makeatother
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.4\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor
\end{beamercolorbox}
\begin{beamercolorbox}[wd=.6\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle\hspace*{13em}
\insertframenumber{} / \inserttotalframenumber\hspace*{0ex}
\end{beamercolorbox}}
\vskip0pt%
}
% \makeatletter
% footline color
\setbeamercolor{author in head/foot}{fg=black, bg=mygrey!5!white}
\setbeamercolor{title in head/foot}{fg=black, bg=mygrey!5!white}
% item settings
\setbeamertemplate{itemize item}{$\color{main}\bullet$}
\setbeamertemplate{itemize subitem}{$\color{main}\bullet$}
\setbeamertemplate{enumerate items}[square]
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[square]
% color definition
%\definecolor{alizarin}{rgb}{0.82, 0.1, 0.26} % red
\definecolor{myblack}{rgb}{0.24, 0.17, 0.12}
\definecolor{mygrey}{rgb}{0.52, 0.52, 0.51}
\definecolor{main}{RGB}{163 0 0} % red
\definecolor{berlin}{rgb}{0.64, 0, 0} % red
\colorlet{main}{berlin}
\colorlet{text}{myblack!100!white}
%% main candidates
%% 1
% \definecolor{DarkFern}{HTML}{407428} % green
% \colorlet{main}{DarkFern!100!white}
%% 2
% \definecolor{bluegreen}{rgb}{0.047 0.282 0.259} % green
% \colorlet{main}{bluegreen}
%% 3
% \definecolor{mybrown}{HTML}{967249} % brown
% \colorlet{main}{mybrown}
% set colors to elements
%% fg: itself
%% bg: background
%% !num!: gradient
\setbeamercolor{title}{fg=main}
\setbeamercolor{structure}{fg=main, bg=mygrey!10!white}
\setbeamercolor{frametitle}{fg=main, bg=white}
\setbeamercolor{section in toc}{fg=text}
\setbeamercolor{normal text}{fg=text}
\setbeamercolor{block title}{fg=main,bg=mygrey!14!white}
\setbeamercolor{block title}{bg=mygrey!14!white}
\setbeamercolor{block body}{fg=black,bg=mygrey!10!white}
\setbeamercolor{block body alerted}{bg=white}
\setbeamercolor{block title alerted}{fg=main,bg=white}
\setbeamerfont{block title alerted}{series=\mdseries}
\setbeamercolor{alerted text}{fg=main}
\setbeamercolor{qed symbol}{fg=main} % proof end square
\setbeamercolor{math text}{fg=black}
\hypersetup{colorlinks,linkcolor=,urlcolor=main!80!white}
\setbeamerfont{alerted text}{series=\bfseries}
\hypersetup{colorlinks,linkcolor=,urlcolor=main!80!white}

View File

@ -1,8 +1,15 @@
% Copyright 2018 by Zhibo Wang
%
% This file may be distributed and/or modified
% under the LaTeX Project Public License
% footline
% delete navigation below
\setbeamertemplate{navigation symbols}{}
% define footline
\makeatother
% \makeatother
\setbeamertemplate{footline}
{
\leavevmode%
@ -18,69 +25,51 @@
\vskip0pt%
}
\makeatletter
% \makeatletter
% footline color
\setbeamercolor{author in head/foot}{fg=black, bg=mygrey!5!white}
\setbeamercolor{title in head/foot}{fg=black, bg=mygrey!5!white}
% sidebar color
\setbeamercolor{structure}{fg=main, bg=mygrey!10!white}
% sidebar
% delete title and author
\makeatletter
\setbeamertemplate{sidebar right}{\insertverticalnavigation{\beamer@sidebarwidth}}
\makeatother
% fontsize
\setbeamerfont{section in sidebar}{size=\scriptsize}
\setbeamerfont{subsection in sidebar}{size=\scriptsize}
% item settings
\setbeamertemplate{itemize item}{$\color{main}\bullet$}
\setbeamertemplate{itemize subitem}{$\color{main}\bullet$}
\setbeamertemplate{enumerate items}[square]
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[square]
% color definition
%\definecolor{alizarin}{rgb}{0.82, 0.1, 0.26} % red
\definecolor{myblack}{rgb}{0.24, 0.17, 0.12}
\definecolor{mygrey}{rgb}{0.52, 0.52, 0.51}
\definecolor{main}{RGB}{12 72 66} % bluegreen
\definecolor{berlin}{rgb}{0.64, 0, 0} % red
\colorlet{main}{berlin}
\colorlet{text}{myblack!100!white}
%% main candidates
%% 1
% \definecolor{DarkFern}{HTML}{407428} % green
% \colorlet{main}{DarkFern!100!white}
%% 2
% \definecolor{bluegreen}{rgb}{0.047 0.282 0.259} % green
% \colorlet{main}{bluegreen}
%% 3
% \definecolor{mybrown}{HTML}{967249} % brown
% \colorlet{main}{mybrown}
% set colors to elements
%% fg: itself
%% bg: background
%% !num!: gradient
\setbeamercolor{title}{fg=main}
\setbeamercolor{structure}{fg=main, bg=mygrey!10!white}
\setbeamercolor{frametitle}{fg=main, bg=white}
\setbeamercolor{section in toc}{fg=text}
\setbeamercolor{normal text}{fg=text}
\setbeamercolor{block title}{fg=main,bg=mygrey!14!white}
\setbeamercolor{block title}{bg=mygrey!14!white}
\setbeamercolor{block body}{fg=black,bg=mygrey!10!white}
\setbeamercolor{block body alerted}{bg=white}
\setbeamercolor{block title alerted}{fg=main,bg=white}
\setbeamercolor{alerted text}{fg=main}
\setbeamercolor{qed symbol}{fg=main} % proof end square
\setbeamercolor{math text}{fg=black}
\setbeamerfont{block title alerted}{series=\mdseries}
\setbeamerfont{alerted text}{series=\bfseries}
\hypersetup{colorlinks,linkcolor=,urlcolor=main!80!white}
% \setbeamerfont{frametitle}{series=\bfseries}
% \setbeamerfont{block title}{series=\bfseries}
% \setbeamerfont{title}{series=\bfseries}
% \setbeamertemplate{frametitle}{\insertframetitle\par\vskip-8pt\hrulefill} % add line under frametitle
% % metropolis
% % \definecolor{main}{RGB}{35 54 58}
% % no outer theme
% \setbeamerfont{frametitle}{series=\bfseries}
% \setbeamercolor{frametitle}{fg=white, bg=main}
% \setbeamerfont{block title}{series=\bfseries}
% \setbeamerfont{block title alerted}{series=\bfseries}
% \definecolor{alertcol}{RGB}{232 133 52}
% \setbeamercolor{block title alerted}{fg=alertcol,bg=white}
% \setbeamerfont{alerted text}{series=\mdseries}
% \setbeamercolor{alerted text}{fg=alertcol}
% \setbeamercolor{block title}{bg=mygrey!25!white}
% \setbeamercolor{block body}{fg=black,bg=mygrey!13!white}

View File

@ -27,8 +27,6 @@
\begin{frame}
\frametitle{Block and Alert}
\vspace{-1.1cm}
\begin{block}{Pythagorean theorem}
\vspace*{-\baselineskip}\setlength\belowdisplayshortskip{0.6pt}
@ -45,7 +43,6 @@
\end{itemize}
\end{alertblock}
\alert{Hightlight} these words are highlighted by $\backslash alert$.
\end{frame}
\begin{frame}
@ -72,7 +69,7 @@
\subsection{Other Environments}
\begin{frame}[shrink=15]{Algorithm}
\begin{frame}{Algorithm}
\begin{algorithm}[H]
\KwData{this text}
@ -117,16 +114,16 @@
\end{minipage}%
\hfill
\begin{minipage}{0.4\linewidth}
\begin{itemize}
\begin{enumerate}
\item item
\item another
\item more
\begin{enumerate}
\begin{itemize}
\item first
\item second
\item third
\end{enumerate}
\end{itemize}
\end{itemize}
\end{enumerate}
\end{minipage}
\end{frame}
@ -178,5 +175,5 @@
\section{Conclusion}
\begin{frame}{End}
This document just aims to test styles in beamer.
The last page.
\end{frame}

View File

@ -1,7 +0,0 @@
\documentclass{beamer}
\input{pkgs.tex}
\input{global.tex}
\input{setting43.tex}
\begin{document}
\input{content.tex}
\end{document}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
imgs/Berlin_beaver.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 KiB

BIN
imgs/bar169_red.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

BIN
imgs/metropolis.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 KiB

BIN
imgs/miniframes1.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
imgs/miniframes2.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
imgs/sidebar.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
imgs/simple_bluegreen.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 KiB

BIN
imgs/simple_metropolis.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 KiB

BIN
imgs/split.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
imgs/tree.PNG Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -2,4 +2,6 @@
\usepackage{fancyhdr} % header footer
\usepackage{graphicx} % figure
\usepackage{algorithm2e}
\usepackage{booktabs}
\usepackage{booktabs}
\usepackage{xcolor}
\usepackage{bookmark}

11
simple.tex Normal file
View File

@ -0,0 +1,11 @@
\documentclass{beamer}
\input{pkgs.tex}
\input{global.tex}
\usetheme{Simple}
\definecolor{main}{RGB}{12 72 66} % bluegreen
\useoutertheme{tree}
\begin{document}
\input{content.tex}
\end{document}