summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-03-15 19:57:15 +0000
committerKarl Berry <karl@freefriends.org>2022-03-15 19:57:15 +0000
commitc5d9cbb74889579ae3d1f2fa05533487e8cde1e3 (patch)
tree7ebe02fb39066348e4c9a47b5d46276607119578
parent4155409bc20721f84a76ef9847047019aee8e8f4 (diff)
bxorigcapt (15mar22) (branch)
git-svn-id: svn://tug.org/texlive/branches/branch2021.final@62715 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/bxorigcapt/LICENSE2
-rw-r--r--Master/texmf-dist/doc/latex/bxorigcapt/README.md25
-rw-r--r--Master/texmf-dist/tex/latex/bxorigcapt/bxorigcapt.sty65
3 files changed, 63 insertions, 29 deletions
diff --git a/Master/texmf-dist/doc/latex/bxorigcapt/LICENSE b/Master/texmf-dist/doc/latex/bxorigcapt/LICENSE
index 3c57f37df63..b9164b46b10 100644
--- a/Master/texmf-dist/doc/latex/bxorigcapt/LICENSE
+++ b/Master/texmf-dist/doc/latex/bxorigcapt/LICENSE
@@ -1,6 +1,6 @@
The MIT License
-Copyright (c) 2017-2018 Takayuki YATO (aka. "ZR")
+Copyright (c) 2016-2022 Takayuki YATO (aka. "ZR")
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/Master/texmf-dist/doc/latex/bxorigcapt/README.md b/Master/texmf-dist/doc/latex/bxorigcapt/README.md
index 2f2e9275db8..577af79fa96 100644
--- a/Master/texmf-dist/doc/latex/bxorigcapt/README.md
+++ b/Master/texmf-dist/doc/latex/bxorigcapt/README.md
@@ -55,24 +55,31 @@ class treated as the caption names for a specific language.
### Package Loading
- \usepackage[<language>]{bxorigcapt}
+ \usepackage[<option>,...]{bxorigcapt}
-The package option specifies a Babel language, and requires that the
-caption names provided by the document class (actually the ones that are
-effective when this package is loaded) should be used as the caption names
-for that language.
+Available options are:
-The option can be omitted; in that case, the main language of Babel will
-be assumed.
+ - a Babel language name: Specifies the target language. The default
+ target language is the main language of Babel.
+ - `warn`: Issues a warning (instead of an info) if Babel is never
+ loaded in the preamble.
### Usage
-For present, this package has no public commands. All the settings are
-done through the package option.
+Once this package is loaded, the caption names provided by the document
+class (actually the ones that are effective when this package is loaded)
+will be used as the caption names for the target language (which is
+specified by the package option).
+
+This package has no public commands.
+
Revision History
----------------
+ * Version 0.4 〈2022/03/12〉
+ - Adjustment for new version of Babel.
+ - Add option `warn`.
* Version 0.3 〈2018/09/05〉
- Add support for Polyglossia.
* Version 0.2a 〈2017/05/03〉
diff --git a/Master/texmf-dist/tex/latex/bxorigcapt/bxorigcapt.sty b/Master/texmf-dist/tex/latex/bxorigcapt/bxorigcapt.sty
index 631741791dc..14faeccb3ab 100644
--- a/Master/texmf-dist/tex/latex/bxorigcapt/bxorigcapt.sty
+++ b/Master/texmf-dist/tex/latex/bxorigcapt/bxorigcapt.sty
@@ -1,7 +1,7 @@
%%
%% This is file 'bxorigcapt.sty'.
%%
-%% Copyright (c) 2017-2018 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2016-2022 Takayuki YATO (aka. "ZR")
%% GitHub: https://github.com/zr-tex8r
%% Twitter: @zr_tex8r
%%
@@ -10,7 +10,7 @@
%% package declaration
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxorigcapt}[2018/09/05 v0.2a]
+\ProvidesPackage{bxorigcapt}[2022/03/12 v0.4]
\def\bxoc@pkgname{bxorigcapt}
\providecommand*\bxDebug[1]{}
@@ -38,41 +38,61 @@
%% \bxoc@target@lang
\let\bxoc@target@lang\relax
-%% language options
+%% \bxoc@warn@or@info
+\let\bxoc@warn@or@info\PackageInfo
+
+%% handle options
+% 'warn'
+\DeclareOption{warn}{%
+ \let\bxoc@warn@or@info\PackageWarning
+}
+% language options
\DeclareOption*{%
\edef\bxoc@target@lang{\CurrentOption}%
}
% dispatch
\ProcessOptions*
+\bxDebug{target language = %
+ \ifx\bxoc@target@lang\relax (main)\else \bxoc@target@lang\fi}
%--------------------------------------- environment
+%% switch 'bxoc@etoolbox@available'
+\newif\ifbxoc@etoolbox@available
%% switch 'bxoc@polyglossia@available'
\newif\ifbxoc@polyglossia@available
\begingroup
- \@tempswafalse
- % engine check
\def\bxoc@next#1{%
\edef\bxoc@tmpa{\string#1}\edef\bxoc@tmpb{\meaning#1}%
\ifx\bxoc@tmpa\bxoc@tmpb \@tempswatrue \fi
}
- \bxoc@next\XeTeXversion
- \bxoc@next\luatexversion
- % file check
+ %% set 'bxoc@etoolbox@available'
+ \@tempswafalse
+ \bxoc@next\eTeXversion
\if@tempswa
- \IfFileExists{polyglossia.sty}{}{\@tempswafalse}
\IfFileExists{etoolbox.sty}{}{\@tempswafalse}
\fi
\if@tempswa
- \bxDebug{Polyglossia might be loaded}
- \global\bxoc@polyglossia@availabletrue
+ \bxDebug{etoolbox is available}
+ \global\bxoc@etoolbox@availabletrue
+ %% set 'bxoc@polyglossia@available'
+ \@tempswafalse
+ \bxoc@next\XeTeXversion
+ \bxoc@next\luatexversion
+ \if@tempswa
+ \IfFileExists{polyglossia.sty}{}{\@tempswafalse}
+ \fi
+ \if@tempswa
+ \bxDebug{Polyglossia is available}
+ \global\bxoc@polyglossia@availabletrue
+ \fi
\fi
\endgroup
%--------------------------------------- general
%% packages
-\ifbxoc@polyglossia@available
+\ifbxoc@etoolbox@available
\RequirePackage{etoolbox}\relax
\fi
@@ -137,7 +157,7 @@
\@onlypreamble\bxoc@babel@hook
\let\bxoc@babel@hook\@empty
\bxoc@if@babel@or@polyglossia@loaded{%
- \ifbxoc@polyglossia@available
+ \ifbxoc@etoolbox@available
\AtEndPreamble{%
\bxoc@check@conflict
\bxoc@babel@hook
@@ -146,15 +166,15 @@
\AtEndOfPackage{\bxoc@babel@hook}%
\fi
}{%else
- \ifbxoc@polyglossia@available
+ \ifbxoc@etoolbox@available
\AtEndPreamble{%
\bxoc@if@babel@or@polyglossia@loaded{%
\bxoc@check@conflict
\bxoc@babel@hook
}{%else
- \PackageWarning\bxoc@pkgname
+ \bxoc@warn@or@info\bxoc@pkgname
{Neither Polyglossia nor Babel is\MessageBreak
- loaded,}%
+ loaded, reported}%
}%
}%
\else
@@ -162,8 +182,8 @@
\@ifpackageloaded{babel}{%
\bxoc@babel@hook
}{%else
- \PackageWarning\bxoc@pkgname
- {Babel is not loaded,}%
+ \bxoc@warn@or@info\bxoc@pkgname
+ {Babel is not loaded,\MessageBreak reported}%
}%
}%
\fi
@@ -242,7 +262,7 @@
\@namedef{date\bxoc@target@lang}{}%
\fi
\fi
- \bxDebug{target=\bxoc@target@lang}%
+ \bxDebug{target language = \bxoc@target@lang}%
\expandafter\ifx\csname date\bxoc@target@lang\endcsname\relax
\PackageError\bxoc@pkgname
{Language '\bxoc@target@lang' not defined}%
@@ -256,6 +276,13 @@
\bxoc@restore@date}%
\expandafter\g@addto@macro\csname captions\bxoc@target@lang\endcsname{%
\bxoc@restore@captions}%
+ \ifbxoc@etoolbox@available
+ % do not do 'ensure'!
+ \ifcsundef{bbl@e@\bxoc@target@lang}{}{%else
+ \bxDebug{ensure for \bxoc@target@lang\space invalidated}%
+ \csundef{bbl@e@\bxoc@target@lang}%
+ }%
+ \fi
}
%% Saves the current captions