-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappearance.sty
173 lines (167 loc) · 5.77 KB
/
appearance.sty
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
%%%%%%%%%%%% APPERANCE COMMANDS %%%%%%%%%%%%
%TODO: Should only and uncover have different counters?
%%% INCREMENTAL UNCOVER (Stays) %%%
\NewDocumentCommand{\uncoverstep}{+m}
{%
% Step counter before so that the first \uncoverstep is slide 2
\stepcounter{latexpresents@counter@only}%
% All future slides
\uncover<\value{latexpresents@counter@only}->%
{%
#1
}%
}%
%%% INCREMENTAL ONLY (Goes away) %%%
\NewDocumentCommand{\onlyonce}{+m}
{%
% Just current slide
\only<\value{latexpresents@counter@only}>%
{%
#1
}%
\stepcounter{latexpresents@counter@only}%
% Step counter after so that the first \onlyonce is slide 1
}%
%%%% REPLACE (for one slide) %%%
%\NewDocumentCommand{\replaceonce}{+m +m}
%{%
% % Up to the current slide
% \only<-\value{latexpresents@counter@only}>%
% {%
% #1
% }%
% % Step counter inbetween
% \stepcounter{latexpresents@counter@only}%
% % A new slide
% \only<\value{latexpresents@counter@only}>%
% {%
% #2
% }%
% % Step counter inbetween
% \stepcounter{latexpresents@counter@only}%
% % All future slides
% \only<\value{latexpresents@counter@only}->%
% {%
% #1
% }%
%}%
% I no longer see a need for this duration-based function.
% It requires an additional counter to be initialized in latexpresents/latexpresents.sty:
% \newcounter{latexpresents@counter@onlylast}
%\NewDocumentCommand{\onlyfor}{m +m}
%{%
% \setcounter{latexpresents@counter@onlylast}{\value{latexpresents@counter@only}}
% \addtocounter{latexpresents@counter@onlylast}{#1}
% \addtocounter{latexpresents@counter@onlylast}{-1}
% \only<\value{latexpresents@counter@only}-\value{latexpresents@counter@onlylast}>%
% {%
% #2
% }%
% \addtocounter{latexpresents@counter@only}{#1}%
%}%
%%% INCREMENTAL REVEAL %%%
%%% SLIDE TRANSITIONS %%%
% Require pdfpc > 4.4.0
\definecomplementarykeys{latexpresents}{transition}{nodebug}{debug}%
\NewDocumentCommand{\latexpresents@transition@cmd}{O{}}
{%
\iflatexpresents@debug%
\presetkeys[latexpresents]{transition}{debug=true}{}%
\else%
\presetkeys[latexpresents]{transition}{debug=false}{}%
\fi%
\setkeys[latexpresents]{transition}{#1}%
\ifx\latexpresents@transition@effect\empty%
\transreplace%
\iflatexpresents@transition@debug%
\say{\\ `\detokenize{\\transreplace}\\}%
\fi%
\else%
\ifx\latexpresents@transition@time\empty%
\ifx\latexpresents@transition@angle\empty%
\latexpresents@transition@effect%
\iflatexpresents@transition@debug%
\say{\\ `\latexpresents@transition@effect`\\}%
\fi%
\else%
\latexpresents@transition@effect[direction=\latexpresents@transition@angle]%
\iflatexpresents@transition@debug%
\say{\\ `\latexpresents@transition@effect[direction=\latexpresents@transition@angle]`\\}%
\fi%
\fi%
\else%
\ifx\latexpresents@transition@angle\empty%
\latexpresents@transition@effect[duration=\latexpresents@transition@time]%
\iflatexpresents@transition@debug%
\say{\\ `\latexpresents@transition@effect[duration=\latexpresents@transition@time]`\\}%
\fi%
\else%
\latexpresents@transition@effect[duration=\latexpresents@transition@time,direction=\latexpresents@transition@angle]%
\iflatexpresents@transition@debug%
\say{\\ `\latexpresents@transition@effect[duration=\latexpresents@transition@time,direction=\latexpresents@transition@angle]`\\}%
\fi%
\fi%
\fi%
\fi%
}%
% effect
\def\latexpresents@transition@effect{}%
\NewDocumentCommand{\settransitioneffect}{m}{\def\latexpresents@transition@effect{#1}}%
% duration
\def\latexpresents@transition@time{}%
\NewDocumentCommand{\settransitiontime}{m}{\def\latexpresents@transition@time{#1}}%
% direction
\def\latexpresents@transition@angle{}%
\NewDocumentCommand{\settransitionangle}{m}{\def\latexpresents@transition@angle{#1}}%
% automatic advancement (not really ``transition duration'', despite what Beamer calls it)
\NewDocumentCommand{\autoadvance}{m}{%
\transduration{#1}%
\say{\\***AUTO (#1s)***\\}%
}%
%%% SLIDE TRANSITIONS %%%
%%% UNDERLINE %%%
%From: https://alexwlchan.net/2017/10/latex-underlines/
\def\ULdepth{1.45pt}
\contourlength{0.7pt}
\RenewDocumentCommand{\emph}{+m}%
{%
\uline{\phantom{#1}}%
\llap%
{%
\usebeamercolor{background canvas}
\contour{background canvas.bg}{#1}%
}%
}
\NewDocumentCommand{\copyrighttext}{m}{\usebeamerfont{copyright}\usebeamercolor*{copyright}\textcopyright{}#1 -- THIS DOESN'T WORK?}
%%% MATH-COMPATIBLE COLOURED ALERTS %%%
\NewDocumentCommand{\alertBlue}{m}{{\setBlueAlert{}\alert{#1}}}%
\NewDocumentCommand{\alertGreen}{m}{{\setGreenAlert{}\alert{#1}}}%
\NewDocumentCommand{\alertYellow}{m}{{\setYellowAlert{}\alert{#1}}}%
\NewDocumentCommand{\alertOrange}{m}{{\setOrangeAlert{}\alert{#1}}}%
\NewDocumentCommand{\alertRed}{m}{{\setRedAlert{}\alert{#1}}}%
\NewDocumentCommand{\alertGray}{m}{{\setGrayAlert{}\alert{#1}}}%
\NewDocumentCommand{\setBlueAlert}{}%
{%
\setbeamercolor{alerted text}{fg=BLUE, bg=}%
}%
\NewDocumentCommand{\setGreenAlert}{}%
{%
\setbeamercolor{alerted text}{fg=GREEN, bg=}%
}%
\NewDocumentCommand{\setYellowAlert}{}%
{%
\setbeamercolor{alerted text}{fg=YELLOW, bg=}%
}%
\NewDocumentCommand{\setOrangeAlert}{}%
{%
\setbeamercolor{alerted text}{fg=ORANGE, bg=}%
}%
\NewDocumentCommand{\setRedAlert}{}%
{%
\setbeamercolor{alerted text}{fg=RED, bg=}%
}%
\NewDocumentCommand{\setGrayAlert}{}%
{%
\setbeamercolor{alerted text}{fg=GRAY, bg=}%
}%
%%%%%%%%%%%% END APPERANCE COMMANDS %%%%%%%%%%%%