Changeset 3156


Ignore:
Timestamp:
2002-06-18T14:01:26+12:00 (22 years ago)
Author:
jrm21
Message:

Added a few extra accented characters, and recognise some bibtex-specific macros.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/BibTexPlug.pm

    r3142 r3156  
    249249        use utf8;
    250250        if ($fullname =~ /\w+, \w+/) {
    251            $doc_obj->add_utf8_metadata ($cursection, "Author", $fullname);
     251            $doc_obj->add_utf8_metadata ($cursection, "Author", $fullname);
     252        } else {
    252253        }
    253254        }
     
    458459#      ',s' => chr(0xc5).chr(0xa1),
    459460#      ',S' => chr(0xc5).chr(0xa5),
    460      # breve
    461461     # double acute
    462462     # ring
     
    493493    my %special_utf8_chars =
    494494    (
     495     # breve
     496     'u g' => chr(0xc4).chr(0x9f),
     497     'u G' => chr(0xc4).chr(0x9e),
     498     'u i' => chr(0xc4).chr(0xad),
     499     'u I' => chr(0xc4).chr(0xac),
     500     'u o' => chr(0xc5).chr(0x8f),
     501     'u O' => chr(0xc5).chr(0x8e),
     502     'u u' => chr(0xc5).chr(0xad),
     503     'u U' => chr(0xc5).chr(0xac),
    495504     # caron
     505     'v c' => chr(0xc4).chr(0x8d),
     506     'v C' => chr(0xc4).chr(0x8c),
    496507     'v n' => chr(0xc5).chr(0x88),
    497508     'v N' => chr(0xc5).chr(0x87),
    498509     'v s' => chr(0xc5).chr(0xa1),
    499510     'v S' => chr(0xc5).chr(0xa5),
     511     'v z' => chr(0xc5).chr(0xbe),
     512     'v Z' => chr(0xc5).chr(0xbd),
    500513     # cedilla
    501514     'c c' => chr(0xc3).chr(0xa7),
     
    543556
    544557    # remove {} around a single character (eg \'{e})
    545     $text =~ s@(\\[`'="\.]){(\w)}@$1$2@g;
     558    $text =~ s@(\\[`'="\.]){(\w)}@{$1$2}@g;
    546559
    547560    # remove {} around a single character for special 1 letter commands -
    548561    # need to insert a space. Eg \v{s}  ->  {\v s}
    549     $text =~ s@(\\[vcH]){(\w)}@{$1 $2}@;
    550 
     562    $text =~ s@(\\[uvcH]){(\w)}@{$1 $2}@g;
    551563    # this is slow (go through whole hash for each substitution!) so
    552564    # only do if the text contains a '\' character.
     
    563575    }
    564576    # remove latex commands
    565     $text =~ s@\\noopsort{[^}]+\}@@g;
    566     $text =~ s@\\\w+{([^}]*)}@$1@g; # all other commands
     577    # commands with optional arguments...
     578    $text =~ s@\\\w+(\[.*?\])?\s*@@g;
     579    # $text =~ s@\\noopsort{[^}]+\}@@g;
     580    # $text =~ s@\\\w+{(([^}]*[^\\])*)}@$1@g; # all other commands
    567581   
    568582    # remove latex groupings { } (but not \{ or \} )
Note: See TracChangeset for help on using the changeset viewer.