Changeset 32129
- Timestamp:
- 2018-02-13T10:38:29+13:00 (6 years ago)
- Location:
- main/trunk/greenstone2/perllib/plugins
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/BibTexPlugin.pm
r32122 r32129 704 704 705 705 # remove {} around a single character (eg \'{e}) 706 $text =~ s@(\\[`'="^~\.]) {(\w)}@{$1$2}@g; #`706 $text =~ s@(\\[`'="^~\.])\{(\w)}@{$1$2}@g; #` 707 707 708 708 # \, is another way of doing cedilla \c … … 711 711 # remove {} around a single character for special 1 letter commands - 712 712 # need to insert a space. Eg \v{s} -> {\v s} 713 $text =~ s@(\\[uvcH]) {(\w)}@{$1 $2}@g;713 $text =~ s@(\\[uvcH])\{(\w)}@{$1 $2}@g; 714 714 715 715 # only do if the text contains a '\' character. -
main/trunk/greenstone2/perllib/plugins/LaTeXPlugin.pm
r32122 r32129 369 369 $text =~ s~\\(?:clearemptydoublepage|newpage)~~g; 370 370 ### counters, contents, environments, labels, etc ### 371 $text =~ s~\\(?:addcontentsline) {.*?}\{.*?}\{.*}~~g;371 $text =~ s~\\(?:addcontentsline)\{.*?}\{.*?}\{.*}~~g; 372 372 $text =~ s~\s*\\begin\{itemize}\s*~\n<ul>\n~g; 373 373 $text =~ s~\s*\\end\{itemize}\s*~</li></ul>\n~g; … … 378 378 $text =~ s~<([ou])l>\s*</li>\s*~<$1l>~g; 379 379 } 380 $text =~ s~\\(?:label|begin|end) {.*?}\s*\n?~ ~g; # remove tag and contents380 $text =~ s~\\(?:label|begin|end)\{.*?}\s*\n?~ ~g; # remove tag and contents 381 381 $text =~ s~\\(?:tableofcontents|listoffigures)~ ~g; 382 382 ### font sizes/styles ### … … 689 689 690 690 # remove {} around a single character (eg \'{e}) 691 $text =~ s!(\\[`'="^~\.]) {(\w)}!{$1$2}!g; # for emacs indenting... `]);691 $text =~ s!(\\[`'="^~\.])\{(\w)}!{$1$2}!g; # for emacs indenting... `]); 692 692 693 693 ## only in bibtex... not in latex proper?! … … 697 697 # remove {} around a single character for special 1 letter commands - 698 698 # need to insert a space. Eg \v{s} -> {\v s} 699 $text =~ s~(\\[uvcH]) {(\w)}~{$1 $2}~g;699 $text =~ s~(\\[uvcH])\{(\w)}~{$1 $2}~g; 700 700 701 701 # only do if the text contains a '\' character. -
main/trunk/greenstone2/perllib/plugins/MediaWikiPlugin.pm
r31780 r32129 278 278 while(my $line = <INPUT>){ 279 279 # comment out the body element because we change the body to div 280 $line =~ s/^(\s*)body(\s*) {(\s*)$/$1\/*body$2*\/{$3/isg;280 $line =~ s/^(\s*)body(\s*)\{(\s*)$/$1\/*body$2*\/{$3/isg; 281 281 282 282 if($line =~ m/^(.+)\{/i || $line =~ m/^(\s)*#/i){ … … 504 504 my $update_extra_dm = 0; 505 505 506 if( $about_package =~ /\S/ && $about_package =~ m/_content_(\s*) {/ && $about_package =~ m/$mainpage_toc/){506 if( $about_package =~ /\S/ && $about_package =~ m/_content_(\s*)\{/ && $about_package =~ m/$mainpage_toc/){ 507 507 print $outhandle "_content_ macro already changed!!!!\n"; 508 508 } … … 527 527 # check if there is a content macro 528 528 my $content_macro_existed = 0; 529 $content_macro_existed = ($about_package =~ /(\s*|\n)_content_(\s*) {/);529 $content_macro_existed = ($about_package =~ /(\s*|\n)_content_(\s*)\{/); 530 530 531 531 # if there is one 532 532 # append a new section div for toc to the end of the document section 533 533 if($content_macro_existed ==1) { 534 $about_package =~ /(\s*|\n)_content_(\s*) {(.|\n)*?}/;534 $about_package =~ /(\s*|\n)_content_(\s*)\{(.|\n)*?}/; 535 535 my $content_macro = $&; 536 536 my $new_content_macro = $content_macro;
Note:
See TracChangeset
for help on using the changeset viewer.