texlive[61989] Master/texmf-dist: bxghost (12feb22)
commits+karl at tug.org
commits+karl at tug.org
Sat Feb 12 22:17:04 CET 2022
Revision: 61989
http://tug.org/svn/texlive?view=revision&revision=61989
Author: karl
Date: 2022-02-12 22:17:04 +0100 (Sat, 12 Feb 2022)
Log Message:
-----------
bxghost (12feb22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/bxghost/LICENSE
trunk/Master/texmf-dist/doc/latex/bxghost/README.md
trunk/Master/texmf-dist/tex/latex/bxghost/bxghost.sty
Modified: trunk/Master/texmf-dist/doc/latex/bxghost/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxghost/LICENSE 2022-02-12 21:16:42 UTC (rev 61988)
+++ trunk/Master/texmf-dist/doc/latex/bxghost/LICENSE 2022-02-12 21:17:04 UTC (rev 61989)
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright 2019 Takuto ASAKURA (wtsnjp)
+Copyright 2019-2022 Takuto ASAKURA (wtsnjp)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Modified: trunk/Master/texmf-dist/doc/latex/bxghost/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bxghost/README.md 2022-02-12 21:16:42 UTC (rev 61988)
+++ trunk/Master/texmf-dist/doc/latex/bxghost/README.md 2022-02-12 21:17:04 UTC (rev 61989)
@@ -6,8 +6,9 @@
* TeX format: LaTeX
* TeX engine: LuaTeX, XeTeX, pTeX, upTeX, and ApTeX (pTeX-ng)
+* LuaTeX-ja is required in LuaTeX
-Since this package is intended to be used for creating documents in Japanese, it assumes appropriate classes and/or packages are loaded in some engines (e.g., LuaTeX-ja for LuaTeX and bxjscls for XeTeX). BXghost does not load any external packages automatically.
+Since this package is intended to be used for creating documents in Japanese, it assumes appropriate classes and/or packages are loaded in some engines (e.g., LuaTeX-ja for LuaTeX and bxjscls for XeTeX).
## Usage
@@ -16,9 +17,10 @@
* `\eghostguarded{<text>}` inserts *European ghost* (invisible and zero-width alphabets) before and after the `<text>`. In math mode, it outputs only `<text>` without the ghosts.
* `\jghostguarded{<text>}` inserts *Japanese ghost* (invisible and zero-width Japanese characters) before and after the `<text>`. In math mode, it outputs only `<text>` without the ghosts.
-In addition, the following package option is available:
+In addition, the following package options are available:
* `verb` patches the `\verb` command of LaTeX to be guarded by European ghost.
+* `noverb` disables the `verb` feature. (default)
## Acknowledgements
@@ -30,6 +32,9 @@
## Revision History
+* Version 0.4.0 ‹2022/02/12›
+ * More general implementation for `\jghostguarded`
+ * Add the `noverb` option
* Version 0.3.0 ‹2020/01/31›
* Add the `verb` option
* Version 0.2.0 ‹2019/09/17›
Modified: trunk/Master/texmf-dist/tex/latex/bxghost/bxghost.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bxghost/bxghost.sty 2022-02-12 21:16:42 UTC (rev 61988)
+++ trunk/Master/texmf-dist/tex/latex/bxghost/bxghost.sty 2022-02-12 21:17:04 UTC (rev 61989)
@@ -1,7 +1,7 @@
%%
%% This is file 'bxghost.sty'.
%%
-%% Copyright 2019 Takuto ASAKURA (wtsnjp)
+%% Copyright 2019-2022 Takuto ASAKURA (wtsnjp)
%% GitHub: https://github.com/wtsnjp
%% Twitter: @wtsnjp
%%
@@ -10,7 +10,7 @@
%% package declaration
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxghost}[2020/01/31 v0.3.0]
+\ProvidesPackage{bxghost}[2022/02/12 v0.4.0]
%% preparations
\def\bxqgg at pkgname{bxghost}
@@ -23,9 +23,10 @@
\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 }% (u)pTeX (or ApTeX)
-\bxqgg at next\luatexversion{\chardef\bxqgg at engine=2 }% LuaTeX
-\bxqgg at next\XeTeXversion {\chardef\bxqgg at engine=3 }% XeTeX
+\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
@@ -34,10 +35,19 @@
\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
\DeclareOption{verb}{\bxqgg at verbtrue}
+\DeclareOption{noverb}{\bxqgg at verbfalse}
\ProcessOptions\relax
%--------------------------------------- eghostguarded
@@ -51,6 +61,8 @@
\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
@@ -77,7 +89,7 @@
%% \bxqgg at fwsp: a zenkaku space (U+3000)
\begingroup
- \ifnum\bxqgg at engine=\@ne % pTeX
+ \ifnum\bxqgg at engine<\thr@@ % (u)pTeX
\kansujichar\@ne=\jis"2121\relax
\xdef\bxqgg at fwsp{\kansuji\@ne}
\else % others
@@ -86,9 +98,27 @@
\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=\@ne
- % pTeX knows the unit `zw'
+\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
@@ -102,11 +132,26 @@
\fi
}
\edef\bxqgg at jghostguarded@a#1{%
- \bxqgg at fwsp\bxqgg at kern@m at ne@zw
+ \bgroup
+ \noexpand\bxqgg at jafont
+ \bxqgg at fwsp\bxqgg at kern@m at ne@zw
+ \egroup
#1%
- \bxqgg at kern@m at ne@zw\bxqgg at fwsp
+ \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.