texlive[63058] Master/texmf-dist: bxorigcapt (17apr22)

commits+karl at tug.org commits+karl at tug.org
Sun Apr 17 22:01:37 CEST 2022


Revision: 63058
          http://tug.org/svn/texlive?view=revision&revision=63058
Author:   karl
Date:     2022-04-17 22:01:37 +0200 (Sun, 17 Apr 2022)
Log Message:
-----------
bxorigcapt (17apr22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/bxorigcapt/README.md
    trunk/Master/texmf-dist/tex/latex/bxorigcapt/bxorigcapt.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/bxorigcapt/bxorigcapt.pdf
    trunk/Master/texmf-dist/doc/latex/bxorigcapt/bxorigcapt.tex

Modified: trunk/Master/texmf-dist/doc/latex/bxorigcapt/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxorigcapt/README.md	2022-04-17 19:58:40 UTC (rev 63057)
+++ trunk/Master/texmf-dist/doc/latex/bxorigcapt/README.md	2022-04-17 20:01:37 UTC (rev 63058)
@@ -12,9 +12,10 @@
 ### System requirement
 
   * TeX format: LaTeX.
-  * TeX engine: Anything.
+  * TeX engine: Any engine with e-TeX extension.
   * Dependent packages:
       - babel or polyglossia
+      - etoolbox v2.1+
 
 ### Installation
 
@@ -24,59 +25,22 @@
 
 This package is distributed under the MIT License.
 
+
 The bxorigcapt Package
 ----------------------
 
-### Introduction
+See the manual bxorigcapt.pdf for detail.
 
-Suppose you have designed a document class tailored for the Esperanto
-language. The class has the following definition of caption names and you
-like it:
 
-    \newcommand\contentsname{Tabelo de Enhavo}
-
-If a document is written solely in Esperanto, then there is no need to
-employ the Babel package. (Yes, the document class should select the
-hyphenation rule for the language.)  However, when you want to create
-document that contains Esperanto and German, then you have to utilize
-Babel, to have correct hyphenations for both languages.
-
-    \usepackage[ngerman,esperanto]{babel}
-
-But unfortunately, this changes `\contentsname` from “Tabelo de Enhavo”
-(what you have chosen) to “Enhavo” (what is declared in the language
-definition file of Babel), which is unfavorable.
-
-In fact, when using a document class for a specific language, the most
-suitable caption names *for that language* should be the ones provided by
-the class. The bxorigcapt package realizes this natual request, that is,
-it enables you to make the caption names declared in the current document
-class treated as the caption names for a specific language.
-
-### Package Loading
-
-    \usepackage[<option>,...]{bxorigcapt}
-
-Available options are:
-
-  - 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
-
-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 1.0  〈2022/04/10〉
+      - Now e-TeX and etoolbox are required.
+      - Add option `main`.
+  * Version 0.4a 〈2022/04/08〉
+      - Add option `nowarn`.
+      - Bug fix.
   * Version 0.4  〈2022/03/12〉
       - Adjustment for new version of Babel.
       - Add option `warn`.

Added: trunk/Master/texmf-dist/doc/latex/bxorigcapt/bxorigcapt.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/bxorigcapt/bxorigcapt.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxorigcapt/bxorigcapt.pdf	2022-04-17 19:58:40 UTC (rev 63057)
+++ trunk/Master/texmf-dist/doc/latex/bxorigcapt/bxorigcapt.pdf	2022-04-17 20:01:37 UTC (rev 63058)

Property changes on: trunk/Master/texmf-dist/doc/latex/bxorigcapt/bxorigcapt.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/bxorigcapt/bxorigcapt.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxorigcapt/bxorigcapt.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/bxorigcapt/bxorigcapt.tex	2022-04-17 20:01:37 UTC (rev 63058)
@@ -0,0 +1,112 @@
+\documentclass[a4paper]{article}
+\usepackage[scale=0.75]{geometry}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern,textcomp}
+\usepackage{color}
+\definecolor{myblue}{rgb}{0,0,0.75}
+\definecolor{mygreen}{rgb}{0,0.45,0}
+\usepackage[colorlinks]{hyperref}
+\hypersetup{linkcolor=myblue,urlcolor=mygreen,
+  pdftitle={The bxorigcapt package},
+  pdfauthor={Takayuki YATO}}
+\usepackage{bxtexlogo}
+\bxtexlogoimport{*}
+\usepackage{shortvrb}
+\MakeShortVerb{\|}
+\newcommand{\PkgVersion}{1.0}
+\newcommand{\PkgDate}{2022/04/10}
+\newcommand{\Pkg}[1]{\textsf{#1}}
+\newcommand{\Meta}[1]{$\langle$#1$\rangle$}
+\newcommand{\Note}{\par\noindent\emph{Note.}}
+\newcommand{\Means}{:\quad}
+%-----------------------------------------------------------
+\begin{document}
+\title{The \Pkg{bxorigcapt} package}
+\author{Takayuki YATO\quad (aka.~``ZR'')}
+\date{v\PkgVersion\quad[\PkgDate]}
+\maketitle
+%\tableofcontents
+\begin{abstract}
+This package forces the caption names (|\chaptername|, |\today|, etc.)\ %
+declared by the document class in use to be used as the caption names
+for a specific language introduced by the Babel package.
+
+Starting from version 0.3, this package also supports Polyglossia.
+\end{abstract}
+
+%===========================================================
+\section{Introduction}
+\label{sec:Introduction}
+
+Suppose you have designed a document class
+tailored for the Esperanto language.
+The class has the following definition of caption names
+and you like it:
+\begin{quote}
+|\newcommand\contentsname{Tabelo de Enhavo}|
+\end{quote}
+
+If a document is written solely in Esperanto,
+then there is no need to employ the Babel package.
+(Yes, the document class should select the hyphenation rule
+for the language.)
+However, when you want to create document
+that contains Esperanto and German,
+then you have to utilize Babel,
+to have correct hyphenations for both languages.
+\begin{quote}
+|\usepackage[ngerman,esperanto]{babel}|
+\end{quote}
+
+But unfortunately, this changes |\contentsname|
+from ``Tabelo de Enhavo'' (what you have chosen)
+to ``Enhavo''
+(what is declared in the language definition file of Babel),
+which is unfavorable.
+
+In fact, when using a document class for a specific language,
+the most suitable caption names \emph{for that language}
+should be the ones provided by the class.
+The \Pkg{bxorigcapt} package realizes this natural request,
+that is, it enables you
+to make the caption names declared in the current document class
+treated as the caption names for a specific language.
+
+
+%===========================================================
+\section{Package Loading}
+\label{sec:Package-Loading}
+
+\begin{quote}
+|\usepackage[|\Meta{option}|,...]{bxorigcapt}|
+\end{quote}
+
+Available options are:
+\begin{itemize}
+\item |main| (default)\Means
+  Sets the main language of Babel to the default target language.
+\item \emph{a Babel language name}\Means
+  Specifies the target language.
+\item |warn|\Means
+  Issues a warning (instead of an info)
+  if Babel is never loaded in the preamble.
+\item |nowarn| (default)\Means
+  Negation of |warn|.
+\end{itemize}
+
+
+%===========================================================
+\section{Usage}
+\label{sec:Usage}
+
+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.
+
+
+%===========================================================
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/bxorigcapt/bxorigcapt.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/bxorigcapt/bxorigcapt.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxorigcapt/bxorigcapt.sty	2022-04-17 19:58:40 UTC (rev 63057)
+++ trunk/Master/texmf-dist/tex/latex/bxorigcapt/bxorigcapt.sty	2022-04-17 20:01:37 UTC (rev 63058)
@@ -10,9 +10,9 @@
 
 %% package declaration
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxorigcapt}[2022/03/12 v0.4]
+\ProvidesPackage{bxorigcapt}[2022/04/10 v1.0]
 \def\bxoc at pkgname{bxorigcapt}
-\providecommand*\bxDebug[1]{}
+\providecommand\bxDebug[1]{}
 
 %% code guard
 \edef\bxoc at restore@codes{%
@@ -42,10 +42,17 @@
 \let\bxoc at warn@or at info\PackageInfo
 
 %% handle options
-% 'warn'
+% 'warn'/'nowarn'
 \DeclareOption{warn}{%
   \let\bxoc at warn@or at info\PackageWarning
 }
+\DeclareOption{nowarn}{%
+  \let\bxoc at warn@or at info\PackageInfo
+}
+% 'main'
+\DeclareOption{main}{%
+  \let\bxoc at target@lang\relax
+}
 % language options
 \DeclareOption*{%
   \edef\bxoc at target@lang{\CurrentOption}%
@@ -57,45 +64,15 @@
 
 %--------------------------------------- environment
 
-%% switch 'bxoc at etoolbox@available'
-\newif\ifbxoc at etoolbox@available
-%% switch 'bxoc at polyglossia@available'
-\newif\ifbxoc at polyglossia@available
-\begingroup
-  \def\bxoc at next#1{%
-    \edef\bxoc at tmpa{\string#1}\edef\bxoc at tmpb{\meaning#1}%
-    \ifx\bxoc at tmpa\bxoc at tmpb \@tempswatrue \fi
-  }
-  %% set 'bxoc at etoolbox@available'
-  \@tempswafalse
-  \bxoc at next\eTeXversion
-  \if at tempswa
-    \IfFileExists{etoolbox.sty}{}{\@tempswafalse}
-  \fi
-  \if at tempswa
-    \bxDebug{etoolbox is available}
-    \global\bxoc at etoolbox@availabletrue
-    %% set 'bxoc at polyglossia@available'
-    \@tempswafalse
-    \bxoc at next\XeTeXversion
-    \bxoc at next\luatexversion
-    \if at tempswa
-      \IfFileExists{polyglossia.sty}{}{\@tempswafalse}
-    \fi
-    \if at tempswa
-      \bxDebug{Polyglossia is available}
-      \global\bxoc at polyglossia@availabletrue
-    \fi
-  \fi
-\endgroup
+%% packages
+\RequirePackage{etoolbox}[2011/01/03]% v2.1
+\ifx\numdef\@undefined % etoolbox is aborted
+  \PackageWarningNoLine
+   {Package loading is aborted}
+\expandafter\endinput\fi\relax
 
 %--------------------------------------- general
 
-%% packages
-\ifbxoc at etoolbox@available
-  \RequirePackage{etoolbox}\relax
-\fi
-
 %% \bxoc at name@list
 % The list of caption names.
 \@onlypreamble\bxoc at name@list
@@ -116,7 +93,8 @@
 %%<+> \bxorigcaptDeprecateCommand{<csname>,...}
 \@onlypreamble\bxorigcaptDeprecateCommand
 \newcommand*\bxorigcaptDeprecateCommand[1]{%
-  \edef\bxoc at deprecated@ldf at list{\bxoc at deprecated@ldf at list,#1}}
+  \eappto\bxoc at deprecated@ldf at list{,#1}%
+}
 
 %--------------------------------------- hook
 
@@ -133,7 +111,8 @@
          {Both Babel and Polyglossia are loaded!\MessageBreak
           Such usage is not supported}%
          {All the function of \bxoc at pkgname\space
-          is invalidated.\MessageBreak\@ehc}%
+              is invalidated.\MessageBreak
+          \@ehc}%
         % annihilate
         \let\bxoc at babel@hook\relax
         \let\bxoc at check@conflict\relax
@@ -157,36 +136,21 @@
 \@onlypreamble\bxoc at babel@hook
 \let\bxoc at babel@hook\@empty
 \bxoc at if@babel at or@polyglossia at loaded{%
-  \ifbxoc at etoolbox@available
-    \AtEndPreamble{%
+  \AtEndPreamble{%
+    \bxoc at check@conflict
+    \bxoc at babel@hook
+  }%
+}{%else
+  \AtEndPreamble{%
+    \bxoc at if@babel at or@polyglossia at loaded{%
       \bxoc at check@conflict
       \bxoc at babel@hook
+    }{%else
+      \bxoc at warn@or at info\bxoc at pkgname
+       {Neither Polyglossia nor Babel is\MessageBreak
+        loaded, reported}%
     }%
-  \else
-    \AtEndOfPackage{\bxoc at babel@hook}%
-  \fi
-}{%else
-  \ifbxoc at etoolbox@available
-    \AtEndPreamble{%
-      \bxoc at if@babel at or@polyglossia at loaded{%
-        \bxoc at check@conflict
-        \bxoc at babel@hook
-      }{%else
-        \bxoc at warn@or at info\bxoc at pkgname
-         {Neither Polyglossia nor Babel is\MessageBreak
-          loaded, reported}%
-      }%
-    }%
-  \else
-    \AtBeginDocument{%
-      \@ifpackageloaded{babel}{%
-        \bxoc at babel@hook
-      }{%else
-        \bxoc at warn@or at info\bxoc at pkgname
-         {Babel is not loaded,\MessageBreak reported}%
-      }%
-    }%
-  \fi
+  }%
 }
 
 %--------------------------------------- deprecated ldf stuffs
@@ -196,11 +160,11 @@
 \def\bxoc at clear@deprecated at ldf{%
   \begingroup
     \@for\bxoc at tmpa:=\bxoc at deprecated@ldf at list\do{%
-      \ifx\@bxoc at tmpa\@empty\else
-        \expandafter\ifx\csname \bxoc at tmpa\endcsname\relax\else
+      \ifx\bxoc at tmpa\@empty\else
+        \ifcsdef{\bxoc at tmpa}{%
           \bxDebug{Smashed \@backslashchar\bxoc at tmpa}%
-          \global\expandafter\let\csname\bxoc at tmpa\endcsname\@empty
-        \fi
+          \global\cslet{\bxoc at tmpa}\@empty
+        }{}%
       \fi
     }%
   \endgroup
@@ -209,7 +173,7 @@
 \@onlypreamble\bxoc at clear@deprecated at ldf@a
 \def\bxoc at clear@deprecated at ldf@a{%
   \global\let\bxoc at clear@deprecated at ldf@a\relax
-  \gdef\bxorigcaptDeprecateCommand##1{%
+  \gdef\bxorigcaptDeprecateCommand##1{% modified
     \edef\bxoc at deprecated@ldf at list{##1}%
     \bxoc at clear@deprecated at ldf}}
 \g at addto@macro\bxoc at babel@hook{\bxoc at clear@deprecated at ldf}
@@ -229,13 +193,13 @@
   \@for\bxoc at tmpa:=\bxoc at name@list\do{%
     \edef\bxoc at next{%
       \noexpand\g at addto@macro\noexpand\bxoc at save@captions{%
-        \let\expandafter\noexpand\csname bxoc@@\bxoc at tmpa name\endcsname
-            \expandafter\noexpand\csname\bxoc at tmpa name\endcsname}%
+        \let\expandonce{\csname bxoc@@\bxoc at tmpa name\endcsname}%
+            \expandonce{\csname\bxoc at tmpa name\endcsname}}%
     }\bxoc at next
     \edef\bxoc at next{%
       \noexpand\g at addto@macro\noexpand\bxoc at restore@captions{%
-        \let\expandafter\noexpand\csname \bxoc at tmpa name\endcsname
-            \expandafter\noexpand\csname bxoc@@\bxoc at tmpa name\endcsname}%
+        \let\expandonce{\csname\bxoc at tmpa name\endcsname}%
+            \expandonce{\csname bxoc@@\bxoc at tmpa name\endcsname}}%
     }\bxoc at next
   }
 \endgroup
@@ -258,31 +222,27 @@
       \PackageError\bxoc at pkgname
        {The main language is not set}%
        {\@ehc}%
-      \def\bxoc at target@lang{?bxoc}
-      \@namedef{date\bxoc at target@lang}{}%
+      \def\bxoc at target@lang{?bxoc}%
+      \cslet{date\bxoc at target@lang}\@empty
     \fi
   \fi
   \bxDebug{target language = \bxoc at target@lang}%
-  \expandafter\ifx\csname date\bxoc at target@lang\endcsname\relax
+  \ifcsundef{date\bxoc at target@lang}{%
     \PackageError\bxoc at pkgname
      {Language '\bxoc at target@lang' not defined}%
-      \@ehc
-    \@namedef{date\bxoc at target@lang}{}%
-  \fi
-  \expandafter\ifx\csname captions\bxoc at target@lang\endcsname\relax
-    \@namedef{captions\bxoc at target@lang}{}%
-  \fi
-  \expandafter\g at addto@macro\csname date\bxoc at target@lang\endcsname{%
-    \bxoc at restore@date}%
-  \expandafter\g at addto@macro\csname captions\bxoc at target@lang\endcsname{%
-    \bxoc at restore@captions}%
-  \ifbxoc at etoolbox@available
-    % do not do 'ensure'!
-    \ifcsundef{bbl at e@\bxoc at target@lang}{}{%else
-      \bxDebug{ensure for \bxoc at target@lang\space invalidated}%
-      \csundef{bbl at e@\bxoc at target@lang}%
-    }%
-  \fi
+     {\@ehc}%
+    \cslet{date\bxoc at target@lang}\@empty
+  }{}%
+  \ifcsundef{captions\bxoc at target@lang}{%
+    \cslet{captions\bxoc at target@lang}\@empty
+  }{}%
+  \csappto{date\bxoc at target@lang}{\bxoc at restore@date}%
+  \csappto{captions\bxoc at target@lang}{\bxoc at restore@captions}%
+  % do not do 'ensure'!
+  \ifcsundef{bbl at e@\bxoc at target@lang}{}{%else
+    \bxDebug{ensure for \bxoc at target@lang\space invalidated}%
+    \csundef{bbl at e@\bxoc at target@lang}%
+  }%
 }
 
 %% Saves the current captions



More information about the tex-live-commits mailing list.