mirror of
				https://github.com/congyu711/BeamerTheme.git
				synced 2025-11-04 08:01:08 +08:00 
			
		
		
		
	set color by option
This commit is contained in:
		
							
								
								
									
										27
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								README.md
									
									
									
									
									
								
							@@ -28,10 +28,9 @@ The main file is `beamerthemeSimple.sty`. Make sure it is in the same folder as
 | 
				
			|||||||
```latex
 | 
					```latex
 | 
				
			||||||
\documentclass{beamer}
 | 
					\documentclass{beamer}
 | 
				
			||||||
    \usepackage[english]{babel}
 | 
					    \usepackage[english]{babel}
 | 
				
			||||||
    \usetheme{Simple}
 | 
					 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    % customize your own color and navigation
 | 
					    % customize your own color and navigation
 | 
				
			||||||
    \definecolor{main}{RGB}{12 72 66} % overall color
 | 
					    \usetheme[RGB={12 72 66}]{Simple} % color
 | 
				
			||||||
    \useoutertheme{tree}              % navigation
 | 
					    \useoutertheme{tree}              % navigation
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    \author{Your Name}
 | 
					    \author{Your Name}
 | 
				
			||||||
@@ -57,29 +56,31 @@ You can change the color and the way of navigation as you like. I will talk abou
 | 
				
			|||||||
There will be only one unified color in the slides with this theme. You can change the overall color by setting RGB.
 | 
					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
 | 
					\usetheme[RGB={12 72 66}]{Simple}
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Or HEX
 | 
					Or HEX
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
\definecolor{main}{HTML}{A30000}
 | 
					\usetheme[HTML=A30000]{Simple}
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Here are some colors I like. You can see the output in [examples](examples).
 | 
					Here are some colors I like. You can see the output in [examples](examples).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
\definecolor{main}{HTML}{096148} % green
 | 
					HTML=096148      % green
 | 
				
			||||||
\definecolor{main}{RGB}{12 72 66} % bluegreen
 | 
					RGB={12 72 66}   % bluegreen
 | 
				
			||||||
\definecolor{main}{HTML}{8D742A} % brown
 | 
					HTML=8D742A      % brown
 | 
				
			||||||
