-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathaux2slides.pl
43 lines (42 loc) · 909 Bytes
/
aux2slides.pl
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
use open IO => ":encoding(UTF-8)";
while(<>)
{
s/Lam\\IeC \{\\'e\}/Lamé/g;
s/(\$[^\$]+\$)/---zzz---/;
my $math = $1;
if (m/writefile\{toc\}.*contentsline\s*\{([a-z]+).*numberline\s*\{([^}]+)\}([^}]+)/u)
{
# print STDERR "Found $1 $2: $3\n";
my $t = $3;
if ($1 eq 'chapter')
{
if ($3 eq 'Appendix')
{
print"\\appendix\n";
}
else
{
$t =~ s/---zzz---/$math/;
print "\\section{$t}\n\\frame[shrink]{\\sectoc}\n";
}
next;
}
if ($1 eq 'section')
{
$t =~ s/---zzz---/$math/;
print "\\subsection{$t}\n\\frame[shrink]{\\subtoc}\n";
next;
}
if ($1 eq 'subsection')
{
$t =~ s/---zzz---/$math/;
print "\\subsubsection{$t}\n\\frame[shrink]{\\subsubtoc}\n";
next;
}
}
if (m/newlabel\{([[:upper:]][[:lower:]]+):([\w-]+)\}/)
{
# print STDERR "Found $1 $2\n";
print "\\frame{\\input{blocks/$1-$2}}\n";
}
}