$opt_order{'UniJIS'}='j';
$opt_order{'UniKS'}='k';
-$opt_allow_unify=0; # 1=true, 0=false.
+$opt_allow_unify=1; # 1=true, 0=false.
$opt_protrude=0;# 1=true, 0=false.
# currently does not work.
my $space = '\x{0020}\x{0009}\x{000A}\x{000C}\x{000D}';
+my %tex_meta=('#'=>'\#',
+ '$'=>'\\textdollar{}',
+ '%'=>'\%',
+ '&'=>'\&',
+ '{'=>'\\textbraceleft{}',
+ '}'=>'\\textbraceright{}',
+ '\\'=>'\\textbackslash{}',
+ '_'=>'\\textunderscore',
+ );
+
+my $tex_meta_re=join('|',map {quotemeta($_)} keys %tex_meta);
+
&GetOptions("in=s"=>\$opt_in_cs,
"out=s"=>\$opt_out_cs,
"help",\$opt_help);
$ids_argc=0;
$ids="";
-$geta=pack("U",0x3013);
-#$geta=pack("U",0xfffd);
+#$geta=pack("U",0x3013);
+$geta=pack("U",0xfffd);
@GT=(#"=gt","=gt-k",
"=gt-pj-1","=gt-pj-2","=gt-pj-3","=gt-pj-4","=gt-pj-5",
if($char_id<=0x20){
print $chars[$i];
next CHAR;
+ }elsif($char=~m/($tex_meta_re)/o){
+ print $tex_meta{$1};
+ next CHAR;
}elsif($char_id>0x20 and $char_id<=0x02af){
# Basic Latin
# Latin-1 Supplement
}
$i++;
}
- return '{\normalfont {'.$out_str.'}}';
+ return '{\fontencoding{UT1}\fontfamily{omlgc}\selectfont '.$out_str.'}';
}
sub ids_parse{
# return: TeX macro for ids
# or GETA character if ids is invalid for KAGE.
my($ids)=@_;
- $ids=&normalize_ids($ids,"UniJIS");
+ # $ids=&normalize_ids($ids,"UniJIS");
return $geta if(($ids!~/[$idc]/)
or($ids=~/[\x{10000}-]/));
#irregular for KAGE.