From b68e15a811359f8c7ab6f239cd5e8bf36e854f0e Mon Sep 17 00:00:00 2001
From: Ian Jauslin <ian.jauslin@roma1.infn.it>
Date: Sun, 7 Jun 2015 15:28:16 +0000
Subject: Initial commit

---
 slidelist.sty | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 slidelist.sty

(limited to 'slidelist.sty')

diff --git a/slidelist.sty b/slidelist.sty
new file mode 100644
index 0000000..e22c410
--- /dev/null
+++ b/slidelist.sty
@@ -0,0 +1,25 @@
+%% open slidelist file
+\AtBeginDocument{
+  \newwrite\slidelist
+  \immediate\openout\slidelist=slidelist.txt
+}
+%% close file
+\AtEndDocument{
+  \immediate\closeout\slidelist
+}
+
+%% redefine \begin{frame}
+\let\oldframe\frame
+% tmp counter
+\newcount\slidecount
+\def\frame{
+  % the actual page number should be 1 less than \thepage
+  \slidecount=\thepage
+  \advance\slidecount by-1
+  % only write if the page number is positive
+  \ifnum\the\slidecount>0
+    \immediate\write\slidelist{\thepage}
+  \fi
+  \oldframe
+} 
+
-- 
cgit v1.2.3-54-g00ecf

