Version1/Beamer.psm1

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
Function New-Presentation{
[CmdletBinding()]
Param(
[Parameter()][switch]$Blank,
[Parameter()][switch]$Template
)
$start=@'
\documentclass[10,aspectratio=169]{beamer}
%Author: Abdul Saboor@UDEL 2019
\mode<presentation>
\pgfmathsetmacro{\TotalTime}{20} %Sets time duration.
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{color}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{lipsum}
\usepackage{wrapfig}
\usepackage{verbatim}
\usepackage{listings}
\usepackage{subfigure}
\usepackage{tikz}
\usepackage{blindtext}
\usepackage{./resources/mystyle}
\usetikzlibrary{fadings, shadows, shadings}
\usepackage{circuitikz}
\usepackage{comment}
\usepackage{ifthen}
\usepackage{multicol}
\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule
\usefonttheme{serif}
% TO CHANGE DEFAULT LINE SPREAD AT ANY POINT IN DOCUMENT
\renewcommand{\baselinestretch}{0.9}
\author{{\bf Abdul Saboor} \\ {\scriptsize Email: asaboor@udel.edu}}
\institute[UDEL]
{Department of Physics and Astronomy \\ University of Delaware, Newark, DE 19716-2570, USA}
\title[]{\href{https://github.com/massgh/Beamer-Timer/tree/master/}{\bf \LARGE{Time Beam \\ Progress Bar}}}
\date{\tddate\ \ \tdtime}
\begin{document}
%-----------------------------------------------------------------------
% PRESENTATION SLIDE TITLE
%-----------------------------------------------------------------------
{
    \usebackgroundtemplate{\begin{tikzpicture}
    \node[align=center,opacity=0.2]{ \includegraphics[width=0.55\paperwidth]{resources/ud.png}};
\end{tikzpicture}}
\begin{frame}[plain,noframenumbering]
\begin{center}
    \begin{tikzpicture}
        \node[text width= 0.3\textwidth, align=center,rounded corners,fill=white,inner sep=0.3ex]
         at (0.5*\paperwidth,0) {\includegraphics[width=\textwidth]{resources/ud1}};
     
        \draw[] node[ text width= 0.75\textwidth ,style=title text] at (0.5*\paperwidth,-4) { \begin{minipage}{\textwidth}
        \maketitle
        \end{minipage}};
    \end{tikzpicture}
\end{center}
\end{frame}
}
%-----------------------------------------------------------------------
%SLIDES AFTER TITLE START HERE
%-----------------------------------------------------------------------
% PRESENTATION SLIDE 1
%-----------------------------------------------------------------------
\SingleFrame{OutLine}{
    \initclock % This must be used one time to initialize the clock
    \begin{center}
        \sNode{ \vspace{-6mm}
        \begin{multicols}{2}
            \tableofcontents
        \end{multicols}}
\end{center}
}
'@

$middle=@'
%-----------------------------------------------------------------------
% PRESENTATION SLIDE 2
%-----------------------------------------------------------------------
\section{Single Column Frame}
\SingleFrame{Single Column Frame}{
\sNode{ A frame with one column accepts two arguments like below: \\
        \alert{$\backslash$SingleFrame\{Frame Title\}\{Frame Content\}} \\
        This green background is generated by \\
        \alert{$\backslash$gNode\{Node Text\}} \\
        Node text can accept any thing. You have multiple colors nodes.
}
        \rNode{\alert{$\backslash$rNode\{Red Node\}} }
        \bNode{ \alert{$\backslash$bNode\{Blue Node\}}}
        \kNode{\alert{$\backslash$kNode\{Balck Node\}} \\
            Double column frame could be inserted via command: \\
        \alert{$\backslash$DoubleFrame\{Frame Title\}\{First Column Content\}\{Second Column Content\}}}
}
\section{Double Column Frame}
\DoubleFrame{Double Column Frame}{
\gNode{\begin{enumerate}
        \item Fig.(a) is gold.
\end{enumerate}}
\rNode{\begin{itemize}
        \item Fig.(b) is Kashmir.
\end{itemize}}
 
\sNode{\begin{tabular}{ p{1.25cm}p{1cm}p{1cm} }
        %\toprule
        \textbf{Property} & \textbf{Normal} & \textbf{SO} \\
        \midrule
        $E_{g}$(eV)& 1.32 &1.20 \\
        $\Delta_{SO}$(eV) & --- & 0.34 \\
        a (\AA) & 5.6 & 5.6 \\
        c/a &2.54 & 2.54 \\
        V (\AA$^3$) &12.67 & 12.67 \\
        \bottomrule
\end{tabular}}
}{\sNode{
\Figures{
\subfigure[]{\includegraphics[scale=0.36]{resources/Gold.PNG}}
\subfigure[]{\includegraphics[scale=0.1]{resources/home.png}}
}
}
}
\section{Including Graphics}
\SingleFrame{Including Graphics}{
Graphics environment is based on mini page. You can include as many figures as you can. \\
\alert{$\backslash$Figures\{List of graphics as Subfigures Here\}} \\
For example, the two pictures on previous slide were added as: \\
 \gNode{\alert{$\backslash$Figures\{ \\
    $\backslash$subfigure[]\{$\backslash$includegraphics[scale=0.36]\{resources/Gold.PNG\}\} \\
    $\backslash$subfigure[]\{$\backslash$includegraphics[scale=0.1]\{resources/home.png\}\} \\
    \}} }
\rNode{{\bf \large \alert{This Package is Flexible}} \\
    You can use all defined \LaTeX environments inside frames.}
}
\section{Progress Bar}
\DoubleFrame{Progress Bar}{
\rNode{} \gNode{}
    \kNode{The progress bar in footline shows slide number. You can see that title also changes color when slides progress. \alert{$\backslash$sNode\{Text\}} changes text color slide to slide unless specified otherwise.}
}
{
    \sNode{Progress bar also shows stopwatch over a predefined presentation time by setting \alert{$\backslash$pgfmathsetmacro\{$\backslash$TotalTime\}\{Minutes\}} in permeable of document. Time is shown only in Adobe Reader. The package \alert{tdclock} from CTAN is used to fetch system time in document.}
}
'@

$end=@'
%-----------------------------------------------------------------------
% PRESENTATION SLIDE FINAL
%-----------------------------------------------------------------------
{
    \usebackgroundtemplate{\begin{tikzpicture}
        \node[align=center,opacity=0.7]{ \includegraphics[width=0.55\paperwidth]{resources/ud.png}};
        \end{tikzpicture}}
    \begin{frame}[plain,noframenumbering]
    \vfill \hfill
        \begin{tikzpicture}
        \draw[] node[align=center, text width=0.4\textwidth,inner sep=10pt,opacity=0.6] {{\color{blue!70!green} \bf \LARGE THANKS } \\ \qquad \\
    \href{https://github.com/massgh/Beamer-Timer/tree/master/}{\bf \color{blue!80!black}Beamer-Timer@Github} \\ \qquad \\
    \href{https://github.com/massgh/Vasp2Visual/tree/master/}{\bf \color{blue!80!black}Vasp2Visual@Github}
    };
    \end{tikzpicture}
    \end{frame}
    }
\end{document}
'@

if($Blank.IsPresent){
$FileContent=@"
$start
$end
"@
}elseif($Template.IsPresent){
$FileContent=@"
$start
$middle
$end
"@
}else{
    Write-Host "Use [-Blank] or [-Template] switch with command [New-Presentation]" -ForegroundColor Yellow
break;}
Copy-Item $PSScriptRoot/Presentation -Recurse -Destination .
$loc = Get-Location
$destdir = Join-Path -Path $loc -ChildPath "Presentation"
Set-Location $destdir
$FileContent|Set-Content ./main.tex -Force
Write-Host "Open [main.tex] or [Reveal-Markdown/reveal.md] to get LATEX or HTML presntations respectively.
[reveal.md] will only work if you have installed an extension https://github.com/evilz/vscode-reveal on VSCode."
 -ForegroundColor Green
}
Export-ModuleMember -Function "New-Presentation"