texlive[63354] Master/texmf-dist: bxghost (21may22)

commits+karl at tug.org commits+karl at tug.org
Sat May 21 22:18:01 CEST 2022


Revision: 63354
          http://tug.org/svn/texlive?view=revision&revision=63354
Author:   karl
Date:     2022-05-21 22:18:01 +0200 (Sat, 21 May 2022)
Log Message:
-----------
bxghost (21may22)

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

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/latex/bxghost/bxghost-lib.sty

Modified: trunk/Master/texmf-dist/doc/latex/bxghost/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxghost/README.md	2022-05-21 02:44:01 UTC (rev 63353)
+++ trunk/Master/texmf-dist/doc/latex/bxghost/README.md	2022-05-21 20:18:01 UTC (rev 63354)
@@ -2,7 +2,7 @@
 
 LaTeX: ghost insertion for proper xkanjiskip
 
-## System requirements
+## Requirements
 
 * TeX format: LaTeX
 * TeX engine: LuaTeX, XeTeX, pTeX, upTeX, and ApTeX (pTeX-ng)
@@ -22,6 +22,16 @@
 * `verb` patches the `\verb` command of LaTeX to be guarded by European ghost.
 * `noverb` disables the `verb` feature. (default)
 
+### For package authors
+
+To use the function of this package in your package, a library version is available:
+
+```tex
+\RequirePackage{bxghost-lib}
+```
+
+This provides all the commands defined in the package but does not have any package option to prevent the problem of option clashes.
+
 ## Acknowledgements
 
 The logic and style of the code in this package is greatly inspired by [Package PXghost](https://gist.github.com/zr-tex8r/4461060) and various packages in [the BX series](http://zrbabbler.sp.land.to/package.html#ssec-bx). I would like to thank the author of the packages, Dr. Takayuki YATO (aka. [ZR](https://github.com/zr-tex8r)).
@@ -32,6 +42,8 @@
 
 ## Revision History
 
+* Version 0.5.0  ‹2022/05/20›
+  * Provide `bxghost-lib` for internal use from other packages
 * Version 0.4.0  ‹2022/02/12›
   * More general implementation for `\jghostguarded`
   * Add the `noverb` option

Added: trunk/Master/texmf-dist/tex/latex/bxghost/bxghost-lib.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxghost/bxghost-lib.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/bxghost/bxghost-lib.sty	2022-05-21 20:18:01 UTC (rev 63354)
@@ -0,0 +1,143 @@
+%%
+%% This is file 'bxghost-lib.sty'.
+%%
+%% Copyright 2019-2022 Takuto ASAKURA (wtsnjp)
+%%   GitHub:   https://github.com/wtsnjp
+%%   Twitter:  @wtsnjp
+%%
+%% This package is distributed under the MIT License.
+%%
+
+%% package declaration
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{bxghost-lib}[2022/05/20 v0.5.0]
+
+%% preparations
+\def\bxqgg at pkgname{bxghost}
+\def\bxqgg at warn{\PackageWarningNoLine\bxqgg at pkgname}
+
+%--------------------------------------- general
+
+%% \bxqgg at engine : engine type
+\def\bxqgg at next#1#2{%
+  \edef\bxqgg at tmpa{\string#1}\edef\bxqgg at tmpb{\meaning#1}%
+  \ifx\bxqgg at tmpa\bxqgg at tmpb #2\fi}
+\chardef\bxqgg at engine=0 % other TeX
+\bxqgg at next\kanjiskip     {\chardef\bxqgg at engine=1 }% pTeX
+\bxqgg at next\enablecjktoken{\chardef\bxqgg at engine=2 }% upTeX
+\bxqgg at next\luatexversion {\chardef\bxqgg at engine=3 }% LuaTeX
+\bxqgg at next\XeTeXversion  {\chardef\bxqgg at engine=4 }% XeTeX
+
+%--------------------------------------- not supported engine
+
+\ifnum\bxqgg at engine=\z@
+  \bxqgg at warn{This engine is not supported, sorry}
+  \expandafter\endinput
+\fi
+
+%--------------------------------------- load LuaTeX-ja
+
+\ifnum\bxqgg at engine=\thr@@
+  \RequirePackage{luatexja}
+  \@ifpackageloaded{luatexja-adjust}{}{%
+    \RequirePackage{luatexja-adjust}\ltjdisableadjust}
+\fi
+
+%--------------------------------------- eghostguarded
+
+% use an arbitrary font available in T1 encoding
+\font\bxqgg at TI=ec-lmr10 at 1.23456pt
+\chardef\bxqgg at cwm=23 % compwordmark (in T1)
+
+% allow xkanjiskip around
+% Note: for XeTeX, xeCJK will handle nicely. We have nothing to do :)
+\ifcase\bxqgg at engine
+\or  % pTeX
+  \xspcode\bxqgg at cwm=3\relax
+\or  % upTeX
+  \xspcode\bxqgg at cwm=3\relax
+\or  % LuaTeX
+  \ltjsetparameter{alxspmode={\bxqgg at cwm,3}}
+\fi
+
+%%<*> \eghostguarded{<text>}
+\newcommand*\eghostguarded{%
+  \ifmmode \expandafter\@firstofone
+  \else \expandafter\bxqgg at eghostguarded@a
+  \fi
+}
+\def\bxqgg at eghostguarded@a#1{%
+  \bxqgg at eghost #1\bxqgg at eghost}
+\def\bxqgg at eghost{\bgroup
+  \bxqgg at TI\bxqgg at cwm\egroup}
+
+%--------------------------------------- jghostguarded
+
+%% \bxqgg at fwsp: a zenkaku space (U+3000)
+\begingroup
+  \ifnum\bxqgg at engine<\thr@@  % (u)pTeX
+    \kansujichar\@ne=\jis"2121\relax
+    \xdef\bxqgg at fwsp{\kansuji\@ne}
+  \else  % others
+    \lccode`\Z="3000\relax
+    \lowercase{\xdef\bxqgg at fwsp{Z}}
+  \fi
+\endgroup
+
+% make sure to use a font whose zenkaku space is class zero
+\let\bxqgg at jafont\relax
+
+\ifcase\bxqgg at engine
+\or  % pTeX
+  \DeclareFontFamily{JY1}{bxqgg}{}
+  \DeclareFontFamily{JT1}{bxqgg}{}
+  \DeclareFontShape{JY1}{bxqgg}{m}{n}{<->s*[0.961]jis}{}
+  \DeclareFontShape{JT1}{bxqgg}{m}{n}{<->s*[0.961]tmin10}{}
+  \def\bxqgg at jafont{\usekanji{\k at encoding}{bxqgg}{m}{n}}
+\or  % upTeX
+  \DeclareFontFamily{JY2}{bxqgg}{}
+  \DeclareFontFamily{JT2}{bxqgg}{}
+  \DeclareFontShape{JY2}{bxqgg}{m}{n}{<->s*[0.92469]upjisr-h}{}
+  \DeclareFontShape{JT2}{bxqgg}{m}{n}{<->s*[0.92469]upjisr-v}{}
+  \def\bxqgg at jafont{\usekanji{\k at encoding}{bxqgg}{m}{n}}
+\fi
+
+%% \bxqgg at kern@m at ne@zw: a negative zenkaku width kern
+\ifnum\bxqgg at engine<\thr@@
+  % (u)pTeX knows the unit `zw'
+  \def\bxqgg at kern@m at ne@zw{\kern-1zw\relax}
+\else
+  % for other engines, we use \zw instead
+  \def\bxqgg at kern@m at ne@zw{\kern-1\zw\relax}
+\fi
+
+%%<*> \jghostguarded{<text>}
+\newcommand*\jghostguarded{%
+  \ifmmode \expandafter\@firstofone
+  \else \expandafter\bxqgg at jghostguarded@a
+  \fi
+}
+\edef\bxqgg at jghostguarded@a#1{%
+  \bgroup
+    \noexpand\bxqgg at jafont
+    \bxqgg at fwsp\bxqgg at kern@m at ne@zw
+  \egroup
+  #1%
+  \bgroup
+    \noexpand\bxqgg at jafont
+    \bxqgg at kern@m at ne@zw\bxqgg at fwsp
+  \egroup
+}
+
+% better definition for LuaTeX-ja (20220211.0 or later)
+\ifnum\bxqgg at engine=\thr@@  % LuaTeX
+  \ifx\ltjghostbeforejachar\@undefined\else
+    \def\bxqgg at jghostguarded@a#1{%
+      \ltjghostbeforejachar #1\ltjghostafterjachar
+    }
+  \fi
+\fi
+
+%--------------------------------------- all done
+\endinput
+%% EOF


