| 1 |
%% |
| 2 |
%% This is file `fixlatvian.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% fixlatvian.dtx (with options: `package') |
| 8 |
%% |
| 9 |
%% Copyright (C) Andrey Vihrov <[email protected]>, 2010-2011 |
| 10 |
%% |
| 11 |
%% This work may be distributed and/or modified under the |
| 12 |
%% conditions of the LaTeX Project Public License, either version 1.3 |
| 13 |
%% of this license or (at your option) any later version. |
| 14 |
%% The latest version of this license is in |
| 15 |
%% |
| 16 |
%% http://www.latex-project.org/lppl.txt |
| 17 |
%% |
| 18 |
%% and version 1.3 or later is part of all distributions of LaTeX |
| 19 |
%% version 2005/12/01 or later. |
| 20 |
%% |
| 21 |
%% This work has the LPPL maintenance status `maintained'. |
| 22 |
%% |
| 23 |
%% See the README for a list of files that constitute this work. |
| 24 |
%% |
| 25 |
\NeedsTeXFormat{LaTeX2e} |
| 26 |
\RequirePackage{svn-prov} |
| 27 |
\ProvidesPackageSVN |
| 28 |
{$Id: fixlatvian.dtx 163 2011-02-05 18:51:11Z andrey.vihrov $} |
| 29 |
[v1a Improved Latvian support] |
| 30 |
\DefineFileInfoSVN\relax |
| 31 |
\RequirePackage{caption} |
| 32 |
\RequirePackage{etoolbox} |
| 33 |
\RequirePackage{perpage} |
| 34 |
\RequirePackage{polyglossia} |
| 35 |
\RequirePackage{xstring} |
| 36 |
\RequirePackage{indentfirst} |
| 37 |
\RequirePackage{icomma} |
| 38 |
\ProcessOptions\relax |
| 39 |
\@ifundefined{latvian@loaded}{\setdefaultlanguage{latvian}}{} |
| 40 |
\frenchspacing |
| 41 |
\newcommand{\FixL@warning}[1]{\PackageWarning{fixlatvian}{#1}} |
| 42 |
\newcommand{\FixL@warning@noline}[1]{% |
| 43 |
\PackageWarningNoLine{fixlatvian}{#1}} |
| 44 |
\newcommand{\FixL@info}[1]{\PackageInfo{fixlatvian}{#1}} |
| 45 |
\newcommand{\FixL@alnum}{% |
| 46 |
ABCDEFGHIJKLMNOPQRSTUVWXYZ% |
| 47 |
abcdefghijklmnopqrstuvwxyz% |
| 48 |
0123456789% |
| 49 |
} |
| 50 |
\newcommand{\FixL@patchfailed}[1]{% |
| 51 |
\FixL@info{Could not change the definition of the \protect #1 command}} |
| 52 |
\newcommand{\FixL@checkbefore}[1]{% |
| 53 |
\expandafter\newif\csname ifFixL@#1@before\endcsname |
| 54 |
\@ifpackageloaded{#1}{\csname FixL@#1@beforetrue\endcsname}{}% |
| 55 |
\AtBeginDocument{% |
| 56 |
\@ifpackageloaded{#1}{% |
| 57 |
\csname ifFixL@#1@before\endcsname\else |
| 58 |
\FixL@warning@noline{This package should be loaded after #1}% |
| 59 |
\fi |
| 60 |
}{}}} |
| 61 |
\FixL@checkbefore{hyperref} |
| 62 |
\FixL@checkbefore{amsthm} |
| 63 |
\newcommand{\FixL@p}{.\@\nobreak} |
| 64 |
\newcommand{\FixL@bigspace}{\hspace{.66667em}} |
| 65 |
\CheckCommand*{\@seccntformat}[1]{\csname the#1\endcsname\quad} |
| 66 |
\renewcommand{\@seccntformat}[1]{% |
| 67 |
\csname the#1\endcsname\FixL@p\FixL@bigspace} |
| 68 |
\let\FixL@old@numberline\numberline |
| 69 |
\renewcommand{\numberline}[1]{% |
| 70 |
\StrRight{#1}{1}[\FixL@tempa]% |
| 71 |
\FixL@old@numberline{#1% |
| 72 |
\IfSubStr{\FixL@alnum}{\FixL@tempa}{\FixL@p}{}% |
| 73 |
}} |
| 74 |
\AtBeginDocument{% |
| 75 |
\let\nref\ref |
| 76 |
\let\npageref\pageref |
| 77 |
} |
| 78 |
\newcommand{\FixL@ref@base}[4]{% |
| 79 |
\begingroup |
| 80 |
\newcommand{\FixL@tempb}{\csname n#1\endcsname #2{#4}\FixL@p}% |
| 81 |
\IfStrEq{#3}{hyper}{\hyperref[#4]{\FixL@tempb}}{\FixL@tempb}% |
| 82 |
\endgroup |
| 83 |
\nobreak % Extra \nobreak |
| 84 |
} |
| 85 |
\AtBeginDocument{% |
| 86 |
\@ifpackageloaded{hyperref}{% |
| 87 |
\newcommand{\FixL@ref}[1]{\FixL@ref@base{ref}{*}{hyper}{#1}}% |
| 88 |
\newcommand{\FixL@ref@star}[1]{\FixL@ref@base{ref}{*}{}{#1}}% |
| 89 |
\renewcommand{\ref}{\@ifstar\FixL@ref@star\FixL@ref}% |
| 90 |
\newcommand{\FixL@pageref}[1]{\FixL@ref@base{pageref}{*}{hyper}{#1}}% |
| 91 |
\newcommand{\FixL@pageref@star}[1]{\FixL@ref@base{pageref}{*}{}{#1}}% |
| 92 |
\renewcommand{\pageref}{\@ifstar\FixL@pageref@star\FixL@pageref}% |
| 93 |
}{% |
| 94 |
\renewcommand{\ref}[1]{\FixL@ref@base{ref}{}{}{#1}}% |
| 95 |
\renewcommand{\pageref}[1]{\FixL@ref@base{pageref}{}{}{#1}}% |
| 96 |
}% |
| 97 |
\robustify{\ref}% |
| 98 |
\robustify{\pageref}% |
| 99 |
} |
| 100 |
\gappto\captionslatvian{% |
| 101 |
\renewcommand{\alsoname}{sk.~arī}% |
| 102 |
\renewcommand{\chaptername}{nodaļa}% |
| 103 |
\renewcommand{\figurename}{att}% |
| 104 |
\renewcommand{\indexname}{Rādītājs}% |
| 105 |
\renewcommand{\partname}{daļa}% |
| 106 |
\renewcommand{\tablename}{tabula}% |
| 107 |
\renewcommand{\seename}{sk.\@}% |
| 108 |
} |
| 109 |
\renewcommand{\@alph}[1]{% |
| 110 |
\ifcase #1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l% |
| 111 |
\or m\or n\or o\or p\or r\or s\or t\or u\or v\or z\else\@ctrerr\fi} |
| 112 |
\renewcommand{\@Alph}[1]{% |
| 113 |
\ifcase #1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L% |
| 114 |
\or M\or N\or O\or P\or R\or S\or T\or U\or V\or Z\else\@ctrerr\fi} |
| 115 |
\@ifundefined{@makechapterhead}{}{% |
| 116 |
\patchcmd{\@makechapterhead}{\@chapapp\space \thechapter}{% |
| 117 |
\IfStrEq{\@chapapp}{\appendixname}{\@chapapp\space\thechapter}{% |
| 118 |
\thechapter\FixL@p\space\@chapapp}% |
| 119 |
}{}{\FixL@patchfailed{\chapter}}% |
| 120 |
} |
| 121 |
\newcommand{\FixL@fix@part}[1]{% |
| 122 |
\@ifundefined{#1}{}{% |
| 123 |
\renewcommand{\thepart}{\arabic{part}}% |
| 124 |
\expandafter\patchcmd\csname #1\endcsname{% |
| 125 |
\partname\nobreakspace\thepart}{\thepart\FixL@p\space\partname}{}{% |
| 126 |
\FixL@patchfailed{\part}}% |
| 127 |
}} |
| 128 |
\AtBeginDocument{\FixL@fix@part{% |
| 129 |
\@ifpackageloaded{hyperref}{H@old@part}{@part}}} |
| 130 |
\patchcmd{\ps@headings}{\@chapapp\ \thechapter}{% |
| 131 |
\thechapter\FixL@p\space\@chapapp}{}{\FixL@patchfailed{\chaptermark}} |
| 132 |
\patchcmd{\ps@headings}{\thesection\quad}{% |
| 133 |
\thesection\FixL@p\FixL@bigspace}{}{\FixL@patchfailed{\sectionmark}} |
| 134 |
\patchcmd{\ps@headings}{\thesubsection\quad}{% |
| 135 |
\thesubsection\FixL@p\FixL@bigspace}{}{% |
| 136 |
\FixL@patchfailed{\subsectionmark}} |
| 137 |
\DeclareCaptionLabelSeparator{period@}{.\@\space} |
| 138 |
\captionsetup{labelsep=period@} |
| 139 |
\DeclareCaptionLabelFormat{latvian}{#2\FixL@p\space #1} |
| 140 |
\captionsetup{labelformat=latvian} |
| 141 |
\newif\ifFixL@amsthm@loaded |
| 142 |
\@ifpackageloaded{amsthm}{\FixL@amsthm@loadedtrue}{} |
| 143 |
\ifFixL@amsthm@loaded |
| 144 |
\swapnumbers |
| 145 |
\newcommand{\FixL@thmnumber}[1]{\@ifempty{#1}{}{#1\FixL@p}} |
| 146 |
\patchcmd{\swappedhead}{\thmnumber}{\FixL@thmnumber}{}{% |
| 147 |
\FixL@patchfailed{\swappedhead}} |
| 148 |
\else |
| 149 |
\patchcmd{\@begintheorem}{#1\ #2}{#2\FixL@p\space #1}{}{% |
| 150 |
\FixL@patchfailed{\@begintheorem}} |
| 151 |
\patchcmd{\@opargbegintheorem}{#1\ #2}{#2\FixL@p\space #1}{}{% |
| 152 |
\FixL@patchfailed{\@opargbegintheorem}} |
| 153 |
\fi |
| 154 |
\MakePerPage{footnote} |
| 155 |
\newcommand{\FixL@inpackage}[2]{% |
| 156 |
\AtBeginDocument{\@ifpackageloaded{#1}{#2}{}}} |
| 157 |
\newcommand{\FixL@translate}[3]{% |
| 158 |
\FixL@inpackage{#1}{% |
| 159 |
\expandafter\renewcommand\csname #2\endcsname{#3}% |
| 160 |
}} |
| 161 |
\FixL@inpackage{float}{\captionsetup[ruled]{labelformat=latvian}} |
| 162 |
\FixL@inpackage{float}{\renewcommand{\floatname}[2]{% |
| 163 |
\expandafter\def\csname #1name\endcsname{#2}}} |
| 164 |
\FixL@translate{algorithm}{listalgorithmname}{Algoritmu saraksts} |
| 165 |
\FixL@inpackage{algorithm}{\floatname{algorithm}{algoritms}} |
| 166 |
\FixL@translate{amsthm}{proofname}{Pierādījums} |
| 167 |
\FixL@translate{appendix}{appendixtocname}{Pielikumi} |
| 168 |
\newcommand{\FixL@doc@glossaryname}{Izmaiņu saraksts} |
| 169 |
\FixL@inpackage{doc}{\GlossaryPrologue{% |
| 170 |
\section*{\FixL@doc@glossaryname}% |
| 171 |
\markboth{\FixL@doc@glossaryname}{\FixL@doc@glossaryname}% |
| 172 |
}} |
| 173 |
\FixL@inpackage{doc}{\IndexPrologue{% |
| 174 |
\section*{\indexname}% |
| 175 |
\markboth{\indexname}{\indexname}% |
| 176 |
Numuri kursīvā apzīmē lappusi, kurā aprakstīta attiecīgā komanda; |
| 177 |
pasvītrotie numuri norāda uz komandas \ifcodeline@index definīcijas |
| 178 |
pirmkoda rindu\else definīciju\fi; numuri parastajā rakstā apzīmē |
| 179 |
\ifcodeline@index pirmkoda rindu\else lappusi\fi, kurā komanda tiek |
| 180 |
izmantota.% |
| 181 |
}} |
| 182 |
\FixL@translate{doc}{generalname}{Vispārīgi} |
| 183 |
\FixL@translate{listings}{lstlistlistingname}{Pirmkoda tekstu saraksts} |
| 184 |
\FixL@translate{listings}{lstlistingname}{% |
| 185 |
\ifx\lst@@caption\@empty P\else p\fi irmkods} |
| 186 |
\endinput |
| 187 |
%% |
| 188 |
%% End of file `fixlatvian.sty'. |