summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/beamerappendixnote/beamerappendixnote.sty
blob: 0fb7d23669ac4b19b076596537f6c4f820c3ae15 (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
%%
%% This is file `beamerappendixnote.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% beamerappendixnote.dtx  (with options: `package')
%% 
%% ----------------------------------------------------------------
%% beamerappendixnote --- insert notes on appendix slides
%% Author:  Christoph Semken
%% E-mail:  christoph.ban@semken.info
%% License: Released under the LaTeX Project Public License v1.3c or later
%% See:     http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%% 
 \ProvidesPackage{beamerappendixnote}
  [2020/07/01 v1.2.0 backposition option]
\RequirePackage{expl3}
\@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
}%
\ProvidesExplPackage {beamerappendixnote} {2020/07/01} {1.2.0}
  {Create notes in appendix frames}
\RequirePackage{xparse}
\RequirePackage{l3keys2e}
\keys_define:nn { beamerappendixnote }
{
  backposition .choices:nn = { top, bottom, title } { },
  backposition .tl_set:N = \g_ban_backposition
}
\keys_set:nn { beamerappendixnote }
{
  backposition = top
}
\ProcessKeysOptions { beamerappendixnote }
\seq_new:N \g_ban_titles
\seq_new:N \g_ban_content
\seq_new:N \g_ban_options
\cs_generate_variant:Nn \tl_if_eq:nnT { V }
\newcommand{\appxnote}[3][t]{
  \seq_gput_right:Nn \g_ban_titles {#2}
  \seq_gput_right:Nn \g_ban_options {#1}
  \seq_gput_right:Nn \g_ban_content {#3}
  \hyperlink{ban-\seq_count:N \g_ban_titles}{\beamergotobutton{#2}}%
  \label{ban-back-\seq_count:N \g_ban_titles}
}
\cs_set:Npn \print_func:nnnnn #1 #2 #3 #4 #5 {
  \def\options{#5}
  \begin{frame}[\expandafter\options]
    {
      \tl_if_eq:VnT \g_ban_backposition { title }
        {
          \hyperlink{#4}{\beamerreturnbutton{Back}}~
        }
      #1
    }
    \label{#3}

    \tl_if_eq:VnT \g_ban_backposition { top }
      {
        \hyperlink{#4}{\beamerreturnbutton{Back}}
        \vfill
      }

    #2
  \end{frame}
}
\cs_set:Npn \expand_func:n #1 {
  \print_func:nnnnn {\seq_item:Nn \g_ban_titles {#1}}
                    {\seq_item:Nn \g_ban_content {#1}}
                    {ban-#1}
                    {ban-back-#1}
                    {\seq_item:Nn \g_ban_options {#1}}
}
\NewDocumentCommand{\printappxnotes}{}{
  \int_step_function:nN {\seq_count:N \g_ban_titles} \expand_func:n
}
\endinput
%%
%% End of file `beamerappendixnote.sty'.