Property changes on: trunk/Master/texmf-dist/tex/latex/bxghost/bxghost-lib.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/bxghost/bxghost.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxghost/bxghost.sty	2022-05-21 02:44:01 UTC (rev 63353)
+++ trunk/Master/texmf-dist/tex/latex/bxghost/bxghost.sty	2022-05-21 20:18:01 UTC (rev 63354)
@@ -10,39 +10,11 @@
 
 %% package declaration
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxghost}[2022/02/12 v0.4.0]
+\ProvidesPackage{bxghost}[2022/05/20 v0.5.0]
 
-%% preparations
-\def\bxqgg at pkgname{bxghost}
-\def\bxqgg at warn{\PackageWarningNoLine\bxqgg at pkgname}
+%% load the library
+\RequirePackage{bxghost-lib}
 
-%--------------------------------------- general
-
-%% \bxqgg at engine : engine type
-\def\bxqgg at next#1#2{%
-  \edef\bxqgg at tmpa{\string#1}\edef\bxqgg at tmpb{\meaning#1}%
-  \ifx\bxqgg at tmpa\bxqgg at tmpb #2\fi}
-\chardef\bxqgg at engine=0 % other TeX
-\bxqgg at next\kanjiskip     {\chardef\bxqgg at engine=1 }% pTeX
-\bxqgg at next\enablecjktoken{\chardef\bxqgg at engine=2 }% upTeX
-\bxqgg at next\luatexversion {\chardef\bxqgg at engine=3 }% LuaTeX
-\bxqgg at next\XeTeXversion  {\chardef\bxqgg at engine=4 }% XeTeX
-
-%--------------------------------------- not supported engine
-
-\ifnum\bxqgg at engine=\z@
-  \bxqgg at warn{This engine is not supported, sorry}
-  \expandafter\endinput
-\fi
-
-%--------------------------------------- load LuaTeX-ja
-
-\ifnum\bxqgg at engine=\thr@@
-  \RequirePackage{luatexja}
-  \@ifpackageloaded{luatexja-adjust}{}{%
-    \RequirePackage{luatexja-adjust}\ltjdisableadjust}
-\fi
-
 %--------------------------------------- the verb option
 
 \newif\ifbxqgg at verb \bxqgg at verbfalse
@@ -50,34 +22,6 @@
 \DeclareOption{noverb}{\bxqgg at verbfalse}
 \ProcessOptions\relax
 
-%--------------------------------------- eghostguarded
-
-% use an arbitrary font available in T1 encoding
-\font\bxqgg at TI=ec-lmr10 at 1.23456pt
-\chardef\bxqgg at cwm=23 % compwordmark (in T1)
-
-% allow xkanjiskip around
-% Note: for XeTeX, xeCJK will handle nicely. We have nothing to do :)
-\ifcase\bxqgg at engine
-\or  % pTeX
-  \xspcode\bxqgg at cwm=3\relax
-\or  % upTeX
-  \xspcode\bxqgg at cwm=3\relax
-\or  % LuaTeX
-  \ltjsetparameter{alxspmode={\bxqgg at cwm,3}}
-\fi
-
-%%<*> \eghostguarded{<text>}
-\newcommand*\eghostguarded{%
-  \ifmmode \expandafter\@firstofone
-  \else \expandafter\bxqgg at eghostguarded@a
-  \fi
-}
-\def\bxqgg at eghostguarded@a#1{%
-  \bxqgg at eghost #1\bxqgg at eghost}
-\def\bxqgg at eghost{\bgroup
-  \bxqgg at TI\bxqgg at cwm\egroup}
-
 % patch \verb
 \ifbxqgg at verb
   \edef\verb{\noexpand\bxqgg at eghost\unexpanded\expandafter{\verb}}
