[latex3-commits] [git/LaTeX3-latex3-babel] master: prepart, postpart. Tentative code for labels/map.<counter>. (8855ac4)

Javier email at dante.de
Fri Jul 31 18:11:40 CEST 2020


Repository : https://github.com/latex3/babel
On branch  : master
Link       : https://github.com/latex3/babel/commit/8855ac410f96257dffefcdacae645dcf3327b782

>---------------------------------------------------------------

commit 8855ac410f96257dffefcdacae645dcf3327b782
Author: Javier <email at localhost>
Date:   Fri Jul 31 18:11:40 2020 +0200

    prepart, postpart. Tentative code for labels/map.<counter>.


>---------------------------------------------------------------

8855ac410f96257dffefcdacae645dcf3327b782
 README.md                                          |   4 +-
 babel.dtx                                          | 178 +++++++++++++++------
 babel.ins                                          |   2 +-
 babel.pdf                                          | Bin 796145 -> 799884 bytes
 bbcompat.dtx                                       |   2 +-
 locale/hu/babel-hu.ini                             |   1 +
 locale/ja/babel-ja.ini                             |   2 +-
 locale/ko/{babel-ko.ini => babel-ko-Hani.ini}      |  61 ++++---
 .../ko/babel-korean-han.tex                        |   2 +-
 .../ko/babel-korean-hani.tex                       |   2 +-
 locale/zh/babel-zh-Hans.ini                        |  27 ++--
 locale/zh/babel-zh.ini                             |  27 ++--
 12 files changed, 195 insertions(+), 113 deletions(-)

