Debian Codegraph @

texmf-dist/tex/latex/beamer/beamerbasetoc.sty

raw
1 % Copyright 2003-2007 by Till Tantau
2 % Copyright 2010 by Vedran Mileti\'c
3 % Copyright 2012,2013,2015 by Vedran Mileti\'c, Joseph Wright
4 % Copyright 2017,2018 by Louis Stuart, Joseph Wright
5 % Copyright 2021-2026 by Joseph Wright, samcarter
6 %
7 % This file may be distributed and/or modified
8 %
9 % 1. under the LaTeX Project Public License and/or
10 % 2. under the GNU Public License.
11 %
12 % See the file LICENSE.md for more details.
13
14 \mode
15 <presentation>
16
17 %
18 % Local counters/ifs/dimensions
19 %
20 \newif\ifbeamer@pausesections
21 \newif\ifbeamer@pausesubsections
22
23 %
24 %
25 % Table of Contents Format
26 %
27 %
28
29 \def\beamer@toc@sectionstyle#1{\beamer@toc@process\beamer@toc@cs\beamer@toc@os#1//}
30 \def\beamer@toc@subsectionstyle#1{\beamer@toc@sprocess\beamer@toc@css\beamer@toc@oss\beamer@toc@ooss#1///}
31 \def\beamer@toc@subsubsectionstyle#1{\beamer@toc@ssprocess\beamer@toc@csss\beamer@toc@osss\beamer@toc@oosss\beamer@toc@ooosss#1////}
32
33 \define@key{beamertoc}{sectionstyle}{\beamer@toc@sectionstyle{#1}}
34 \define@key{beamertoc}{subsectionstyle}{\beamer@toc@subsectionstyle{#1}}
35 \define@key{beamertoc}{subsubsectionstyle}{\beamer@toc@subsubsectionstyle{#1}}
36 \def\beamer@toc@process#1#2#3/#4/{%
37 \ifblank{#4}{\def#1{#3}\def#2{#3}}{\def#1{#3}\def#2{#4}\@gobble}}
38
39 \def\beamer@toc@sprocess#1#2#3#4/#5/#6/{%
40 \ifblank{#5}%
41 {\def#1{#4}\def#2{#4}\def#3{#4}}
42 {\ifblank{#6}
43 {\def#1{#4}\def#2{#5}\def#3{#5}\@gobble}
44 {\def#1{#4}\def#2{#5}\def#3{#6}\@gobbletwo}}}
45
46 \def\beamer@toc@ssprocess#1#2#3#4#5/#6/#7/#8/{%
47 \ifblank{#6}%
48 {\def#1{#5}\def#2{#5}\def#3{#5}\def#4{#5}}
49 {\ifblank{#7}
50 {\def#1{#5}\def#2{#6}\def#3{#6}\def#4{#6}\@gobble}
51 {\ifblank{#8}
52 {\def#1{#5}\def#2{#6}\def#3{#7}\def#4{#7}\@gobbletwo}
53 {\def#1{#5}\def#2{#6}\def#3{#7}\def#4{#8}\expandafter\@gobble\@gobbletwo}}}% no gobblethree?
54 }
55
56 \define@key{beamertoc}{pausesections}[true]{\beamer@pausesectionstrue}
57 \define@key{beamertoc}{pausesubsections}[true]{\beamer@pausesubsectionstrue}
58
59 \define@key{beamertoc}{currentsection}[]{\beamer@toc@sectionstyle{show/shaded}\beamer@toc@subsectionstyle{show/show/shaded}\beamer@toc@subsubsectionstyle{show/show/shaded}}
60 \define@key{beamertoc}{currentsubsection}[]{\beamer@toc@subsectionstyle{show/shaded}\beamer@toc@subsubsectionstyle{show/shaded}}
61 \define@key{beamertoc}{hideallsubsections}[]{\beamer@toc@subsectionstyle{hide}\beamer@toc@subsubsectionstyle{hide}}
62 \define@key{beamertoc}{hideothersubsections}[]{\beamer@toc@subsectionstyle{show/show/hide}\beamer@toc@subsubsectionstyle{show/shaded/hide}}
63
64 \define@key{beamertoc}{part}{\beamer@showpartnumber=#1\relax}
65 \define@key{beamertoc}{sections}{\beamer@parsetocsections#1[]}
66 \define@key{beamertoc}{firstsection}{\beamer@sectionadjust=-#1\relax\advance\beamer@sectionadjust by 1\relax}
67 \define@key{beamertoc}{lastsection}{\beamer@toclastsection=#1}
68 \def\beamer@parsetocsections{\@ifnextchar<\beamer@@parsetocsections\beamer@@@parsetocsections}
69 \def\beamer@@parsetocsections#1[]{\def\beamer@tocsections{#1}}
70 \def\beamer@@@parsetocsections#1[]{\def\beamer@tocsections{<all:#1>}}
71
72 \def\tableofcontents{\@ifnextchar[{\beamer@tableofcontents}{\beamer@tableofcontents[]}}
73 \def\beamer@tableofcontents[#1]{%
74 \def\beamer@toc@cs{show}%
75 \def\beamer@toc@os{show}%
76 \def\beamer@toc@css{show}%
77 \def\beamer@toc@oss{show}%
78 \def\beamer@toc@ooss{show}%
79 \def\beamer@toc@csss{show}%
80 \def\beamer@toc@osss{show}%
81 \def\beamer@toc@oosss{show}%
82 \def\beamer@toc@ooosss{show}%
83 \beamer@showpartnumber=\c@part%
84 \beamer@pausesectionsfalse%
85 \beamer@pausesubsectionsfalse%
86 \def\beamer@tocsections{<*>}%
87 \setkeys{beamertoc}{firstsection=1}%
88 \setkeys{beamertoc}{#1}%
89 \vspace*{-.5em}{\makeatletter%
90 \pause[0]%
91 \@input{\jobname.toc}%
92 \vfill}%
93 }
94
95 \def\beamer@tocaction@show#1{\usebeamertemplate**{#1}}
96 \def\beamer@tocaction@shaded#1{\usebeamertemplate**{#1 shaded}}
97 \def\beamer@tocaction@hide#1{}
98
99 \def\beamer@tocact#1#2{\csname beamer@tocaction@#1\endcsname{#2}}
100
101 \def\beamer@tocifnothide#1{\csname beamer@tocinvcheck@#1\endcsname}
102 \let\beamer@tocinvcheck@hide\@gobble
103 \let\beamer@tocinvcheck@show\@firstofone
104 \let\beamer@tocinvcheck@shaded\@firstofone
105
106 \def\beamer@hidetext{hide}
107
108 % initialize count with something large
109 \beamer@toclastsection=\maxdimen
110 \multiply\beamer@toclastsection by 2
111
112 \def\sectionintoc{}
113 \def\beamer@sectionintoc#1#2#3#4#5{%
114 \ifnum\c@tocdepth>0%
115 \ifnum#4=\beamer@showpartnumber%
116 {
117 \beamer@saveanother%
118 \gdef\beamer@todo{}%
119 \beamer@slideinframe=#1\relax%
120 \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
121 \beamer@tempcount=#5\relax%
122 \advance\beamer@tempcount by\beamer@sectionadjust%
123 \ifnum\beamer@tempcount>0
124 \ifnum\beamer@tempcount>\beamer@toclastsection
125 \def\inserttocsectionnumber{}%
126 \else
127 \edef\inserttocsectionnumber{\the\beamer@tempcount}%
128 \fi
129 \else
130 \def\inserttocsectionnumber{}%
131 \fi%
132 \def\inserttocsection{\hyperlink{Navigation#3}{#2}}%
133 \beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@cs\else\beamer@toc@os\fi}%
134 {%
135 \ifbeamer@pausesections\pause\fi%
136 \ifx\beamer@toc@ooss\beamer@hidetext
137 \vskip1.5em
138 \else
139 \vfill
140 \fi
141 {%
142 \hbox{\vbox{%
143 \def\beamer@breakhere{\\}%
144 \beamer@tocact{\ifnum\c@section=#1\beamer@toc@cs\else\beamer@toc@os\fi}{section in toc}}}%
145 \par%
146 }%
147 }%
148 }%
149 }%
150 \beamer@restoreanother%
151 }
152 \beamer@todo%
153 \fi\fi%
154 }
155
156 \def\subsectionintoc{}
157 \long\def\beamer@subsectionintoc#1#2#3#4#5#6{%
158 \ifnum\c@tocdepth>1%
159 \ifnum#5=\beamer@showpartnumber%
160 {%
161 \beamer@saveanother%
162 \gdef\beamer@todo{}%
163 \beamer@slideinframe=#1\relax%
164 \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
165 \ifbeamer@pausesubsections\pause\fi%
166 \beamer@tempcount=#6%
167 \advance\beamer@tempcount by\beamer@sectionadjust%
168 \edef\inserttocsectionnumber{\the\beamer@tempcount}%
169 \def\inserttocsubsectionnumber{#2}%
170 \def\inserttocsubsection{\hyperlink{Navigation#4}{#3}}%
171 \beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@css\else\beamer@toc@oss\fi}%
172 {%
173 \def\beamer@breakhere{\\}%
174 \beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\beamer@toc@css\else\beamer@toc@oss\fi\else\beamer@toc@ooss\fi}
175 {subsection in toc}%
176 }%
177 }}%
178 \beamer@restoreanother%
179 }%
180 \beamer@todo%
181 \fi\fi%
182 }
183
184 \def\subsubsectionintoc{}
185 \long\def\beamer@subsubsectionintoc#1#2#3#4#5#6#7{%
186 \ifnum\c@tocdepth>2%
187 \ifnum#6=\beamer@showpartnumber%
188 {
189 \beamer@saveanother%
190 \gdef\beamer@todo{}%
191 \beamer@slideinframe=#1\relax%
192 \expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
193 \ifbeamer@pausesubsections\pause\fi%
194 \beamer@tempcount=#7%
195 \advance\beamer@tempcount by\beamer@sectionadjust%
196 \edef\inserttocsectionnumber{\the\beamer@tempcount}%
197 \def\inserttocsubsectionnumber{#2}%
198 \def\inserttocsubsubsectionnumber{#3}%
199 \def\inserttocsubsubsection{\hyperlink{Navigation#5}{#4}}%
200 \beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@csss\else\beamer@toc@osss\fi}%
201 {%
202 \def\beamer@breakhere{\\}%
203 \beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\ifnum\c@subsubsection=#3\beamer@toc@csss\else\beamer@toc@osss\fi\else\beamer@toc@oosss\fi\else\beamer@toc@ooosss\fi}
204 {subsubsection in toc}%
205 }%
206 }}%
207 \beamer@restoreanother%
208 }
209 \beamer@todo%
210 \fi\fi%
211 }
212
213 \mode
214 <article>
215 {
216 \long\def\beamer@sectionintoc#1#2#3#4#5{}
217 \long\def\beamer@subsectionintoc#1#2#3#4#5#6{}
218 \long\def\beamer@subsubsectionintoc#1#2#3#4#5#6#7{}
219 \AtBeginDocument{
220 \let\beamer@origtableofcontents=\tableofcontents
221 \renewcommand{\tableofcontents}[1][]{\beamer@origtableofcontents}
222 }
223 }
224
225
226 \mode
227 <all>