Mercurial > hg > mpdl-xml-content
comparison DESpecs/skripte/create_overview_text.pl @ 16:6fa5e8c4e0dd
new version
author | Klaus Thoden <kthoden@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 02 May 2013 11:52:14 +0200 |
parents | 616f0379a3a0 |
children |
comparison
equal
deleted
inserted
replaced
15:616f0379a3a0 | 16:6fa5e8c4e0dd |
---|---|
1 #!/usr/bin/perl -w | 1 #!/usr/bin/perl -w |
2 use strict; | 2 use strict; |
3 use warnings; | 3 use warnings; |
4 | 4 |
5 # | 5 # |
6 # create_overview_text.pl | 6 # create_overview_text2.pl |
7 # | 7 # |
8 # Wolfgang Schmidle, 2008-10-04 | 8 # Wolfgang Schmidle, 2008-10-06 |
9 # | 9 # |
10 | 10 |
11 | 11 |
12 my @datei; | 12 my @datei; |
13 | 13 |
41 next if (/^%/ && !(/%!TEX/)); # remove comment lines, keep the header lines, | 41 next if (/^%/ && !(/%!TEX/)); # remove comment lines, keep the header lines, |
42 s/\.tex/_overview.tex/; # but add _overview to the reference | 42 s/\.tex/_overview.tex/; # but add _overview to the reference |
43 | 43 |
44 next if /^\\vspace/; | 44 next if /^\\vspace/; |
45 next if /^\\tocspace/; | 45 next if /^\\tocspace/; |
46 next if /^\\clearpage/; | |
47 next if /^\\mehrzeilen/; | |
48 | |
49 s/^%overview //; # commands for the overview document | |
50 # that are ignored in the main document | |
46 | 51 |
47 # remove all unwanted enviromnents, e.g. clarification | 52 # remove all unwanted enviromnents, e.g. clarification |
48 if (/\\begin\{(.+?)\}/) | 53 if (/\\begin\{(.+?)\}/) |
49 { | 54 { |
50 if ($unwichtig =~ / $1 /) { $sollweg = 1; } | 55 if ($unwichtig =~ / $1 /) { $sollweg = 1; } |
70 if (/\\section/) | 75 if (/\\section/) |
71 { | 76 { |
72 $_ = $neueDatei[$i+$offset]; | 77 $_ = $neueDatei[$i+$offset]; |
73 if (/^ *$/ || /\\section/) | 78 if (/^ *$/ || /\\section/) |
74 { | 79 { |
75 $neueDatei[$i] =~ s/\{(.+?)\}/\{($1)\}/; | 80 # $neueDatei[$i] =~ s/\{(.+?)\}/\{($1)\}/; |
81 $neueDatei[$i] = "% $neueDatei[$i]"; | |
82 $neueDatei[$i] .= '\refstepcounter{section}'; | |
83 $neueDatei[$i] .= "\n"; | |
76 } | 84 } |
77 } | 85 } |
78 else | 86 else |
79 { | 87 { |
80 if (/\\subsection/) | 88 if (/\\subsection/) |
81 { | 89 { |
82 $_ = $neueDatei[$i+$offset]; | 90 $_ = $neueDatei[$i+$offset]; |
83 if (/^ *$/ || /\\section/ || /\\subsection/) | 91 if (/^ *$/ || /\\section/ || /\\subsection/) |
84 { | 92 { |
85 $neueDatei[$i] =~ s/\{(.+?)\}/\{($1)\}/; | 93 # $neueDatei[$i] =~ s/\{(.+?)\}/\{($1)\}/; |
94 $neueDatei[$i] = "% $neueDatei[$i]"; | |
95 $neueDatei[$i] .= '\refstepcounter{subsection}'; | |
96 $neueDatei[$i] .= "\n"; | |
86 } | 97 } |
87 } | 98 } |
88 else | 99 else |
89 { | 100 { |
90 if (/\\subsubsection/) | 101 if (/\\subsubsection/) |
91 { | 102 { |
92 $_ = $neueDatei[$i+$offset]; | 103 $_ = $neueDatei[$i+$offset]; |
93 if (/^ *$/ || /\\section/ || /\\subsection/ || /\\subsubsection/) | 104 if (/^ *$/ || /\\section/ || /\\subsection/ || /\\subsubsection/) |
94 { | 105 { |
95 $neueDatei[$i] =~ s/\{(.+?)\}/\{($1)\}/; | 106 # $neueDatei[$i] =~ s/\{(.+?)\}/\{($1)\}/; |
107 $neueDatei[$i] = "% $neueDatei[$i]"; | |
108 $neueDatei[$i] .= '\refstepcounter{subsubsection}'; | |
109 $neueDatei[$i] .= "\n"; | |
96 } | 110 } |
97 } | 111 } |
98 } | 112 } |
99 } | 113 } |
100 } | 114 } |