summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/beamer-contrib/beamerappendixnote/beamerappendixnote.dtx
blob: 05445b6b65ee347e6c71e75f7b539e66ccf0bfdf (plain)
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
% \iffalse meta-comment
%
% Copyright (C) 2020 Christoph Semken <christoph.ban@semken.info>
% -------------------------------------------------------
% 
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
%    http://www.latex-project.org/lppl.txt
%
% and version 1.3 or later is part of all distributions of LaTeX 
% version 2005/12/01 or later.
%
% \fi
%
% \iffalse
%
%
%<*driver>
\ProvidesFile{beamerappendixnote.dtx}
%</driver>
%<package> \ProvidesPackage{beamerappendixnote}
%<*package>
  [2020/05/13 v1.0 initial version]
%</package>
%<*driver>
\documentclass{l3doc}
\usepackage{beamerappendixnote}

\usepackage{listings}
\lstset{
  basicstyle=\ttfamily,
  columns=fullflexible,
  keepspaces=true,
}
\usepackage{graphicx}

\begin{document}

\changes{v1.0}{2020/05/13}{Initial version}

\GetFileInfo{beamerappendixnote.dtx}

\title{The \pkg{beamerappendixnote} package}

\author{Christoph Semken%
 \thanks{E-mail:
   \href{mailto:christoph.ban@semken.info}
     {christoph.ban@semken.info}%
  }%
}

\date{\fileversion\ --- \filedate}

\maketitle

\begin{documentation}

\noindent Beamer appendix note introduces the \cs{beamerappxnote} command, which puts the note's content on a separate beamer frame, shown by the command \cs{printappxnotes}.  It also creates interactive buttons to move back and forth between the two frames:

\lstinputlisting{example-basic.tex}
\includegraphics[page=1,width=.49\linewidth]{example-basic.pdf}
\includegraphics[page=2,width=.49\linewidth]{example-basic.pdf}

\clearpage
\section{Usage}

\begin{function}{\appxnote}
 \begin{syntax}
   \cs{appxnote}\marg{title}\marg{content}
 \end{syntax}
 
 Create a new appendix note.  Inserts a \cs{beamergotobutton} to a frame that contains \marg{content}.  The appendix frame is created using \cs{printappxnotes}.  The button’s text and the title of the appendix frame are both set to \marg{title}.
\end{function}

\begin{function}{\printappxnotes}
 \begin{syntax}
   \cs{printappxnotes}
 \end{syntax}
 
 Prints appendix notes in the order they are created using \cs{appxnote}.  Has to be used after the last appendix note.  Uses one frame per note.  Inserts a \cs{beamerreturnbutton} button to the frame where \cs{appxnote} was called, followed by the content, separated by a \cs{vfill}.  
\end{function}

\end{documentation}


\begin{implementation}
  \section{Implementation}
  \DocInput{beamerappendixnote.dtx}
\end{implementation}


\end{document}
%</driver>
% \fi
% \iffalse
%<*package>
%<@@=ban>
% \fi
%
% \subsection{Dependencies}
%
% Load the essential support (\pkg{expl3}).
%    \begin{macrocode}
\RequirePackage{expl3}
%    \end{macrocode}
%
% Make sure that the version of \pkg{l3kernel} in use is sufficiently new.
%    \begin{macrocode}
\@ifpackagelater {expl3}{2018/04/22} {} {%
  \PackageError {beamerappendixnote} {Support package expl3 too old}
    {%
      You need to update your installation of the bundles 'l3kernel' and
      'l3packages'.\MessageBreak
      Loading~beamerappendixnote~will~abort!%
    }%
  \endinput
}%
%    \end{macrocode}
%
% Identify the package and give the over all version information.
%    \begin{macrocode}
\ProvidesExplPackage {beamerappendixnote} {2020/05/07} {1.0}
  {Create notes in appendix frames}
%    \end{macrocode}
%
% User level interfaces are all created by \pkg{xparse}
%    \begin{macrocode}
\RequirePackage {xparse}
%    \end{macrocode}
%
% \subsection{Data structures}
%
% Initialise sequences used to store notes.
%    \begin{macrocode}
\seq_new:N \g_ban_titles
\seq_new:N \g_ban_content
%    \end{macrocode}
%
% \subsection{Macros}
%
% \begin{macro}{\appxnote}
% Create a new appendix note and insert a link
%    \begin{macrocode}
\NewDocumentCommand{\appxnote}{m m}{
  \seq_gput_right:Nn \g_ban_titles {#1}
  \seq_gput_right:Nn \g_ban_content {#2}
  \hyperlink{ban-\seq_count:N \g_ban_titles}{\beamergotobutton{#1}}%
  \label{ban-back-\seq_count:N \g_ban_titles}
}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\@@_print_func:n}
% Print an appendix note
%    \begin{macrocode}
\cs_set:Npn \print_func:n #1 { 
  \begin{frame}[label=ban-#1]{\seq_item:Nn \g_ban_titles {#1}}
    \hyperlink{ ban-back-#1 }{\beamerreturnbutton{Back}}
    \vfill
    \seq_item:Nn \g_ban_content {#1}
  \end{frame}
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\printappxnotes}
% Print all appendix notes
%    \begin{macrocode}
\NewDocumentCommand{\printappxnotes}{}{
  \int_step_function:nN {\seq_count:N \g_ban_titles} \print_func:n
}
%    \end{macrocode}
% \end{macro}
%
% \iffalse
%</package>
% \fi