diff options
author | Karl Berry <karl@freefriends.org> | 2009-03-12 23:57:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-03-12 23:57:05 +0000 |
commit | 5220e9a883d39636d52c36d36c20ec8ff46e544a (patch) | |
tree | 80e982cb56395e5f7249ea4af1adabfd834fdcac /Master | |
parent | acc836880ba7376f28c11c51041a9602b55d6a72 (diff) |
magyar update (12mar09)
git-svn-id: svn://tug.org/texlive/trunk@12375 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/magyar/magyar.ldf | 225 |
1 files changed, 156 insertions, 69 deletions
diff --git a/Master/texmf-dist/doc/latex/magyar/magyar.ldf b/Master/texmf-dist/doc/latex/magyar/magyar.ldf index 2a9d5288d46..37cab6f1bdd 100644 --- a/Master/texmf-dist/doc/latex/magyar/magyar.ldf +++ b/Master/texmf-dist/doc/latex/magyar/magyar.ldf @@ -481,7 +481,7 @@ \dMf magyar@opt@defaults@@hu-min {% \csname magyar@opt@defaults@@over-1.4\endcsname % Dat: no openqq=unchanged (!) - \magyar@doopt activespace=safe,amstocnumskip=\enskip,frenchspacing=yes, + \magyar@doopt activespace=safe,amstocnumskip=\enskip,frenchspacing=yes, captions=hu,classmod=yes,figurecaptions=hu, footnote=huplain,frenchspacing=yes,hyphenmins=22, labelenums=hu-d,labelitems=hu,fancyhdr=hu, @@ -842,12 +842,35 @@ \fi \expandafter\ifx\csname magyar@needopt@hunumbers\endcsname\relax\else \ifnum\magyar@opt@@hunumbers=0 - \@@magyar@error{(chapter|part)number=... implies hunumbers=yes}% + \@@magyar@error{(chapter|part)number=... needs hunumbers=yes}% + \magyar@opt@@hunumbers1 \fi + %** Replace \thechapter at the beginning of the definition of \thesection + %** with \@arabic\c@chapter if appropriate. + %** @param #1#2 the first-level expansion of \thesection + \def\@@magyar@fix@thesection@huordinal#1#2\hfuzz{% + \def\reserved@a{\thechapter}% + \def\reserved@b{#1}% + \ifx\reserved@a\reserved@b + \def\magyar@ulladik{ulladik0}% [Nn]ulladik, `0' at end is intentional + \begingroup + \c@chapter0 + \edef\reserved@a{\thechapter}% + \edef\reserved@a{\expandafter\@gobble\reserved@a0}% + \ifx\reserved@a\magyar@ulladik% \thechapter is a huordinal + \endgroup + \def\thesection{\@arabic\c@chapter#2}% + \else + \endgroup\fi + \fi + }% + \AtBeginDocument{\expandafter\@@magyar@fix@thesection@huordinal + \thesection\@empty\hfuzz} \fi \if0\magyar@opt@@shorthandcs\else \if\magyar@opt@@active0% \@@magyar@error{active=none implies shorthandcs=none}% + \magyar@opt@@active2 % active=safe \fi \fi % Imp: undef \magyar\@opt@* to save memory @@ -1360,6 +1383,11 @@ % \relax, or {currentlabel-in-arabic}{pagenumber-in-arabic} \let\magyar@@currentlabel@arabic\relax +\def\@@magyar@setup@romantoarabic{% + \let\romannumeral\number + \let\@Roman\@roman % avoid uppercasing +} + \def\refstepcounter#1{% \magyar@@orig@refstepcounter{#1}% \begingroup @@ -1369,7 +1397,7 @@ \c@page\@m \edef\reserved@b{{\thepage}}% \let\reserved@a\@currentlabel - % Append \reserved@b to \reserved@a, add {...} as well. + % Wrap \reserved@a in {...}, and then append \reserved@b to \reserved@a. \expandafter\expandafter\expandafter\def \expandafter\expandafter\expandafter\reserved@a% \expandafter\expandafter\expandafter{% @@ -1381,8 +1409,7 @@ \expandafter\endgroup\reserved@b \begingroup \c@page\@m - \let\romannumeral\number - \let\@Roman\@roman % avoid uppercasing + \@@magyar@setup@romantoarabic % This \protected@edef is from the \refstepcounter code. \protected@edef\reserved@a{% {\csname p@#1\endcsname\csname the#1\endcsname}{\thepage}}% @@ -1399,28 +1426,34 @@ \def\@@magyar@labela{\@@magyar@labelb}% \def\@@magyar@labelb#1{% \@@magyar@orig@label{#1}% output \newlabel to \@auxout - \ifx\magyar@@currentlabel\relax\else - \begingroup - \edef\reserved@a{{\@currentlabel}{\thepage}}% - \c@page\@m - \edef\reserved@b{{\thepage}}% - \let\reserved@a\@currentlabel - % Append \reserved@b to \reserved@a, add {...} as well. - \expandafter\expandafter\expandafter\def - \expandafter\expandafter\expandafter\reserved@a% - \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter{% - \expandafter\reserved@a\expandafter}\reserved@b}% - \ifx\reserved@a\magyar@@currentlabel@intact - \ifx\magyar@@currentlabel@arabic\magyar@@currentlabel@intact\else - \expandafter\@@magyar@labelc\magyar@@currentlabel@arabic{#1}% - \fi + \begingroup + \c@page\@m + \edef\reserved@b{{\thepage}}% + \let\reserved@a\@currentlabel + % Wrap \reserved@a in {...}, and then append \reserved@b to \reserved@a. + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\reserved@a% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter{% + \expandafter\reserved@a\expandafter}\reserved@b}% + \ifx\reserved@a\magyar@@currentlabel@intact + % \@currentlabel created by our overridden \refstepcounter. + \ifx\magyar@@currentlabel@arabic\magyar@@currentlabel@intact\else + \expandafter\@@magyar@labelc\magyar@@currentlabel@arabic{#1}% \fi - \endgroup - \fi + \else + % \@currentlabel from unknown origin. + % Emit \hunnewlabel if \thepage is roman. + \@@magyar@setup@romantoarabic + \edef\reserved@c{{\thepage}}% + \ifx\reserved@b\reserved@c\else % \thepage is roman + \@@magyar@labelc\@currentlabel{}{#1}% + \fi + \fi + \endgroup } -% @param #1 \@currentlabel expanded as roman -% @param #2 `1' +% @param #1 \@currentlabel (maybe expanded) as roman converted to arabic +% @param #2 any page number in any format; ignored % @param #3 name of the label \def\@@magyar@labelc#1#2#3{% % We have \noexpand\number below to prevent the \edef in \protected@write @@ -4180,7 +4213,7 @@ % for each float, and number with \thempfootnote. % vvv Very tricky use of `#' in expansion. % Dat: \magyar@fo@mp@show is idempotent - % vvv Prepend \magyat@fo@mp@show to the definition of \@makecaption + % vvv Prepend \magyar@fo@mp@show to the definition of \@makecaption \expandafter\def\expandafter\@makecaption\expandafter##\expandafter1% \expandafter##\expandafter2\expandafter{\expandafter\magyar@fo@mp@show% \@makecaption{##1}{##2}% @@ -4266,7 +4299,7 @@ \@gobble {^} -\if2\magyar@opt@@mathbrk\else \@@magyar@skiplong\fi +\if2\magyar@opt@@mathbrk\else \@@magyar@skiplong\fi % mathbrk=fix \def\@@magyar@resetmathchars{% \mathcode`+"202B \catcode`+12 \mathcode`-"2200 \catcode`-12 @@ -4285,7 +4318,9 @@ %\mathcode`."013A \catcode`.12 } %** Dat: don't do `/', because slash is unbreakable - \def\@@magyar@domathbins{\do+\do-\do*\do>\do<\do=\do:}% + \def\@@magyar@domathbins{% + \do-\@@magyar@fix@newmcodes@dash + \do+\do*\do>\do<\do=\do:}% %** @param #1 a char token with \mathcode != "8000, like + \def\@@magyar@fixmathbinchar#1{% \ifnum\mathcode`#1="8000 \else @@ -4300,6 +4335,18 @@ \fi \catcode`#112 } + %** \newmcodes@ defined in amsopn.sty doesn't work (triggered by + %** \DeclareMathOperator{\tg}{tg} $\tg$) because it wants to assign + %** \mathchardef\std@minus\mathcode`\-, which is "8000, which is a bad + %** matchar. We fix that by prepending \mathcode`-45 to \newmcodes@ . + %** This is OK, because \newmcodes@ is protected by a block set up by + %** \qopname. + \def\@@magyar@fix@newmcodes@dash{% + \ifx\newmcodes@\@undefined\else + \let\magyar@@newmcodes\newmcodes@ + \def\newmcodes@{\mathcode`-"45 \magyar@@newmcodes}% + \fi + }% %** @param #1 `\mathchar', all catcodes %** @param #2 hex code @@ -4678,6 +4725,40 @@ }% } +\def\magyar@ulladik{ulladik0}% [Nn]ulladik, `0' at end is intentional + +%** Define control sequence #1 to be empty if \the#2 is huordinal, +%** otherwise define #1 to be `.'. +%** support \def\thepart{\@Huordinal\c@part}} without dots +\def\@@magyar@huordinal@dotdef#1#2{% + \begingroup% support \def\thepart{\@Huordinal\c@part}} without dots + \csname c@#2\endcsname0 + \edef\reserved@a{\csname the#2\endcsname}% + \edef\reserved@a{\expandafter\@gobble\reserved@a0}% + \edef\reserved@a{\def\noexpand\reserved@a{\ifx\reserved@a\magyar@ulladik\else.\fi}}% + \expandafter\endgroup#1% +} + +%** Define \magyar@@toc@thechapter to \thechapter expanded but huordinal in +%** arabic. +\def\@@magyar@def@toc@thechapter{% + \begingroup + \let\@Huordinal\@arabic + \let\@huordinal\@arabic + \edef\magyar@@toc@thechapter{\thechapter}% + \expandafter\endgroup\expandafter\def\expandafter\magyar@@toc@thechapter + \expandafter{\magyar@@toc@thechapter}% +} + +%** Convert \@currentlabel to lowercase \@huordinal if \thechapter is a +%** huordinal or a Huordinal. +\def\@@magyar@lowercase@currentlabel@toc@thechapter{% + \ifx\vfuzz\magyar@@toc@thechapter\vfuzz\else + % Convert to lower case. + \protected@edef\@currentlabel{\@huordinal\c@chapter}% + \fi +} + %** Emits the rule to the running head. Must put something of zero width %** to the horizontal list. %** @param #1 0: even page, 1: odd page, 3: page w/o [twoside] @@ -4702,10 +4783,13 @@ \def\@oddhead {\@@magyar@headrule1{\@@magyar@slshape\rightmark}\hfil\thepage}% \let\@mkboth\markboth \def\chaptermark##1{% + \@@magyar@huordinal@dotdef\reserved@a{chapter}\reserved@a \markboth {\MakeUppercase{% \ifnum \c@secnumdepth >\m@ne - \if@mainmatter% Dat: csak book.cls-ben van, report.cls-ben nincs - \thechapter\ifx\@chapapp\@@magyar@appendixname\enspace\else.~\fi + \if@mainmatter% Dat: mainmatter only in book.cls, not in report.cls + \thechapter + % \reserved@a is empty or a dot, by \@magyar@huordinal@dotdef + \ifx\@chapapp\@@magyar@appendixname\enspace\else\reserved@a~\fi \@chapapp.\magyar@opt@@hdrtitleskip% \ % \fi \fi @@ -4721,10 +4805,13 @@ \def\@oddhead{\@@magyar@headrule3{\@@magyar@slshape\rightmark}\hfil\thepage}% \let\@mkboth\markboth \def\chaptermark##1{% + \@@magyar@huordinal@dotdef\reserved@a{chapter}\reserved@a \markright {\MakeUppercase{% \ifnum \c@secnumdepth >\m@ne \if@mainmatter - \thechapter\ifx\@chapapp\@@magyar@appendixname\enspace\else.~\fi + \thechapter + % \reserved@a is empty or a dot, by \@magyar@huordinal@dotdef + \ifx\@chapapp\@@magyar@appendixname\enspace\else\reserved@a~\fi \@chapapp.\magyar@opt@@hdrtitleskip% \ % \fi \fi @@ -4732,7 +4819,6 @@ \fi }% \expandafter\magyar@def@psheadings\expandafter{\CurrentOption}{book}% - \def\magyar@ulladik{ulladik0}% [Nn]ulladik, `0' at end is intentional % Part: inserting dot, changing order, toc \expandafter\addto\csname extras\CurrentOption\endcsname{% \babel@save\@part @@ -4748,12 +4834,7 @@ \interlinepenalty \@M \normalfont \ifnum \c@secnumdepth >-2\relax - \begingroup% support \def\thepart{\@Huordinal\c@part}} without dots - \c@part=0 - \edef\reserved@a{\thepart}% - \edef\reserved@a{\expandafter\@gobble\reserved@a0}% - \edef\reserved@a{\def\noexpand\reserved@a{\ifx\reserved@a\magyar@ulladik\else.\fi}}% - \expandafter\endgroup\reserved@a + \@@magyar@huordinal@dotdef\reserved@a{part}% \huge\bfseries \thepart\reserved@a~\partname \csname par\endcsname \vskip 20\p@ @@ -4768,9 +4849,12 @@ \if@mainmatter \refstepcounter{chapter}% \typeout{\thechapter\ifx\@chapapp\@@magyar@appendixname\else.\fi\space\@chapapp.}% + \@@magyar@def@toc@thechapter + \@@magyar@lowercase@currentlabel@toc@thechapter \ifx\@chapapp\@@magyar@appendixname - \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter\protect\@gobble}#1}% - \else\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}\fi + % \@gobble gobbles the dot emitted by \numberline. + \addcontentsline{toc}{chapter}{\protect\numberline{\magyar@@toc@thechapter\protect\@gobble}#1}% + \else\addcontentsline{toc}{chapter}{\protect\numberline{\magyar@@toc@thechapter}#1}\fi \else \addcontentsline{toc}{chapter}{#1}% \fi @@ -4797,8 +4881,11 @@ \ifnum \c@secnumdepth >\m@ne \if@mainmatter \huge\bfseries \thechapter - \ifx\@chapapp\@@magyar@appendixname\enspace\else.~\fi - \@chapapp{} + \ifx\@chapapp\@@magyar@appendixname\enspace\else + \@@magyar@huordinal@dotdef\reserved@a{chapter}% + \reserved@a~% \reserved@a is a dot or empty + \fi + \@chapapp{}% \csname par\endcsname\nobreak \vskip 20\p@ \fi @@ -4821,9 +4908,12 @@ \def\@oddhead {\@@magyar@headrule1{\@@magyar@slshape\rightmark}\hfil\thepage}% \let\@mkboth\markboth \def\chaptermark##1{% + \@@magyar@huordinal@dotdef\reserved@a{chapter}\reserved@a \markboth {\MakeUppercase{% \ifnum \c@secnumdepth >\m@ne - \thechapter\ifx\@chapapp\@@magyar@appendixname\enspace\else.~\fi + \thechapter + % \reserved@a is empty or a dot, by \@magyar@huordinal@dotdef + \ifx\@chapapp\@@magyar@appendixname\enspace\else\reserved@a~\fi \@chapapp.\magyar@opt@@hdrtitleskip% \ % \fi ##1}}{}}% @@ -4839,29 +4929,31 @@ \@@magyar@headrule3{\@@magyar@slshape\rightmark}\hfil\thepage}% \let\@mkboth\markboth \def\chaptermark##1{% + \@@magyar@huordinal@dotdef\reserved@a{chapter}\reserved@a \markright{\MakeUppercase{% \ifnum \c@secnumdepth >\m@ne - \thechapter\ifx\@chapapp\@@magyar@appendixname\enspace\else.~\fi + \thechapter + % \reserved@a is empty or a dot, by \@magyar@huordinal@dotdef + \ifx\@chapapp\@@magyar@appendixname\enspace\else\reserved@a~\fi \@chapapp.\magyar@opt@@hdrtitleskip% \ % \fi ##1}}}% \fi }% \expandafter\magyar@def@psheadings\expandafter{\CurrentOption}{report}% - \def\magyar@ulladik{ulladik0}% [Nn]ulladik, `0' at end is intentional % Chapter: dot, changing typeout, toc % Part... \expandafter\addto\csname extras\CurrentOption\endcsname{% \babel@save\@chapter \def\@chapter[#1]#2{% \ifnum \c@secnumdepth >\m@ne - %\typeout{\meaning\@chapapp} - %\typeout{\meaning\@@magyar@appendixname} \refstepcounter{chapter}% \typeout{\thechapter\ifx\@chapapp\@@magyar@appendixname\else.\fi\space\@chapapp.}% + \@@magyar@def@toc@thechapter + \@@magyar@lowercase@currentlabel@toc@thechapter \ifx\@chapapp\@@magyar@appendixname - \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter\protect\@gobble}#1}% - \else\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}\fi + \addcontentsline{toc}{chapter}{\protect\numberline{\magyar@@toc@thechapter\protect\@gobble}#1}% + \else\addcontentsline{toc}{chapter}{\protect\numberline{\magyar@@toc@thechapter}#1}\fi \else \addcontentsline{toc}{chapter}{#1}% \fi @@ -4886,13 +4978,8 @@ {\centering \interlinepenalty \@M \normalfont - \ifnum \c@secnumdepth >-2\relax - \begingroup% support \def\thepart{\@Huordinal\c@part}} without dots - \c@part=0 - \edef\reserved@a{\thepart}% - \edef\reserved@a{\expandafter\@gobble\reserved@a0}% - \edef\reserved@a{\def\noexpand\reserved@a{\ifx\reserved@a\magyar@ulladik\else.\fi}}% - \expandafter\endgroup\reserved@a + \ifnum \c@secnumdepth >-2\relax + \@@magyar@huordinal@dotdef\reserved@a{part}% \huge\bfseries \thepart\reserved@a~\partname% hu \csname par\endcsname \vskip 20\p@ @@ -4908,10 +4995,12 @@ \vspace*{50\p@}% {\parindent \z@ \raggedright \normalfont \ifnum \c@secnumdepth >\m@ne - \huge\bfseries \thechapter%,,% - %\meaning\@chapapp;\meaning\@@magyar@appendixname((% - \ifx\@chapapp\@@magyar@appendixname\else.\fi~\@chapapp{} - \csname par\endcsname\nobreak + \huge\bfseries \thechapter + \ifx\@chapapp\@@magyar@appendixname\enspace\else + \@@magyar@huordinal@dotdef\reserved@a{chapter}% + \reserved@a~% \reserved@a is a dot or empty + \fi + \@chapapp{}% \vskip 20\p@ \fi \interlinepenalty\@M @@ -4957,7 +5046,6 @@ ##1}}} \fi}% \expandafter\magyar@def@psheadings\expandafter{\CurrentOption}{article}% - \def\magyar@ulladik{ulladik0}% [Nn]ulladik, `0' at end is intentional \expandafter\addto\csname extras\CurrentOption\endcsname{% \babel@save\@part \def\@part[#1]#2{% added at Fri Jul 23 11:45:57 CEST 2004 @@ -4971,12 +5059,7 @@ \interlinepenalty \@M \normalfont \ifnum \c@secnumdepth >\m@ne - \begingroup% support \def\thepart{\@Huordinal\c@part}} without dots - \c@part=0 - \edef\reserved@a{\thepart}% - \edef\reserved@a{\expandafter\@gobble\reserved@a0}% - \edef\reserved@a{\def\noexpand\reserved@a{\ifx\reserved@a\magyar@ulladik\else.\fi}}% - \expandafter\endgroup\reserved@a + \@@magyar@huordinal@dotdef\reserved@a{part}% \Large\bfseries \thepart\reserved@a~\partname% hu \csname par\endcsname\nobreak \fi @@ -5175,9 +5258,13 @@ % vvv Imp: do we need \if@twoside to set \subsectionmark here? \def\subsectionmark#1{\markright {\ifnum \c@secnumdepth >\@ne \thesubsection.\magyar@opt@@hdrtitleskip \fi #1}}% - }{\def\chaptermark#1{\markboth{\MakeUppercase{\ifnum \c@secnumdepth>\m@ne + }{\def\chaptermark#1{ + \@@magyar@huordinal@dotdef\reserved@a{chapter}\reserved@a + \markboth{\MakeUppercase{\ifnum \c@secnumdepth>\m@ne \csname if@mainmatter\endcsname% report.cls doesn't have it - \thechapter\ifx\@chapapp\@@magyar@appendixname\enspace\else\space \fi + \thechapter + % \reserved@a is empty or a dot, by \@magyar@huordinal@dotdef + \ifx\@chapapp\@@magyar@appendixname\enspace\else\reserved@a~\fi \@chapapp.\magyar@opt@@hdrtitleskip \expandafter\ifx\csname if@mainmatter\endcsname\relax \csname iftrue\endcsname\fi |