\definecolor{main}{RGB}{163 0 0} % red
 | 
					RGB={163 0 0}    % red
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
You can search for beautiful colors [here](http://nipponcolors.com).
 | 
					You can search for beautiful colors [here](http://nipponcolors.com). 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Or just generate three RGB values by heart. You may find the output is surprisingly beautiful when the three value are all below 100.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Navigation
 | 
					## Navigation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
For a long-time presentation, a suitable navigation is necessary. I selected four ways of navigation with different advantages.
 | 
					For a long-time presentation, a suitable navigation is necessary. I selected four ways of navigation with different advantages.(**focus on the top of each slide**)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### 1. split
 | 
					### 1. split
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -139,9 +140,7 @@ Here is the usage of this theme which is kind of different from before.
 | 
				
			|||||||
```
 | 
					```
 | 
				
			||||||
\documentclass[aspectratio=169]{beamer}
 | 
					\documentclass[aspectratio=169]{beamer}
 | 
				
			||||||
    \usepackage[english]{babel}
 | 
					    \usepackage[english]{babel}
 | 
				
			||||||
    \usetheme{Bar169}
 | 
					    \usetheme[RGB={12 72 66}]{Bar169}
 | 
				
			||||||
 | 
					 | 
				
			||||||
    \definecolor{main}{RGB}{163 0 0} % red
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    \author{Your Name}
 | 
					    \author{Your Name}
 | 
				
			||||||
    \title{Your Title}
 | 
					    \title{Your Title}
 | 
				
			||||||
@@ -219,6 +218,6 @@ However, you can achieve most of this effect by changing my 'simple' theme.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
------------------
 | 
					------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Besides, it is more flexible to add the navigation.
 | 
					**Besides, it is more flexible to add the navigation.**
 | 
				
			||||||
 | 
					
 | 
				
			||||||

 | 
					
 | 
				
			||||||
@@ -3,8 +3,6 @@
 | 
				
			|||||||
    \input{global.tex}
 | 
					    \input{global.tex}
 | 
				
			||||||
    \usetheme{Bar169}
 | 
					    \usetheme{Bar169}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    \definecolor{main}{RGB}{163 0 0} % red
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    \begin{document}
 | 
					    \begin{document}
 | 
				
			||||||
        \input{content.tex}
 | 
					        \input{content.tex}
 | 
				
			||||||
    \end{document}
 | 
					    \end{document}
 | 
				
			||||||
@@ -4,6 +4,17 @@
 | 
				
			|||||||
% under the LaTeX Project Public License
 | 
					% under the LaTeX Project Public License
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					\definecolor{beamer@simple@color}{RGB}{163 0 0} % bluegreen
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{gray}{\definecolor{beamer@simple@color}{gray}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{rgb}{\definecolor{beamer@simple@color}{rgb}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{RGB}[{12 72 0}]{\definecolor{beamer@simple@color}{RGB}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{HTML}{\definecolor{beamer@simple@color}{HTML}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{cmyk}{\definecolor{beamer@simple@color}{cmyk}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{cmy}{\definecolor{beamer@simple@color}{cmy}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{named}{\definecolor{beamer@simple@color}{named}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{hsb}{\definecolor{beamer@simple@color}{hsb}{#1}}
 | 
				
			||||||
 | 
					\ProcessOptionsBeamer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
% sidebar
 | 
					% sidebar
 | 
				
			||||||
% on the right
 | 
					% on the right
 | 
				
			||||||
\useoutertheme[width=5\baselineskip,right]{sidebar}
 | 
					\useoutertheme[width=5\baselineskip,right]{sidebar}
 | 
				
			||||||
@@ -46,8 +57,8 @@
 | 
				
			|||||||
\setbeamercolor{title in head/foot}{fg=black, bg=mygrey!5!white}
 | 
					\setbeamercolor{title in head/foot}{fg=black, bg=mygrey!5!white}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
% item settings
 | 
					% item settings
 | 
				
			||||||
\setbeamertemplate{itemize item}{$\color{main}\bullet$}
 | 
					\setbeamertemplate{itemize item}{$\color{beamer@simple@color}\bullet$}
 | 
				
			||||||
\setbeamertemplate{itemize subitem}{$\color{main}\bullet$}
 | 
					\setbeamertemplate{itemize subitem}{$\color{beamer@simple@color}\bullet$}
 | 
				
			||||||
\setbeamertemplate{enumerate items}[square]
 | 
					\setbeamertemplate{enumerate items}[square]
 | 
				
			||||||
\setbeamertemplate{section in toc}[sections numbered]
 | 
					\setbeamertemplate{section in toc}[sections numbered]
 | 
				
			||||||
\setbeamertemplate{subsection in toc}[square]
 | 
					\setbeamertemplate{subsection in toc}[square]
 | 
				
			||||||
@@ -55,15 +66,14 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
% color definition
 | 
					% color definition
 | 
				
			||||||
\definecolor{mygrey}{rgb}{0.52, 0.52, 0.51}
 | 
					\definecolor{mygrey}{rgb}{0.52, 0.52, 0.51}
 | 
				
			||||||
\definecolor{main}{RGB}{163 0 0} % red
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
\setbeamercolor{structure}{fg=main, bg=mygrey!10!white}
 | 
					\setbeamercolor{structure}{fg=beamer@simple@color, bg=mygrey!10!white}
 | 
				
			||||||
\setbeamercolor{frametitle}{fg=main, bg=white}
 | 
					\setbeamercolor{frametitle}{fg=beamer@simple@color, bg=white}
 | 
				
			||||||
\setbeamercolor{block title}{bg=mygrey!14!white}
 | 
					\setbeamercolor{block title}{bg=mygrey!14!white}
 | 
				
			||||||
\setbeamercolor{block body}{fg=black,bg=mygrey!10!white}
 | 
					\setbeamercolor{block body}{fg=black,bg=mygrey!10!white}
 | 
				
			||||||
\setbeamercolor{block body alerted}{bg=white}
 | 
					\setbeamercolor{block body alerted}{bg=white}
 | 
				
			||||||
\setbeamercolor{block title alerted}{fg=main,bg=white}
 | 
					\setbeamercolor{block title alerted}{fg=beamer@simple@color,bg=white}
 | 
				
			||||||
\setbeamerfont{block title alerted}{series=\mdseries}
 | 
					\setbeamerfont{block title alerted}{series=\mdseries}
 | 
				
			||||||
\setbeamercolor{alerted text}{fg=main}
 | 
					\setbeamercolor{alerted text}{fg=beamer@simple@color}
 | 
				
			||||||
\setbeamerfont{alerted text}{series=\bfseries}
 | 
					\setbeamerfont{alerted text}{series=\bfseries}
 | 
				
			||||||
\hypersetup{colorlinks,linkcolor=,urlcolor=main!80!white}
 | 
					\hypersetup{colorlinks,linkcolor=,urlcolor=beamer@simple@color!80!white}
 | 
				
			||||||
@@ -4,6 +4,16 @@
 | 
				
			|||||||
% under the LaTeX Project Public License
 | 
					% under the LaTeX Project Public License
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					\definecolor{beamer@simple@color}{RGB}{12 72 66} % bluegreen
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{gray}{\definecolor{beamer@simple@color}{gray}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{rgb}{\definecolor{beamer@simple@color}{rgb}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{RGB}[{12 72 0}]{\definecolor{beamer@simple@color}{RGB}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{HTML}{\definecolor{beamer@simple@color}{HTML}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{cmyk}{\definecolor{beamer@simple@color}{cmyk}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{cmy}{\definecolor{beamer@simple@color}{cmy}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{named}{\definecolor{beamer@simple@color}{named}{#1}}
 | 
				
			||||||
 | 
					\DeclareOptionBeamer{hsb}{\definecolor{beamer@simple@color}{hsb}{#1}}
 | 
				
			||||||
 | 
					\ProcessOptionsBeamer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
% footline
 | 
					% footline
 | 
				
			||||||
% delete navigation below
 | 
					% delete navigation below
 | 
				
			||||||
@@ -31,37 +41,37 @@
 | 
				
			|||||||
\setbeamercolor{title in head/foot}{fg=black, bg=mygrey!5!white}
 | 
					\setbeamercolor{title in head/foot}{fg=black, bg=mygrey!5!white}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
% item settings
 | 
					% item settings
 | 
				
			||||||
\setbeamertemplate{itemize item}{$\color{main}\bullet$}
 | 
					\setbeamertemplate{itemize item}{$\color{beamer@simple@color}\bullet$}
 | 
				
			||||||
\setbeamertemplate{itemize subitem}{$\color{main}\bullet$}
 | 
					\setbeamertemplate{itemize subitem}{$\color{beamer@simple@color}\bullet$}
 | 
				
			||||||
\setbeamertemplate{enumerate items}[square]
 | 
					\setbeamertemplate{enumerate items}[square]
 | 
				
			||||||
\setbeamertemplate{section in toc}[sections numbered]
 | 
					\setbeamertemplate{section in toc}[sections numbered]
 | 
				
			||||||
\setbeamertemplate{subsection in toc}[square]
 | 
					\setbeamertemplate{subsection in toc}[square]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
% color definition
 | 
					% color definition
 | 
				
			||||||
\definecolor{mygrey}{rgb}{0.52, 0.52, 0.51}
 | 
					\definecolor{mygrey}{rgb}{0.52, 0.52, 0.51}
 | 
				
			||||||
\definecolor{main}{RGB}{12 72 66} % bluegreen
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
\setbeamercolor{structure}{fg=main, bg=mygrey!10!white}
 | 
					\setbeamercolor{structure}{fg=beamer@simple@color, bg=mygrey!10!white}
 | 
				
			||||||
\setbeamercolor{frametitle}{fg=main, bg=white}
 | 
					\setbeamercolor{frametitle}{fg=beamer@simple@color, bg=white}
 | 
				
			||||||
\setbeamercolor{block title}{bg=mygrey!14!white}
 | 
					\setbeamercolor{block title}{bg=mygrey!14!white}
 | 
				
			||||||
\setbeamercolor{block body}{fg=black,bg=mygrey!10!white}
 | 
					\setbeamercolor{block body}{fg=black,bg=mygrey!10!white}
 | 
				
			||||||
\setbeamercolor{block body alerted}{bg=white}
 | 
					\setbeamercolor{block body alerted}{bg=white}
 | 
				
			||||||
\setbeamercolor{block title alerted}{fg=main,bg=white}
 | 
					\setbeamercolor{block title alerted}{fg=beamer@simple@color,bg=white}
 | 
				
			||||||
\setbeamercolor{alerted text}{fg=main}
 | 
					\setbeamercolor{alerted text}{fg=beamer@simple@color}
 | 
				
			||||||
\setbeamerfont{block title alerted}{series=\mdseries}
 | 
					\setbeamerfont{block title alerted}{series=\mdseries}
 | 
				
			||||||
\setbeamerfont{alerted text}{series=\bfseries}
 | 
					\setbeamerfont{alerted text}{series=\bfseries}
 | 
				
			||||||
\hypersetup{colorlinks,linkcolor=,urlcolor=main!80!white}
 | 
					\hypersetup{colorlinks,linkcolor=,urlcolor=beamer@simple@color!80!white}
 | 
				
			||||||
% \setbeamerfont{frametitle}{series=\bfseries}
 | 
					% \setbeamerfont{frametitle}{series=\bfseries}
 | 
				
			||||||
% \setbeamerfont{block title}{series=\bfseries}
 | 
					% \setbeamerfont{block title}{series=\bfseries}
 | 
				
			||||||
% \setbeamerfont{title}{series=\bfseries}
 | 
					% \setbeamerfont{title}{series=\bfseries}
 | 
				
			||||||
% \setbeamertemplate{frametitle}{\insertframetitle\par\vskip-8pt\hrulefill} % add line under frametitle
 | 
					% \setbeamertemplate{frametitle}{\insertframetitle\par\vskip-8pt\hrulefill} % add line under frametitle
 | 
				
			||||||
 | 
					
 | 
				
			||||||
% % metropolis
 | 
					% % metropolis
 | 
				
			||||||
% % \definecolor{main}{RGB}{35 54 58}
 | 
					% % \definecolor{beamer@simple@color}{RGB}{35 54 58}
 | 
				
			||||||
% % no outer theme
 | 
					% % no outer theme
 | 
				
			||||||
% \setbeamerfont{frametitle}{series=\bfseries}
 | 
					% \setbeamerfont{frametitle}{series=\bfseries}
 | 
				
			||||||
% \setbeamercolor{frametitle}{fg=white, bg=main}
 | 
					% \setbeamercolor{frametitle}{fg=white, bg=beamer@simple@color}
 | 
				
			||||||
% \setbeamerfont{block title}{series=\bfseries}
 | 
					% \setbeamerfont{block title}{series=\bfseries}
 | 
				
			||||||
% \setbeamerfont{block title alerted}{series=\bfseries}
 | 
					% \setbeamerfont{block title alerted}{series=\bfseries}
 | 
				
			||||||
% \definecolor{alertcol}{RGB}{232 133 52}
 | 
					% \definecolor{alertcol}{RGB}{232 133 52}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										26
									
								
								content.tex
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								content.tex
									
									
									
									
									
								
							@@ -70,7 +70,7 @@
 | 
				
			|||||||
\subsection{Other Environments}
 | 
					\subsection{Other Environments}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{frame}{Algorithm}
 | 
					\begin{frame}{Algorithm}
 | 
				
			||||||
    
 | 
					    \scriptsize
 | 
				
			||||||
    \begin{algorithm}[H]
 | 
					    \begin{algorithm}[H]
 | 
				
			||||||
        \KwData{this text}
 | 
					        \KwData{this text}
 | 
				
			||||||
        \KwResult{how to write algorithm with \LaTeX2e }
 | 
					        \KwResult{how to write algorithm with \LaTeX2e }
 | 
				
			||||||
@@ -89,6 +89,30 @@
 | 
				
			|||||||
        \end{algorithm}
 | 
					        \end{algorithm}
 | 
				
			||||||
\end{frame}
 | 
					\end{frame}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					\begin{frame}[fragile]
 | 
				
			||||||
 | 
					    \frametitle{An Algorithm For Finding Primes Numbers.}
 | 
				
			||||||
 | 
					    \scriptsize
 | 
				
			||||||
 | 
					    \begin{verbatim}
 | 
				
			||||||
 | 
					        int main (void)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            std::vector<bool> is_prime (100, true);
 | 
				
			||||||
 | 
					            for (int i = 2; i < 100; i++)
 | 
				
			||||||
 | 
					            if (is_prime[i])
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                std::cout << i << " ";
 | 
				
			||||||
 | 
					                for (int j = i; j < 100; is_prime [j] = false, j+=i);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return 0;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    \end{verbatim}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    \vspace{-0.7cm}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    \begin{uncoverenv}
 | 
				
			||||||
 | 
					    Note the use of \verb|\alert|.
 | 
				
			||||||
 | 
					    \end{uncoverenv}
 | 
				
			||||||
 | 
					\end{frame}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{frame}{More}
 | 
					\begin{frame}{More}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    More environments such as
 | 
					    More environments such as
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								examples/simple/simple_tree_bluegreen.pdf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								examples/simple/simple_tree_bluegreen.pdf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -1,9 +1,8 @@
 | 
				
			|||||||
\documentclass{beamer}
 | 
					\documentclass{beamer}
 | 
				
			||||||
    \input{pkgs.tex}
 | 
					    \input{pkgs.tex}
 | 
				
			||||||
    \input{global.tex}
 | 
					    \input{global.tex}
 | 
				
			||||||
    \usetheme{Simple}
 | 
					 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    \definecolor{main}{RGB}{12 72 66} % bluegreen
 | 
					    \usetheme{Simple}
 | 
				
			||||||
    \useoutertheme{tree}
 | 
					    \useoutertheme{tree}
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    \begin{document}
 | 
					    \begin{document}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user