diff --git a/README.md b/README.md
index a03df2d..970df68 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.47.2081
+## Babel 3.47.2085
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages.  Many
@@ -44,7 +44,7 @@ respective authors.
 ### Latest changes
 
 ```
-3.48   2020-07-27 (development)
+3.48   2020-07-31 (development)
        - New keys to customize labels (chapter, enumerate, etc.).
 
 3.47   2020-07-13
diff --git a/babel.dtx b/babel.dtx
index 33e2196..d2c84cd 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2020/07/27 v3.47.2081 The Babel package]
+\ProvidesFile{babel.dtx}[2020/07/31 v3.47.2085 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -506,6 +506,11 @@ _\usepackage[vietnamese,danish]{babel}_
 \end{verbatim}
 \end{example}
 
+\begin{note}
+  Once loaded a language, you can select it with the corresponding
+  BCP47 tag. See section \ref{bcp47} for further details.
+\end{note}
+
 \subsection{Mostly monolingual documents}
 
 \New{3.39} Very often, multilingual documents consist of a main
@@ -519,8 +524,8 @@ also when provided in the optional argument of |\babelfont|, if used.)
 This is particularly useful, too, when there are short texts of this
 kind coming from an external source whose contents are not known on
 beforehand (for example, titles in a bibliography). At this regard, it
-is worth remembering that |\babelfont| does not load any font until
-required, so that it can be used just in case.
+is worth remembering that |\babelfont| does \textit{not} load any font
+until required, so that it can be used just in case.
 
 \begin{example}
   A trivial document is:
@@ -540,6 +545,13 @@ English. \foreignlanguage{russian}{Русский}.
 \end{verbatim}
 \end{example}
 
+\begin{note}
+  Instead of its name, you may prefer to select the language with the
+corresponding BCP47 tag. This alternative, however, must be activated
+explicitly, because a two- or tree-letter word is a valid name for a
+language (eg, |yi|). See section \ref{bcp47} for further details.
+\end{note}
+
 \subsection{Modifiers}
 
 \New{3.9c} The basic behavior of some languages can be modified when
@@ -2937,6 +2949,7 @@ additional replacement type with the key |string|.
 \end{example}
 
 \subsection{Selection based on BCP 47 tags}
+\label{bcp47}
 
 \New{3.43} The recommended way to select languages is that described at
 the beginning of this document. However, BCP 47 tags are becoming
@@ -2964,15 +2977,18 @@ Here is a minimal example:
 
 \usepackage[danish]{babel}
 
-\babeladjust{ autoload.bcp47 = on }
+\babeladjust{
+  autoload.bcp47 = on,
+  autoload.bcp47.options = import
+}
 
 \begin{document}
 
-\today
+Chapter in Danish: \chaptername.
 
-\selectlanguage{fr-CA}
+\selectlanguage{de-AT}
 
-\today
+\localedate{2020}{1}{30}
 
 \end{document}
 \end{verbatim}
@@ -3924,10 +3940,17 @@ recommended.
 \subsection{Guidelines for contributed languages}
 \label{contribute}
 
-Now language files are “outsourced” and are located in a separate
-directory (\texttt{/macros/latex/contrib/babel-contrib}), so that they
-are contributed directly to CTAN (please, do not send to me language
-styles just to upload them to CTAN).
+Currently, the easiest way to contribute a new language is by taking
+one the the 500 or so |ini| templates available on GitHub as a basis.
+Just make a pull request o dowonload it and then, after filling the
+fields, sent it to me. Fell free to ask for help or to make feature
+requests.
+
+As to \texttt{ldf} files, now language files are “outsourced” and are
+located in a separate directory
+(\texttt{/macros/latex/contrib/babel-contrib}), so that they are
+contributed directly to CTAN (please, do not send to me language styles
+just to upload them to CTAN).
 
 Of course, placing your style files in this directory is not mandatory,
 but if you want to do it, here are a few guidelines.
@@ -3949,7 +3972,7 @@ but if you want to do it, here are a few guidelines.
   own directory.
 \end{itemize}
 
-The following page provides a starting point:
+The following page provides a starting point for \texttt{ldf} files:
 \texttt{http://www.texnia.com/incubator.html}. See also
 \texttt{https://github.com/latex3/babel/wiki/List-of-locale-templates}.
 
@@ -4691,8 +4714,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.47.2081>>
-%<<date=2020/07/27>>
+%<<version=3.47.2085>>
+%<<date=2020/07/31>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -11023,51 +11046,89 @@ help from Bernd Raichle, for which I am grateful.
 %    \end{macrocode}
 %
 % \textbf{Labels.} Captions must contain just strings, no
-% format at all, so there is new group in ini files.
-% 
-%    \begin{macrocode}
-\def\bbl at bktoname[[#1]]{\csname#1name\endcsname} % TODO - ugly
-\def\bbl at bktothe[#1]{\csname the#1\endcsname}
+% format at all, so there is new group in ini files. Currently there
+% are two 
+% 
+%    \begin{macrocode}
+\def\bbl at bktoname#1\@@{\csname#1name\endcsname} % TODO - ugly
+\def\bbl at bktothe#1\@@{\csname the#1\endcsname}
+\def\bbl at list@the{%
+  part,chapter,section,subsection,subsubsection,paragraph,%
+  subparagraph,enumi,enumii,enumiii,enumiv,equation,figure,%
+  table,page,footnote,mpfootnote,mpfn} % Include \thempfn?
+\def\bbl at map@cnt#1{%  #1:roman,etc, // #2:enumi,etc
+  \bbl at ifunset{bbl at map@#1@\languagename}%
+    {\@nameuse{#1}}%
+    {\@nameuse{bbl at map@#1@\languagename}}}
 \def\bbl at inikv@labels#1=#2\@@{%
-  \def\bbl at toreplace{#2}%
-  \bbl at replace\bbl at toreplace{[ ]}{\nobreakspace{}}%
-  \bbl at replace\bbl at toreplace{[[}{\bbl at bktoname[[}%
-  \bbl at replace\bbl at toreplace{[}{\bbl at bktothe[}% 
-  \bbl at replace\bbl at toreplace{\bbl at bktothe[\bbl at bktothe}{[}% Ugly
-  \in@{,#1,}{,chapter,}%
-  \ifin@
-    \bbl at patchchapter
-    \global\bbl at csarg\let{chapfmt@\languagename}\bbl at toreplace
-  \fi 
-  \in@{,#1,}{,appendix,}%
-  \ifin@
-    \bbl at patchchapter
-    \global\bbl at csarg\let{appxfmt@\languagename}\bbl at toreplace
-  \fi 
-  %
-  \in@{,#1,}{,figure,table,}%
-  \ifin@
-    \toks@\expandafter{\bbl at toreplace}%
-    \bbl at exp{\gdef\<fnum@#1>{\the\toks@}}%
-  \fi
-  %
-  \in@{enumerate.}{#1}%
+  \in@{map.}{#1}%
   \ifin@
-    \def\bbl at tempa{#1}%
-    \bbl at replace\bbl at tempa{enumerate.}{}%
-    \toks@\expandafter{\bbl at toreplace}%
+    \def\bbl at tempc{#1}%
+    \bbl at replace\bbl at tempc{map.}{}%
+    \in@{,#2,}{,arabic,roman,Roman,alph,Alph,}%
     \bbl at exp{%
-      \\\bbl at add\<extras\languagename>{%
-        \\\babel at save\<labelenum\romannumeral\bbl at tempa>%
-        \def\<labelenum\romannumeral\bbl at tempa>{\the\toks@}}%
-      \\\bbl at toglobal\<extras\languagename>}%
+      \gdef\<bbl at map@\bbl at tempc @\languagename>%
+        {\ifin@\<#2>\else\\\localecounter{#2}\fi}}%
+    \bbl at foreach\bbl at list@the{%
+      \bbl at exp{\let\\\bbl at tempd\<the##1>}%
+      \bbl at exp{%
+        \\\bbl at sreplace\<the##1>%
+          {\<\bbl at tempc>{##1}}{\\\bbl at map@cnt{\bbl at tempc}{##1}}%
+        \\\bbl at sreplace\<the##1>%
+          {\<\@empty @\bbl at tempc>\<c@##1>}{\\\bbl at map@cnt{\bbl at tempc}{##1}}}%
+      \expandafter\ifx\csname the##1\endcsname\bbl at tempd\else
+        \toks@\expandafter\expandafter\expandafter{%
+          \csname the##1\endcsname}
+        \expandafter\xdef\csname the##1\endcsname{{\the\toks@}}%
+      \fi}%
+    %
+  \else
+    \def\bbl at toreplace{#2}%
+    \bbl at replace\bbl at toreplace{[ ]}{\nobreakspace{}}%
+    \bbl at replace\bbl at toreplace{[[}{\bbl at bktoname}%
+    \bbl at replace\bbl at toreplace{[}{\bbl at bktothe}% 
+    \bbl at replace\bbl at toreplace{]]}{\@@}% 
+    \bbl at replace\bbl at toreplace{]}{\@@}% 
+    \in@{,#1,}{,chapter,}%
+    \ifin@
+      \bbl at patchchapter
+      \global\bbl at csarg\let{chapfmt@\languagename}\bbl at toreplace
+    \fi 
+    \in@{,#1,}{,appendix,}%
+    \ifin@
+      \bbl at patchchapter
+      \global\bbl at csarg\let{appxfmt@\languagename}\bbl at toreplace
+    \fi 
+    \in@{,#1,}{,part,}%
+    \ifin@
+      \bbl at patchpart
+      \global\bbl at csarg\let{partfmt@\languagename}\bbl at toreplace
+    \fi 
+    \in@{,#1,}{,figure,table,}%
+    \ifin@
+      \toks@\expandafter{\bbl at toreplace}%
+      \bbl at exp{\gdef\<fnum@#1>{\the\toks@}}%
+    \fi
+    %
+    \in@{enumerate.}{#1}%
+    \ifin@
+      \def\bbl at tempa{#1}%
+      \bbl at replace\bbl at tempa{enumerate.}{}%
+      \toks@\expandafter{\bbl at toreplace}%
+      \bbl at exp{%
+        \\\bbl at add\<extras\languagename>{%
+          \\\babel at save\<labelenum\romannumeral\bbl at tempa>%
+          \def\<labelenum\romannumeral\bbl at tempa>{\the\toks@}}%
+        \\\bbl at toglobal\<extras\languagename>}%
+    \fi
   \fi}
 %    \end{macrocode}
 %% 
 % To show correctly some captions in a few languages, we need to patch
 % some internal macros, because the order is hardcoded. For example, in
-% Japanese the chapter number is surrounded by two string, while
-% in Hungarian is placed after. 
+% Japanese the chapter number is surrounded by two string, while in
+% Hungarian is placed after. These replacement works in many classes,
+% but not all.
 
 %    \begin{macrocode}
 \def\bbl at chaptype{chap}
@@ -11078,7 +11139,6 @@ help from Bernd Raichle, for which I am grateful.
     \global\let\bbl at patchchapter\relax
     \bbl at add\appendix{\def\bbl at chaptype{appx}}% Not harmful, I hope
     \bbl at toglobal\appendix
-    % This replacement works in many classes, but not all
     \bbl at sreplace\@makechapterhead
       {\@chapapp\space\thechapter}%
       {\bbl at chapterformat}%
@@ -11088,6 +11148,20 @@ help from Bernd Raichle, for which I am grateful.
         {\@chapapp\space\thechapter}
         {\@nameuse{bbl@\bbl at chaptype fmt@\languagename}}}}
 \fi
+\ifx\@part\@undefined
+  \let\bbl at patchpart\relax
+\else
+  \def\bbl at patchpart{%
+    \global\let\bbl at patchpart\relax
+    \bbl at sreplace\@part
+      {\partname\nobreakspace\thepart}%
+      {\bbl at partformat}%
+    \bbl at toglobal\@part
+    \gdef\bbl at partformat{%
+      \bbl at ifunset{bbl at partfmt@\languagename}%
+        {\partname\nobreakspace\thepart}
+        {\@nameuse{bbl at partfmt@\languagename}}}}
+\fi
 %    \end{macrocode}
 %
 % \textbf{Date.} TODO. Document
diff --git a/babel.ins b/babel.ins
index 9f96a4d..1228ffb 100644
--- a/babel.ins
+++ b/babel.ins
@@ -26,7 +26,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %%
-\def\filedate{2020/07/27}
+\def\filedate{2020/07/31}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 57b111f..a678b62 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 7093831..358805b 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2020/07/27 v3.47.2081]
+\ProvidesFile{bbcompat.dtx}[2020/07/31 v3.47.2085]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/locale/hu/babel-hu.ini b/locale/hu/babel-hu.ini
index 8146138..a425977 100644
--- a/locale/hu/babel-hu.ini
+++ b/locale/hu/babel-hu.ini
@@ -76,6 +76,7 @@ glossary = Sz\'ojegyz\'ek
 
 [labels]
 chapter = [chapter]. [[chapter]]
+appendix = [chapter]. [[appendix]]
 
 [date.gregorian]
 date.long = [y].[ ][MMMM] [d].
diff --git a/locale/ja/babel-ja.ini b/locale/ja/babel-ja.ini
index 8c1636d..9b708bd 100644
--- a/locale/ja/babel-ja.ini
+++ b/locale/ja/babel-ja.ini
@@ -60,7 +60,7 @@ glossary = 用語集
 
 [labels]
 chapter = [[prechapter]] [chapter] [[postchapter]]
-; part = [[prepart]] [part] [[postpart]]
+part = [[prepart]] [part] [[postpart]]
 ; enumerate.1 = [enumi])
 
 [captions.licr]
diff --git a/locale/ko/babel-ko.ini b/locale/ko/babel-ko-Hani.ini
similarity index 93%
copy from locale/ko/babel-ko.ini
copy to locale/ko/babel-ko-Hani.ini
index 425073a..0edc969 100644
--- a/locale/ko/babel-ko.ini
+++ b/locale/ko/babel-ko-Hani.ini
@@ -11,53 +11,52 @@
 
 [identification]
 charset = utf8
-version = 1.7
+version = 1.0
 date = 2020-07-10
 name.local = 한국어
 name.english = Korean
-name.babel = korean
+name.babel = korean-han korean-hani
 name.polyglossia = korean
 tag.bcp47 = ko
 language.tag.bcp47 = ko
-tag.bcp47.likely = ko-Kore-KR
 tag.opentype = KOR
-script.name = Korean
+script.name = Han
 script.name.opentype = CJK
-script.tag.bcp47 = Kore
-script.tag.opentype = hang
+script.tag.bcp47 = Hani
+script.tag.opentype = hani
 level = 1
 encodings = 
 derivate = no
 
 [captions]
 ; names based on kotex
-preface = 서문
-ref = 참고 문헌
-abstract = 요 약
-bib = 참고 문헌
-prechapter = 제
-postchapter = 장
-appendix = 부록
-contents = 차 례
-listfigure = 그림 차례
-listtable = 표 차례
-index = 찾아보기
+preface = 序文
+ref = 參考 文獻
+abstract = 要 約
+bib = 著書~目錄
+prechapter = 第
+postchapter = 章
+appendix = 附錄
+contents = 目 次
+listfigure = 그림 目次
+listtable = 表 目次
+index = 索引
 figure = 그림
-table = 표
-prepart = 제
-postpart = 편
-encl = 동봉물
-cc = 사본
-headto = 받는이
-page = 페이지
-; see = \을~참고
+table = 表
+prepart = 第
+postpart = 篇
+encl = 同封物
+cc = 寫本
+headto = 受信人
+page = 面
+; see = \을~參考
 see = 
-; also = \을~함께~참고
+; also = \을~參考
 also = 
-proof = 증명
-glossary = 용어집
-presection = 제
-postsection = 절
+proof = 證明
+glossary = 語 彙
+presection = 第
+postsection = 節
 
 [captions.licr]
 preface = 
@@ -201,5 +200,3 @@ cjk-earthly-branch = 子 丑 寅 卯 辰 巳 午 未 申 酉 戌 亥
 cjk-heavenly-stem  = 甲 乙 丙 丁 戊 己 庚 辛 壬 癸
 fullwidth.lower.alpha = a b c d e f g h i j k l m n o p q r s t u v w x y z
 fullwidth.upper.alpha = A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
-
-
diff --git a/locale-templates/aa/babel-afar.tex b/locale/ko/babel-korean-han.tex
similarity index 89%
copy from locale-templates/aa/babel-afar.tex
copy to locale/ko/babel-korean-han.tex
index 484449c..3f20133 100644
--- a/locale-templates/aa/babel-afar.tex
+++ b/locale/ko/babel-korean-han.tex
@@ -7,6 +7,6 @@
     {Just use babel as documented.}%
   \stop
 \fi
-\BabelBeforeIni{aa}{%
+\BabelBeforeIni{ko-Hani}{%
 }
 \endinput
\ No newline at end of file
diff --git a/locale-templates/aa/babel-afar.tex b/locale/ko/babel-korean-hani.tex
similarity index 89%
copy from locale-templates/aa/babel-afar.tex
copy to locale/ko/babel-korean-hani.tex
index 484449c..3f20133 100644
--- a/locale-templates/aa/babel-afar.tex
+++ b/locale/ko/babel-korean-hani.tex
@@ -7,6 +7,6 @@
     {Just use babel as documented.}%
   \stop
 \fi
-\BabelBeforeIni{aa}{%
+\BabelBeforeIni{ko-Hani}{%
 }
 \endinput
\ No newline at end of file
diff --git a/locale/zh/babel-zh-Hans.ini b/locale/zh/babel-zh-Hans.ini
index ae36373..2cf1c1e 100644
--- a/locale/zh/babel-zh-Hans.ini
+++ b/locale/zh/babel-zh-Hans.ini
@@ -8,6 +8,7 @@
 ; * Common Locale Data Repository (license Unicode):
 ;   http://cldr.unicode.org/
 ;   http://unicode.org/copyright.html
+; * CTEX
 
 [identification]
 charset = utf8
@@ -30,25 +31,29 @@ derivate = no
 
 [captions]
 preface = 
-ref = 
-abstract = 
-bib = 
+ref = 参考文献
+abstract = 摘要
+bib = 参考文献
 chapter = 
-appendix = 
-contents = 
-listfigure = 
-listtable = 
-index = 
-figure = 
-table = 
+prechapter = 第
+postchapter = 部分
+appendix = 附录
+contents = 目录
+listfigure = 插图
+listtable = 表格
+index = 索引
+figure = 图
+table = 表
 part = 
+prepart = 第
+postpart = 章
 encl = 
 cc = 
 headto = 
 page = 
 see = 
 also = 
-proof = 
+proof = 证明
 glossary = 
 
 [captions.licr]
diff --git a/locale/zh/babel-zh.ini b/locale/zh/babel-zh.ini
index 0bf15d3..5e66195 100644
--- a/locale/zh/babel-zh.ini
+++ b/locale/zh/babel-zh.ini
@@ -8,6 +8,7 @@
 ; * Common Locale Data Repository (license Unicode):
 ;   http://cldr.unicode.org/
 ;   http://unicode.org/copyright.html
+; * CTEX
 
 [identification]
 charset = utf8
@@ -31,25 +32,29 @@ derivate = no
 
 [captions]
 preface = 
-ref = 
-abstract = 
-bib = 
+ref = 参考文献
+abstract = 摘要
+bib = 参考文献
 chapter = 
-appendix = 
-contents = 
-listfigure = 
-listtable = 
-index = 
-figure = 
-table = 
+prechapter = 第
+postchapter = 部分
+appendix = 附录
+contents = 目录
+listfigure = 插图
+listtable = 表格
+index = 索引
+figure = 图
+table = 表
 part = 
+prepart = 第
+postpart = 章
 encl = 
 cc = 
 headto = 
 page = 
 see = 
 also = 
-proof = 
+proof = 证明
 glossary = 
 
 [captions.licr]





More information about the latex3-commits mailing list.