| 1 |
# Remove parts of code enclosed in %latex/%endlatex tags |
| 2 |
|
| 3 |
$latexonly = 0; |
| 4 |
|
| 5 |
while(<>) |
| 6 |
{ |
| 7 |
$latexonly = 1 if /^%latex/i; |
| 8 |
$latexonly = 0 if /^%endlatex/i; |
| 9 |
|
| 10 |
|
| 11 |
if($latexonly) { |
| 12 |
if(/^%!(.*)/) |
| 13 |
{ |
| 14 |
print $1; |
| 15 |
} |
| 16 |
} |
| 17 |
else { |
| 18 |
print; |
| 19 |
} |
| 20 |
} |