commit 83ecb95c18b73ce77ddd0be87857ad39e1b4e6a7 parent 84c0f4e219a3f1585a7f448b07dc9c587af4764e Author: Antoine Amarilli <a3nm@a3nm.net> Date: Wed, 2 Jul 2014 12:09:12 +0200 nottitlenum,alltoc Diffstat:
shorthand.pl | | | 48 | +++++++++++++++++++++++++++++++++++++++++++----- |
1 file changed, 43 insertions(+), 5 deletions(-)
diff --git a/shorthand.pl b/shorthand.pl @@ -53,32 +53,50 @@ sub reformat() $ll; } -my $header2 = <<END; +my $header2a = <<END; \\AtBeginSection[] { +END +my $header2b = <<END; \\ifnumcomp{\\value{section}}{=}{1}{} { +END +my $header2c = <<END; \\begin{frame}<beamer> \\frametitle{\\mytocname} \\tableofcontents[currentsection] \\end{frame} +END +my $header2d = <<END; } +END +my $header2e = <<END; } END -my $header3 = <<END; +my $header3a = <<END; \\begin{document} +END +my $header3b1 = <<END; \\begin{frame} +END + +my $header3b2 = <<END; +\\begin{frame}[plain,noframenumbering] +END + +my $header3c = <<END; \\titlepage \\end{frame} END - print $header; my $defaultlang = ""; my $toc = 1; +my $nofirsttoc = 1; +my $titlenum = 1; while (<>) { last if /^$/; @@ -89,11 +107,31 @@ while (<>) { $toc = 0; next; } + if (/NOTITLENUM/) { + $titlenum = 0; + next; + } + if (/ALLTOC/) { + $nofirsttoc = 0; + next; + } print; } -print $header2 if $toc; -print $header3; +if ($toc) { + print $header2a; + print $header2b if $nofirsttoc; + print $header2c; + print $header2d if $nofirsttoc; + print $header2e; +} +print $header3a; +if ($titlenum) { + print $header3b1; +} else { + print $header3b2; +} +print $header3c; while (<>) { my $l = $_;