diff options
author | Karl Berry <karl@freefriends.org> | 2009-01-27 02:00:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-01-27 02:00:42 +0000 |
commit | fcb7796bc1728a7aaf0be5c2a7650d31f2187ecc (patch) | |
tree | 72538b38486ee40a283979d32baf47624b29da98 /Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty | |
parent | 990207a7872817b3d9945d710a389a0d76fe0260 (diff) |
polyglossia update (26jan09)
git-svn-id: svn://tug.org/texlive/trunk@11991 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty b/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty index f2d3f762faa..0f8a2dae8e5 100644 --- a/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty +++ b/Master/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty @@ -1,8 +1,16 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{polyglossia}[2008/07/26 v1.0.1 +\ProvidesPackage{polyglossia}[2009/01/25 v1.0.2 Babel replacement for XeLaTeX] -\RequirePackage{etoolbox} % TEMPORARY? but so convenient! +\RequirePackage{etoolbox} \RequirePackage{fontspec} %which itself depends on xkeyval + +%% This is for compatibility with Babel-aware package: +\cslet{ver@babel.sty}{\@empty} % this "fakes" babel +\def\languageshorthands#1{\relax} %this is for scrlttr2 class +\AtEndPreamble{\let\bbl@set@language\xpg@set@language} %for biblatex +\AtEndPreamble{\let\bbl@main@language\xpg@main@language} %for biblatex + +%% custom message macros \providecommand*{\xpg@warning}[1]{% \PackageWarning{polyglossia}% {#1}} @@ -18,17 +26,22 @@ %TODO try at least to load the hyphenation patterns for #1. \def\xpg@ill@value#1#2{% \xpg@warning{Illegal value (#1) for #2}} - + +%% use macro if defined, else warn that it is not \def\xpg@csifdef@warn#1{% \ifcsundef{#1}{\PackageWarning{polyglossia}{ #1 is not defined}}% {\expandafter\protect\csname #1\endcsname}} - +%% same without warning \def\xpg@csifdef#1{\ifcsundef{#1}{\relax}{\expandafter\protect\csname #1\endcsname}} - +%% ensure directionality if bidi is loaded, else ignore \def\@@ensure@dir#1{\ifcsundef{@ensure@dir}{#1}{\@ensure@dir{#1}}} \def\@@ensure@maindir#1{\ifcsundef{@ensure@maindir}{#1}{\@ensure@maindir{#1}}} +%% compatibility with babel +\let\addto\gappto% gappto is defined in etoolbox +%% +%% ensure localization of \markright and \markboth commands \def\opt@enabled{on} \def\opt@disabled{off} \define@key{polyglossia}{localmarks}[on]{% @@ -59,31 +72,17 @@ \def\@markright####1####2####3{\@temptokena{\protect\@@ensure@maindir{####1}}% \unrestored@protected@xdef\@themark{{\the\@temptokena}% {{\protect\@@ensure@maindir{####3}}}}}} - \else\ifx\@tmpa\opt@disabled - \def\local@marks#1{} + \else%\ifx\@tmpa\opt@disabled + \def\local@marks##1{} \xpg@info{Option: localmarks=off} - \fi% + %\fi% \fi% } \setkeys{polyglossia}{localmarks=on} -%%TODO Use the etoolbox macros instead! -%\def\oaddto#1#2{% -% \ifx#1\@undefined -% \def#1{#2}% -% \else -% \ifx#1\relax -% \def#1{#2}% -% \else -% {\toks@\expandafter{#1#2}% -% \xdef#1{\the\toks@}}% -% \fi -% \fi -%} - \newcommand{\setdefaultlanguage}[2][]{% \IfFileExists{gloss-#2.ldf}% - {\ifcsundef{#2@loaded}% from etoolbox.sty + {\ifcsundef{#2@loaded}% {\input{gloss-#2.ldf}% \xpg@info{Default language is #2.} \def\languagename{#2}% @@ -200,7 +199,7 @@ \newcommand\setotherlanguages[1]{% \def\do##1{\setotherlanguage{##1}}% - \docsvlist{#1}}% from etoolbox.sty + \docsvlist{#1}}% \def\common@language{% \protect\language=0% @@ -363,7 +362,5 @@ {\edef\@temp{\noexpand\setotherlanguage{\CurrentOption}}}% \AtEndOfPackage{\@temp}} \ProcessOptions* -%This is for compatibility with biblatex and perhaps other pkgs: -\def\languageshorthands#1{\relax} \endinput |