@@ -85,73 +29,6 @@
     \unexpanded\expandafter{\verb at egroup}\noexpand\bxqgg at eghost}
 \fi
 
-%--------------------------------------- jghostguarded
-
-%% \bxqgg at fwsp: a zenkaku space (U+3000)
-\begingroup
-  \ifnum\bxqgg at engine<\thr@@  % (u)pTeX
-    \kansujichar\@ne=\jis"2121\relax
-    \xdef\bxqgg at fwsp{\kansuji\@ne}
-  \else  % others
-    \lccode`\Z="3000\relax
-    \lowercase{\xdef\bxqgg at fwsp{Z}}
-  \fi
-\endgroup
-
-% make sure to use a font whose zenkaku space is class zero
-\let\bxqgg at jafont\relax
-
-\ifcase\bxqgg at engine
-\or  % pTeX
-  \DeclareFontFamily{JY1}{bxqgg}{}
-  \DeclareFontFamily{JT1}{bxqgg}{}
-  \DeclareFontShape{JY1}{bxqgg}{m}{n}{<->s*[0.961]jis}{}
-  \DeclareFontShape{JT1}{bxqgg}{m}{n}{<->s*[0.961]tmin10}{}
-  \def\bxqgg at jafont{\usekanji{\k at encoding}{bxqgg}{m}{n}}
-\or  % upTeX
-  \DeclareFontFamily{JY2}{bxqgg}{}
-  \DeclareFontFamily{JT2}{bxqgg}{}
-  \DeclareFontShape{JY2}{bxqgg}{m}{n}{<->s*[0.92469]upjisr-h}{}
-  \DeclareFontShape{JT2}{bxqgg}{m}{n}{<->s*[0.92469]upjisr-v}{}
-  \def\bxqgg at jafont{\usekanji{\k at encoding}{bxqgg}{m}{n}}
-\fi
-
-%% \bxqgg at kern@m at ne@zw: a negative zenkaku width kern
-\ifnum\bxqgg at engine<\thr@@
-  % (u)pTeX knows the unit `zw'
-  \def\bxqgg at kern@m at ne@zw{\kern-1zw\relax}
-\else
-  % for other engines, we use \zw instead
-  \def\bxqgg at kern@m at ne@zw{\kern-1\zw\relax}
-\fi
-
-%%<*> \jghostguarded{<text>}
-\newcommand*\jghostguarded{%
-  \ifmmode \expandafter\@firstofone
-  \else \expandafter\bxqgg at jghostguarded@a
-  \fi
-}
-\edef\bxqgg at jghostguarded@a#1{%
-  \bgroup
-    \noexpand\bxqgg at jafont
-    \bxqgg at fwsp\bxqgg at kern@m at ne@zw
-  \egroup
-  #1%
-  \bgroup
-    \noexpand\bxqgg at jafont
-    \bxqgg at kern@m at ne@zw\bxqgg at fwsp
-  \egroup
-}
-
-% better definition for LuaTeX-ja (20220211.0 or later)
-\ifnum\bxqgg at engine=\thr@@  % LuaTeX
-  \ifx\ltjghostbeforejachar\@undefined\else
-    \def\bxqgg at jghostguarded@a#1{%
-      \ltjghostbeforejachar #1\ltjghostafterjachar
-    }
-  \fi
-\fi
-
 %--------------------------------------- all done
 \endinput
 %% EOF



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