[latex3-commits] [git/latex2e] master: \flq, \glq, etc., now work with TU. (b3f45a4)
Javier
javier at dante.de
Sun Nov 26 09:45:37 CET 2017
Repository : https://github.com/latex3/latex2e
On branch : master
Link : https://github.com/latex3/latex2e/commit/b3f45a4b5104c3e7ee9145fadc576f4937f7f262
>---------------------------------------------------------------
commit b3f45a4b5104c3e7ee9145fadc576f4937f7f262
Author: Javier <javier at localhost>
Date: Sun Nov 26 09:45:37 2017 +0100
\flq, \glq, etc., now work with TU.
>---------------------------------------------------------------
b3f45a4b5104c3e7ee9145fadc576f4937f7f262
required/babel/babel.dtx | 162 +++++++++++++++++++++-------------------------
required/babel/babel.pdf | Bin 620805 -> 606604 bytes
2 files changed, 72 insertions(+), 90 deletions(-)
diff --git a/required/babel/babel.dtx b/required/babel/babel.dtx
index 5f068cc..e8fb2ad 100644
--- a/required/babel/babel.dtx
+++ b/required/babel/babel.dtx
@@ -35,9 +35,9 @@
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
-\setmainfont[Scale=.89]{DejaVu Serif}
-\setsansfont[Scale=.87]{DejaVu Sans}
-\setmonofont[Scale=.87]{DejaVu Sans Mono}
+\setmainfont[Scale=.88]{Noto Serif}
+\setsansfont[Scale=.88]{Noto Sans}
+\setmonofont[Scale=.88,FakeStretch=.95]{Noto Mono}
\raggedright
\addtolength{\textwidth}{25pt}
\addtolength{\textheight}{3.5cm}
@@ -54,7 +54,7 @@
\meta{language}\texttt{,}\meta{language}\texttt{,}...}
\newcommand*\langvar{\m{lang}}
\newcommand*\Lopt[1]{\textsf{#1}}
-\newcommand*\Lenv[1]{\textsf{#1}}
+\newcommand*\Lenv[1]{\texttt{#1}}
\newcommand*\menv[1]{\char`\{#1\char`\}}
\newcommand*\Eenv[1]{%
\quad\ldots\quad
@@ -492,7 +492,7 @@ In Plain, load languages styles with |\input| and then use
\subsection{Basic language selectors}
This section describes the commands to be used in the document to
-switch the language in multilingual document. In most cases, only the
+switch the language in multilingual documents. In most cases, only the
two basic macros |\selectlanguage| and |\foreignlanguage| are
necessary. The environments |otherlanguage|, |otherlanguage*| and
|hyphenrules| are auxiliary, and described in the next section.
@@ -1774,7 +1774,7 @@ Mono} \fi}
\begin{verbatim}
\documentclass{article}
-\usepackage[swedish]{babel}
+\usepackage[swedish, bidi=default]{babel}
\babelprovide[import=he]{hebrew}
@@ -6879,6 +6879,9 @@ help from Bernd Raichle, for which I am grateful.
%
% Shorthands are provided for a number of different quotation
% marks, which make them usable both outside and inside mathmode.
+% They are defined with |\ProvideTextCommandDefault|, but this is
+% very likely not required because their definitions are based on
+% encoding dependent macros.
%
% \begin{macro}{\glq}
% \begin{macro}{\grq}
@@ -6889,11 +6892,8 @@ help from Bernd Raichle, for which I am grateful.
% The `german' single quotes.
%
% \begin{macrocode}
-\ProvideTextCommand{\glq}{OT1}{%
+\ProvideTextCommandDefault{\glq}{%
\textormath{\quotesinglbase}{\mbox{\quotesinglbase}}}
-\ProvideTextCommand{\glq}{T1}{%
- \textormath{\quotesinglbase}{\mbox{\quotesinglbase}}}
-\ProvideTextCommandDefault{\glq}{\UseTextSymbol{OT1}\glq}
% \end{macrocode}
%
% The definition of |\grq| depends on the fontencoding. With
@@ -6902,10 +6902,12 @@ help from Bernd Raichle, for which I am grateful.
% \begin{macrocode}
\ProvideTextCommand{\grq}{T1}{%
\textormath{\textquoteleft}{\mbox{\textquoteleft}}}
+\ProvideTextCommand{\grq}{TU}{%
+ \textormath{\textquoteleft}{\mbox{\textquoteleft}}}
\ProvideTextCommand{\grq}{OT1}{%
- \save at sf@q{\kern-.0125em%
- \textormath{\textquoteleft}{\mbox{\textquoteleft}}%
- \kern.07em\relax}}
+ \save at sf@q{\kern-.0125em
+ \textormath{\textquoteleft}{\mbox{\textquoteleft}}%
+ \kern.07em\relax}}
\ProvideTextCommandDefault{\grq}{\UseTextSymbol{OT1}\grq}
% \end{macrocode}
%
@@ -6921,23 +6923,22 @@ help from Bernd Raichle, for which I am grateful.
% The `german' double quotes.
%
% \begin{macrocode}
-\ProvideTextCommand{\glqq}{OT1}{%
+\ProvideTextCommandDefault{\glqq}{%
\textormath{\quotedblbase}{\mbox{\quotedblbase}}}
-\ProvideTextCommand{\glqq}{T1}{%
- \textormath{\quotedblbase}{\mbox{\quotedblbase}}}
-\ProvideTextCommandDefault{\glqq}{\UseTextSymbol{OT1}\glqq}
% \end{macrocode}
%
-% The definition of |\grqq| depends on the % fontencoding. With
+% The definition of |\grqq| depends on the fontencoding. With
% \texttt{T1} encoding no extra kerning is needed.
%
% \begin{macrocode}
\ProvideTextCommand{\grqq}{T1}{%
\textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
+\ProvideTextCommand{\grqq}{TU}{%
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}}
\ProvideTextCommand{\grqq}{OT1}{%
- \save at sf@q{\kern-.07em%
- \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}%
- \kern.07em\relax}}
+ \save at sf@q{\kern-.07em
+ \textormath{\textquotedblleft}{\mbox{\textquotedblleft}}%
+ \kern.07em\relax}}
\ProvideTextCommandDefault{\grqq}{\UseTextSymbol{OT1}\grqq}
% \end{macrocode}
%
@@ -6953,19 +6954,10 @@ help from Bernd Raichle, for which I am grateful.
% The `french' single guillemets.
%
% \begin{macrocode}
-\ProvideTextCommand{\flq}{OT1}{%
+\ProvideTextCommandDefault{\flq}{%
\textormath{\guilsinglleft}{\mbox{\guilsinglleft}}}
-\ProvideTextCommand{\flq}{T1}{%
- \textormath{\guilsinglleft}{\mbox{\guilsinglleft}}}
-\ProvideTextCommandDefault{\flq}{\UseTextSymbol{OT1}\flq}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\ProvideTextCommand{\frq}{OT1}{%
- \textormath{\guilsinglright}{\mbox{\guilsinglright}}}
-\ProvideTextCommand{\frq}{T1}{%
+\ProvideTextCommandDefault{\frq}{%
\textormath{\guilsinglright}{\mbox{\guilsinglright}}}
-\ProvideTextCommandDefault{\frq}{\UseTextSymbol{OT1}\frq}
% \end{macrocode}
%
% \end{macro}
@@ -6980,19 +6972,10 @@ help from Bernd Raichle, for which I am grateful.
% The `french' double guillemets.
%
% \begin{macrocode}
-\ProvideTextCommand{\flqq}{OT1}{%
- \textormath{\guillemotleft}{\mbox{\guillemotleft}}}
-\ProvideTextCommand{\flqq}{T1}{%
+\ProvideTextCommandDefault{\flqq}{%
\textormath{\guillemotleft}{\mbox{\guillemotleft}}}
-\ProvideTextCommandDefault{\flqq}{\UseTextSymbol{OT1}\flqq}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\ProvideTextCommand{\frqq}{OT1}{%
+\ProvideTextCommandDefault{\frqq}{%
\textormath{\guillemotright}{\mbox{\guillemotright}}}
-\ProvideTextCommand{\frqq}{T1}{%
- \textormath{\guillemotright}{\mbox{\guillemotright}}}
-\ProvideTextCommandDefault{\frqq}{\UseTextSymbol{OT1}\frqq}
% \end{macrocode}
%
% \end{macro}
@@ -7505,6 +7488,47 @@ help from Bernd Raichle, for which I am grateful.
\bbl at replace@finish at iii\bbl at toreplace}
% \end{macrocode}
%
+% Language and Script values to be used when defining a font or
+% setting the direction are set with the following macros.
+%
+% \begin{macrocode}
+\def\bbl at provide@lsys#1{%
+ \bbl at ifunset{bbl at lname@#1}%
+ {\bbl at ini@ids{#1}}%
+ {}%
+ \bbl at csarg\let{lsys@#1}\@empty
+ \bbl at ifunset{bbl at sname@#1}{\bbl at csarg\gdef{sname@#1}{Default}}{}%
+ \bbl at ifunset{bbl at sotf#1}{\bbl at csarg\gdef{sotf@#1}{DFLT}}{}%
+ \bbl at csarg\bbl at add@list{lsys@#1}{Script=\bbl at cs{sname@#1}}%
+ \bbl at ifunset{bbl at lname@#1}{}%
+ {\bbl at csarg\bbl at add@list{lsys@#1}{Language=\bbl at cs{lname@#1}}}%
+ \bbl at csarg\bbl at toglobal{lsys@#1}}%
+ % \bbl at exp{% TODO - should be global
+ % \<keys_if_exist:nnF>{fontspec-opentype/Script}{\bbl at cs{sname@#1}}%
+ % {\\\newfontscript{\bbl at cs{sname@#1}}{\bbl at cs{sotf@#1}}}%
+ % \<keys_if_exist:nnF>{fontspec-opentype/Language}{\bbl at cs{lname@#1}}%
+ % {\\\newfontlanguage{\bbl at cs{lname@#1}}{\bbl at cs{lotf@#1}}}}}
+% \end{macrocode}
+%
+% The following |ini| reader ignores everything but the
+% |identification| section. It is called when a font is defined (ie,
+% when the language is first selected) to know which script/language
+% must be enabled. This means we must make sure a few characters are
+% not active. The |ini| is not read directly, but with a proxy |tex|
+% file named as the language.
+%
+% \begin{macrocode}
+\def\bbl at ini@ids#1{%
+ \def\BabelBeforeIni##1##2{%
+ \begingroup
+ \bbl at add\bbl at secpost@identification{%
+ \def\bbl at iniline########1\bbl at iniline{}}%
+ \catcode`\[=12 \catcode`\]=12 \catcode`\==12
+ \bbl at read@ini{##1}%
+ \endgroup}
+ \InputIfFileExists{babel-#1.tex}{}{}}
+% \end{macrocode}
+%
% \subsection{Cross referencing macros}
%
% The \LaTeX\ book states:
@@ -8330,7 +8354,6 @@ help from Bernd Raichle, for which I am grateful.
% (reserved for hyphenation).}
% \changes{3.15}{2017/10/30}{Store direction in @wdir@<lang>.}
%
-%
% \begin{macrocode}
\def\bbl at alscripts{,Arabic,Syriac,Thaana,}
\def\bbl at rscripts{%
@@ -8352,6 +8375,7 @@ help from Bernd Raichle, for which I am grateful.
\global\bbl at csarg\chardef{wdir@#1}\z@
\fi}
\def\bbl at switchdir{%
+ \bbl at ifunset{bbl at lsys@\languagename}{\bbl at provide@lsys{\languagename}}{}%
\bbl at ifunset{bbl at wdir@\languagename}{\bbl at provide@dirs{\languagename}}{}%
\bbl at exp{\\\bbl at setdirs\bbl at cs{wdir@\languagename}}}
\def\bbl at setdirs#1{% TODO - math
@@ -8361,8 +8385,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl at pardir{#1}%
\fi
\bbl at textdir{#1}}
-\ifcase\bbl at engine
-\or
+\ifodd\bbl at engine
\AddBabelHook{babel-bidi}{afterextras}{\bbl at switchdir}
\DisableBabelHook{babel-bidi}
\def\bbl at getluadir#1{%
@@ -8389,7 +8412,7 @@ help from Bernd Raichle, for which I am grateful.
\def\bbl at bodydir{\bbl at setdir{body}\bodydir}
\def\bbl at pagedir{\bbl at setdir{page}\pagedir}
\def\bbl at dirparastext{\pardir\the\textdir\relax}% %%%%
-\or
+\else
\AddBabelHook{babel-bidi}{afterextras}{\bbl at switchdir}
\DisableBabelHook{babel-bidi}
\newcount\bbl at dirlevel
@@ -9809,12 +9832,12 @@ help from Bernd Raichle, for which I am grateful.
\AtEndOfPackage{\EnableBabelHook{babel-bidi}}}
\DeclareOption{bidi=default}%
{\let\bbl at beforeforeign\leavevmode
- \ifcase\bbl at engine\or
+ \ifodd\bbl at engine
\newattribute\bbl at attr@dir
\fi
\AtEndOfPackage{%
\EnableBabelHook{babel-bidi}%
- \ifcase\bbl at engine\or\or
+ \ifodd\bbl at engine\else
\bbl at xebidipar
\fi}}
%<</More package options>>
@@ -9919,47 +9942,6 @@ help from Bernd Raichle, for which I am grateful.
\bbl at toglobal#1}%
% \end{macrocode}
%
-% Language and Script values to be used when defining a font are set
-% with the following macros.
-%
-% \begin{macrocode}
-\def\bbl at provide@lsys#1{%
- \bbl at ifunset{bbl at lname@#1}%
- {\bbl at ini@ids{#1}}%
- {}%
- \bbl at csarg\let{lsys@#1}\@empty
- \bbl at ifunset{bbl at sname@#1}{\bbl at csarg\gdef{sname@#1}{Default}}{}%
- \bbl at ifunset{bbl at sotf#1}{\bbl at csarg\gdef{sotf@#1}{DFLT}}{}%
- \bbl at csarg\bbl at add@list{lsys@#1}{Script=\bbl at cs{sname@#1}}%
- \bbl at ifunset{bbl at lname@#1}{}%
- {\bbl at csarg\bbl at add@list{lsys@#1}{Language=\bbl at cs{lname@#1}}}%
- \bbl at csarg\bbl at toglobal{lsys@#1}}%
- % \bbl at exp{% TODO - should be global
- % \<keys_if_exist:nnF>{fontspec-opentype/Script}{\bbl at cs{sname@#1}}%
- % {\\\newfontscript{\bbl at cs{sname@#1}}{\bbl at cs{sotf@#1}}}%
- % \<keys_if_exist:nnF>{fontspec-opentype/Language}{\bbl at cs{lname@#1}}%
- % {\\\newfontlanguage{\bbl at cs{lname@#1}}{\bbl at cs{lotf@#1}}}}}
-% \end{macrocode}
-%
-% The following |ini| reader ignores everything but the
-% |identification| section. It is called when a font is defined (ie,
-% when the language is first selected) to know which script/language
-% must be enabled. This means we must make sure a few characters are
-% not active. The |ini| is not read directly, but with a proxy |tex|
-% file named as the language.
-%
-% \begin{macrocode}
-\def\bbl at ini@ids#1{%
- \def\BabelBeforeIni##1##2{%
- \begingroup
- \bbl at add\bbl at secpost@identification{%
- \def\bbl at iniline########1\bbl at iniline{}}%
- \catcode`\[=12 \catcode`\]=12 \catcode`\==12
- \bbl at read@ini{##1}%
- \endgroup}
- \InputIfFileExists{babel-#1.tex}{}{}}
-% \end{macrocode}
-%
% font at rst and famrst are only used when there is no global settings,
% to save and restore de previous families. Not really necessary, but
% done for optimization.
diff --git a/required/babel/babel.pdf b/required/babel/babel.pdf
index cb0b483..dd72215 100644
Binary files a/required/babel/babel.pdf and b/required/babel/babel.pdf differ
More information about the latex3-commits
mailing list