/usr/bin/impressive-gettransitions is in impressive 0.12.0-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/usr/bin/perl -w
my $usage = q {
Use: gettransitions talk.tex
talk.tex should be a LaTeX file using the beamer documentclass.
The transitions commented immediately after each \\begin{frame} or
\\pause will be put into talk.pdf.info.
};
my $texf = $ARGV[0];
if($texf !~ /\.tex$/){
print $usage;
exit(1);
}
my $infof = $texf;
$infof =~ s/\.tex$/.pdf.info/;
# 06/10/2007: "Pino" (Giseppe Vallone) pointed out that this script should
# *update* $infof, not just write over it if it already exists. The highlight
# box info is stored there, and keyjnote's behavior is to merge.
my $info = '';
my $inPageProps = 0;
my %PageProps = ();
my $slidenum = 0;
if(-f $infof){
open(INFO, "$infof") or die
"$infof exists, but opening it for reading produced error $!";
while(<INFO>){
my $line = $_;
if($line =~ /^PageProps\s*=\s*{/){
$inPageProps = 1;
}
elsif($inPageProps == 1){
if($line =~ /^\s*(\d+):?\s*{/){
$slidenum = $1;
$inPageProps = 2;
}
elsif($line =~ /^\s*}/){
$inPageProps = 0;
}
}
elsif($inPageProps == 2){
if($line =~ /^\s*}/){
$inPageProps = 1;
}
else{
$PageProps{$slidenum} .= $line;
}
}
else{
$info .= $line;
}
}
close(INFO) or die "Error $! closing $infof after reading.";
}
else{
$info = "# -*- coding: iso-8859-1 -*-\n";
}
# At this stage $info includes any preexisting info *except* page properties,
# which have been moved into %PageProps.
# Find page transitions in the .tex file.
$slidenum = 0;
while(<>){
my $tline = $_;
chomp $tline;
if($tline =~ /^[^%]*\\(begin{frame}|pause)/ || $tline =~ "%O"){
++$slidenum;
print "$slidenum: $tline\n";
if($tline =~ /%O?\s*([A-Z]\w+)/){
my $transition = $1;
if($PageProps{$slidenum} =~ /^\s*'transition':/){
$PageProps{$slidenum} =~ s/(^\s*'transition':\s*)\w+/$1$transition/;
}
else{
$PageProps{$slidenum} .= " 'transition': $transition\n";
}
}
}
}
open(INFO, "> $infof") or die "could not open $infof for writing";
print INFO $info; # Everything but %PageProps.
print INFO "PageProps = {\n"; # Open up PageProps.
foreach my $k (sort {$a <=> $b} keys %PageProps){
printf INFO "% 3s: {\n", $k; # slidenum
print INFO "$PageProps{$k} },\n";
}
print INFO "}\n";
close(INFO) or die "error closing > $infof";
|