Revert "Add the PDF screenshots to git; I don't know why they weren't added before."
[dcpomatic.git] / doc / manual / pptex.py
1 #!/usr/bin/python
2
3 # Farcical script to remove newlines after
4 # \begin{sidebar} in dblatex' .tex output;
5 #
6 # farcical because I'm sure this can be done
7 # in 1 line of sed, and also because I'm sure
8 # the whole need for this script could be fixed
9 # in the ardour.sty (but I don't know how).
10
11 import sys
12 import os
13 import tempfile
14 import shutil
15
16 f = open(sys.argv[1])
17 t = tempfile.NamedTemporaryFile(delete = False)
18 remove_next = False
19 while 1:
20     l = f.readline()
21     if l == '':
22         break
23
24     if not remove_next:
25         print>>t,l,
26
27     remove_next = False
28
29     if l.strip() == '\\begin{sidebar}':
30         remove_next = True
31
32 f.close()
33 t.close()
34 shutil.move(t.name, sys.argv[1])
35