1# $Id: polski.perl,v 1.1 1999/07/12 13:12:32 RRM Exp $ 2# 3# polski.perl for support of polski.sty, similar to polish babel 4# by Ross Moore <ross@mpce.mq.edu.au> 5 6 7package polski; 8 9sub main'polski_translation { 10 local($_) = @_; 11 s/(^|\G|[^\\<]|[^\\](\\\\)+)\/\s*('|`|;SPMlt;|;SPMgt;|\\|-|\/|=|\||[aelxcnoszAELXCNOSZ])/ 12 $1.&get_polski_specials($3)/geom; 13 $_; 14} 15 16sub get_polski_specials { 17 local($char) = @_; 18 if($char=~/[ae]/i) {&main'iso_map($char,'ogon')} 19 elsif($char=~/[lL]/) {&main'iso_map($char,'strok')} 20 elsif($char=~/x/) {&main'iso_map('z','dot')} 21 elsif($char=~/X/) {&main'iso_map('Z','dot')} 22 elsif($char=~/[cnosz]/i) {&main'iso_map($char,'acute')} 23 else{$polski_specials{$char}} 24} 25 26%polski_specials = ( 27 '\'' => "``", 28 "\`" => ",,", 29 ';SPMlt;' => "«", 30 ';SPMgt;' => "»", 31 '\\' => "", 32 '-' => "-", 33 '/' => "", 34 '=' => "-", 35 '|' => "" 36); 37 38 39package main; 40 41if (defined &addto_languages) { &addto_languages('polski') }; 42 43&do_require_extension('latin2'); 44 45sub polski_titles { 46# $toc_title = "Spis rzeczy"; 47 $toc_title = "Spis tre\\'sci"; 48 $lof_title = "Spis rysunk\\'ow"; 49# $lot_title = "Spis tablic"; 50 $lot_title = "Spis tabel"; 51# $idx_title = "Indeks"; 52 $idx_title = "Skorowidz"; 53 $ref_title = "Bibliografia"; 54# $bib_title = "Literatura"; 55 $bib_title = "Spis Literatury"; 56 $abs_title = "Streszczenie"; 57 $app_title = "Dodatek"; 58 $pre_title = "Przedmowa"; 59## $foot_title = ""; 60## $thm_title = ""; 61 $fig_name = "Rysunek"; 62# $tab_name = "Tablica"; 63 $tab_name = "Tabela"; 64## $prf_name = ""; 65 $page_name = "Strona"; 66 # Sectioning-level titles 67 $part_name = "Część"; 68 $chapter_name = "Rozdział"; 69# $section_name = ""; 70# $subsection_name = ""; 71# $subsubsection_name = ""; 72# $paragraph_name = ""; 73 # Misc. strings 74## $child_name = ""; 75## $info_title = ""; 76 $also_name = "Por\\'ownaj także"; 77 $see_name = "Por\\'ownaj"; 78 # names in navigation panels 79## $next_name = ""; 80## $up_name = ""; 81## $prev_name = ""; 82## $group_name = ""; 83 # mail fields 84 $encl_name = "Załącznik"; 85 $headto_name = "Do"; 86# $cc_name = "Kopie:"; 87 $cc_name = "Do wiadomo\\'sci:"; 88 89 @Month = ('', 'stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 90 'sierpnia', "września", "października", 'listopada', 'grudnia'); 91 92# $GENERIC_WORDS = ""; 93} 94 95 96sub polski_today { 97 local($today) = &get_date(); 98 $today =~ s|(\d+)/0?(\d+)/|$2. $Month[$1] |; 99 join('',$today, ' roku', $_[0]); 100} 101 102sub do_cmd_Slash { '/'.$_[0] } 103sub do_cmd_PLSlash { 104 local($_) = @_; 105 s/^\s*('|`|;SPMlt;|;SPMgt;|\\|-|\/|=|\||[aelxcnoszAELXCNOSZ])/ 106 &get_polski_specials($1)/eos; 107 $_; 108} 109 110sub do_cmd_prefixing { 111 local($_) = @_; 112 my $end_polski; 113 $latex_body .= "\n\\prefixing\n"; 114 s/^(.*?)(\\nonprefixing|$)/$end_polski=$2; 115 &polski_translation($1).$end_polski/es; 116 $_; 117} 118 119sub do_cmd_nonprefixing { $latex_body .= "\n\\nonprefixing\n"; $_[0]} 120 121 122# redefined math-commands, in case math.pl has been loaded 123 124sub do_math_cmd_ar { 125 local($_) = @_; my $arg; 126 my $arg = &get_next_token(); 127 if ($NO_SIMPLE_MATH) { " ar$arg".$_ } 128 else {"(<T CLASS=\"FUNCTION\">ar$arg</T>$_"} 129} 130 131sub do_math_cmd_arc { 132 local($_) = @_; my $arg; 133 my $arg = &get_next_token(); 134 if ($NO_SIMPLE_MATH) { " arc$arg".$_ } 135 else {"(<T CLASS=\"FUNCTION\">arc$arg</T>$_"} 136} 137 138sub do_math_cmd_tg { 139 if ($NO_SIMPLE_MATH) { ' tg'.$_ } 140 else {'<T CLASS="FUNCTION">tg</T>'.$_[0]} 141} 142sub do_math_cmd_ctg { 143 if ($NO_SIMPLE_MATH) { ' ctg'.$_[0] } 144 else {'<T CLASS="FUNCTION">ctg</T>'.$_[0]} 145} 146sub do_math_cmd_tgh { 147 if ($NO_SIMPLE_MATH) { ' tgh'.$_[0] } 148 else {'<T CLASS="FUNCTION">tgh</T>'.$_[0]} 149} 150sub do_math_cmd_ctgh { 151 if ($NO_SIMPLE_MATH) { ' ctgh'.$_ } 152 else {'<T CLASS="FUNCTION">ctgh</T>'.$_[0]} 153} 154 155sub do_math_cmd_tan { &do_math_cmd_tg(@_) } 156sub do_math_cmd_tanh{ &do_math_cmd_tgh(@_)} 157sub do_math_cmd_arcsin { &do_math_cmd_arc('<<0>>sin<<0>>').$_[0] } 158sub do_math_cmd_arccos { &do_math_cmd_arc('<<0>>cos<<0>>').$_[0] } 159sub do_math_cmd_arctan { &do_math_cmd_arc('<<0>>tg<<0>>' ).$_[0] } 160sub do_math_cmd_arcctan{ &do_math_cmd_arc('<<0>>ctg<<0>>').$_[0] } 161 162 163 164&process_commands_wrap_deferred( <<_RAW_ARG_CMDS_); 165#prefixing 166#nonprefixing 167_RAW_ARG_CMDS_ 168 169 170# use'em 171&polski_titles; 172$default_language = 'polski'; 173$TITLES_LANGUAGE = 'polski'; 174$polski_encoding = 'iso-8859-2'; 175 176# $Log: polski.perl,v $ 177# Revision 1.1 1999/07/12 13:12:32 RRM 178# implements polski.sty for Polish language support 179# 180# -- similar to polish.perl (based on Babel) 181# -- uses / instead of " for special accents... 182# -- ...between \prefixing and \nonprefixing or till end of document 183# -- also implements \Slash and \PLSlash 184# -- implements the Polish style of trig-function names 185# 186# 187 1881; 189