Changeset 31780
- Timestamp:
- 2017-07-07T19:19:14+12:00 (7 years ago)
- Location:
- main/trunk/greenstone2/perllib/plugins
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/BibTexPlugin.pm
r31492 r31780 791 791 792 792 # quoted { } chars 793 $text =~ s@\\ {@{@g;793 $text =~ s@\\\{@{@g; 794 794 $text =~ s@\\}@}@g; 795 795 … … 805 805 806 806 $text =~ s@\\infty@infinity@g; # or unicode 0x221E... 807 $text =~ s@\^ {(.*?)}@<sup>$1</sup>@g; # superscript807 $text =~ s@\^\{(.*?)}@<sup>$1</sup>@g; # superscript 808 808 $text =~ s@\^([^\{])@<sup>$1</sup>@g; 809 $text =~ s@\_ {(.*?)}@<sub>$1</sub>@g; # subscript809 $text =~ s@\_\{(.*?)}@<sub>$1</sub>@g; # subscript 810 810 $text =~ s@\_([^\{])@<sub>$1</sub>@g; 811 811 -
main/trunk/greenstone2/perllib/plugins/LaTeXPlugin.pm
r31492 r31780 166 166 167 167 ###### process latex for the main text ###### 168 $$textref =~ s/^.*?\\begin {document}//s;169 $$textref =~ s/\\end {document}.*?$//s;168 $$textref =~ s/^.*?\\begin\{document}//s; 169 $$textref =~ s/\\end\{document}.*?$//s; 170 170 $$textref = $self->process_latex("-html",$$textref); 171 171 $doc_obj->add_utf8_text($cursection, $$textref); … … 318 318 return "<br/>" . $tabbing . "<br/>\n"; 319 319 } 320 $text =~ s@\\begin {tabbing}(.*?)\\end{tabbing}@do_tabbing($1)@ges;320 $text =~ s@\\begin\{tabbing}(.*?)\\end\{tabbing}@do_tabbing($1)@ges; 321 321 sub do_tabular { 322 322 my $tabular=shift; … … 324 324 $tabular =~ s~[\\][\\]\s*~</td></tr>\n <tr><td>~g; 325 325 $tabular =~ s~\\hline~~g; # for now... 326 $tabular =~ s~<td>\s*\\multicolumn {(\d+)}{.*?}~<td colspan="$1">~g;326 $tabular =~ s~<td>\s*\\multicolumn\{(\d+)}\{.*?}~<td colspan="$1">~g; 327 327 return "<table border=\"1\">\n <tr><td>" 328 328 . $tabular . "</td></tr></table>\n"; 329 329 } 330 $text =~ s@\\begin {tabular}(?:\[.*?\])?{.*?}(.*?)\\end{tabular} @330 $text =~ s@\\begin\{tabular}(?:\[.*?\])?{.*?}(.*?)\\end\{tabular} @ 331 331 do_tabular($1) @xges; 332 332 … … 344 344 345 345 # is this an amstext environment, or just custom for that input file? 346 $text =~ s@\\begin {(algorithm)}(.*?)\\end{\1}@remove_equals($2)@ges;346 $text =~ s@\\begin\{(algorithm)}(.*?)\\end\{\1}@remove_equals($2)@ges; 347 347 348 348 # convert latex-style accented characters. … … 369 369 $text =~ s~\\(?:clearemptydoublepage|newpage)~~g; 370 370 ### counters, contents, environments, labels, etc ### 371 $text =~ s~\\(?:addcontentsline){.*?} {.*?}{.*}~~g;372 $text =~ s~\s*\\begin {itemize}\s*~\n<ul>\n~g;373 $text =~ s~\s*\\end {itemize}\s*~</li></ul>\n~g;374 $text =~ s~\s*\\begin {enumerate}\s*~<ol>\n~g;375 $text =~ s~\s*\\end {enumerate}\s*~</li></ol>\n~g;371 $text =~ s~\\(?:addcontentsline){.*?}\{.*?}\{.*}~~g; 372 $text =~ s~\s*\\begin\{itemize}\s*~\n<ul>\n~g; 373 $text =~ s~\s*\\end\{itemize}\s*~</li></ul>\n~g; 374 $text =~ s~\s*\\begin\{enumerate}\s*~<ol>\n~g; 375 $text =~ s~\s*\\end\{enumerate}\s*~</li></ol>\n~g; 376 376 if ($text =~ s~\s*\\item~</li>\n<li>~g) { 377 377 # (count for first list item) … … 388 388 $text =~ s~{\\tt\s*(.*?)}~<tt>$1</tt>~g; 389 389 $text =~ s~\\(?:texttt|tt|ttseries)\s*{(.*?)}~<tt>$1</tt>~g; 390 $text =~ s~\\emph {(.*?)}~<em>$1</em>~g;390 $text =~ s~\\emph\{(.*?)}~<em>$1</em>~g; 391 391 $text =~ s~{\\(?:em|it)\s*(.*?)}~<em>$1</em>~g; 392 392 $text =~ s~{\\(?:bf|bfseries)\s*(.*?)}~<strong>$1</strong>~g; … … 429 429 430 430 # quoted { } chars 431 $text =~ s~\\ {~{~g;431 $text =~ s~\\\{~{~g; 432 432 $text =~ s~\\}~}~g; 433 433 … … 479 479 $text =~ s~\\cup\b~ U ~g; 480 480 481 $text =~ s~\\frac\s*{(.+?)} {(.+?)}~math_fraction($1,$2)~ge;481 $text =~ s~\\frac\s*{(.+?)}\{(.+?)}~math_fraction($1,$2)~ge; 482 482 483 483 if ($html_markup) { 484 $text =~ s~\^ {(.*?)}~<sup>$1</sup>~g; # a^b superscript484 $text =~ s~\^\{(.*?)}~<sup>$1</sup>~g; # a^b superscript 485 485 $text =~ s~\^([^\{])~<sup>$1</sup>~g; 486 $text =~ s~\_ {(.*?)}~<sub>$1</sub>~g; # a_b subscript486 $text =~ s~\_\{(.*?)}~<sub>$1</sub>~g; # a_b subscript 487 487 $text =~ s~\_([^\{])~<sub>$1</sub>~g; 488 488 -
main/trunk/greenstone2/perllib/plugins/MediaWikiPlugin.pm
r28560 r31780 663 663 664 664 # extract the _content_ macro 665 $about_page_content =~ m/_content_ {(.|\n)*<\/div>\n\n<\/div>\n}/i;665 $about_page_content =~ m/_content_ \{(.|\n)*<\/div>\n\n<\/div>\n}/i; 666 666 $about_page_content = $&; 667 667
Note:
See TracChangeset
for help on using the changeset viewer.