improved latex2html: added support for A ring and improved performance
This commit is contained in:
+33
-16
@@ -759,23 +759,40 @@ function latex2html($line) {
|
||||
// often used in howpublished for @misc
|
||||
$line = preg_replace('/\\\\url\{(.*)\}/U','<a href="\\1">\\1</a>', $line);
|
||||
|
||||
$chars="abcdefghijklmnopqrstuvwxyz";
|
||||
for($i=0;$i<strlen($chars);$i++) {
|
||||
$letter=$chars[$i];
|
||||
$line = char2html($line,"'",$letter,"acute");
|
||||
$line = char2html($line,"`",$letter,"grave");
|
||||
$line = char2html($line,"~",$letter,"tilde");
|
||||
$line = char2html($line,'"',$letter,"uml");
|
||||
$line = char2html($line,'^',$letter,"circ");
|
||||
}
|
||||
$line = char2html($line,"'",'a',"acute");
|
||||
$line = char2html($line,"'",'e',"acute");
|
||||
$line = char2html($line,"'",'i',"acute");
|
||||
$line = char2html($line,"'",'o',"acute");
|
||||
$line = char2html($line,"'",'u',"acute");
|
||||
$line = char2html($line,"'",'y',"acute");
|
||||
|
||||
$line = char2html($line,'`','a',"grave");
|
||||
$line = char2html($line,'`','e',"grave");
|
||||
$line = char2html($line,'`','i',"grave");
|
||||
$line = char2html($line,'`','o',"grave");
|
||||
$line = char2html($line,'`','u',"grave");
|
||||
|
||||
$line = char2html($line,'~','a',"tilde");
|
||||
$line = char2html($line,'~','n',"tilde");
|
||||
$line = char2html($line,'~','o',"tilde");
|
||||
|
||||
$line = char2html($line,'"','a',"uml");
|
||||
$line = char2html($line,'"','e',"uml");
|
||||
$line = char2html($line,'"','i',"uml");
|
||||
$line = char2html($line,'"','o',"uml");
|
||||
$line = char2html($line,'"','u',"uml");
|
||||
$line = char2html($line,'"','y',"uml");
|
||||
|
||||
$line = char2html($line,'^','a',"circ");
|
||||
$line = char2html($line,'^','e',"circ");
|
||||
$line = char2html($line,'^','i',"circ");
|
||||
$line = char2html($line,'^','o',"circ");
|
||||
$line = char2html($line,'^','u',"circ");
|
||||
|
||||
$line = char2html($line,'.','a',"ring");
|
||||
|
||||
$line = char2html($line,'c','c',"cedil");
|
||||
|
||||
// special things
|
||||
$line = str_replace('\\c{c}','ç', $line);
|
||||
$line = str_replace('\\c{C}','Ç', $line);
|
||||
$line = str_replace('\\cc','ç', $line);
|
||||
$line = str_replace('\\cC','Ç', $line);
|
||||
$line = str_replace('\\c c','ç', $line);
|
||||
$line = str_replace('\\c C','Ç', $line);
|
||||
$line = str_replace('\\ae','æ', $line);
|
||||
$line = str_replace('\\ss','ß', $line);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user