summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-02-12 21:17:04 +0000
committerKarl Berry <karl@freefriends.org>2022-02-12 21:17:04 +0000
commitb2d6444a8abd937bc22626739d1f980c6fad1533 (patch)
tree508f6789769ce3e2f10ad54cf27e1c6b5073a8b9 /Master/texmf-dist
parent34ae39d969c759aab9b3d41b0bd830ab717e8b65 (diff)
bxghost (12feb22)
git-svn-id: svn://tug.org/texlive/trunk@61989 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/bxghost/LICENSE2
-rw-r--r--Master/texmf-dist/doc/latex/bxghost/README.md9
-rw-r--r--Master/texmf-dist/tex/latex/bxghost/bxghost.sty65
3 files changed, 63 insertions, 13 deletions
diff --git a/Master/texmf-dist/doc/latex/bxghost/LICENSE b/Master/texmf-dist/doc/latex/bxghost/LICENSE
index d20a0d418f2..4bb9a411643 100644
--- a/Master/texmf-dist/doc/latex/bxghost/LICENSE
+++ b/Master/texmf-dist/doc/latex/bxghost/LICENSE
@@ -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
diff --git a/Master/texmf-dist/doc/latex/bxghost/README.md b/Master/texmf-dist/doc/latex/bxghost/README.md
index 381c55c60e9..23419832ba7 100644
--- a/Master/texmf-dist/doc/latex/bxghost/README.md
+++ b/Master/texmf-dist/doc/latex/bxghost/README.md
@@ -6,8 +6,9 @@ LaTeX: ghost insertion for proper xkanjiskip
* 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 @@ This package provides following commands:
* `\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 @@ This package is distributed under [the MIT license](./LICENSE).
## 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›
diff --git a/Master/texmf-dist/tex/latex/bxghost/bxghost.sty b/Master/texmf-dist/tex/latex/bxghost/bxghost.sty
index a00a4623ca7..33b965ef3a5 100644
--- a/Master/texmf-dist/tex/latex/bxghost/bxghost.sty
+++ b/Master/texmf-dist/tex/latex/bxghost/bxghost.sty
@@ -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@pkgname{bxghost}
@@ -23,9 +23,10 @@
\edef\bxqgg@tmpa{\string#1}\edef\bxqgg@tmpb{\meaning#1}%
\ifx\bxqgg@tmpa\bxqgg@tmpb #2\fi}
\chardef\bxqgg@engine=0 % other TeX
-\bxqgg@next\kanjiskip {\chardef\bxqgg@engine=1 }% (u)pTeX (or ApTeX)
-\bxqgg@next\luatexversion{\chardef\bxqgg@engine=2 }% LuaTeX
-\bxqgg@next\XeTeXversion {\chardef\bxqgg@engine=3 }% XeTeX
+\bxqgg@next\kanjiskip {\chardef\bxqgg@engine=1 }% pTeX
+\bxqgg@next\enablecjktoken{\chardef\bxqgg@engine=2 }% upTeX
+\bxqgg@next\luatexversion {\chardef\bxqgg@engine=3 }% LuaTeX
+\bxqgg@next\XeTeXversion {\chardef\bxqgg@engine=4 }% XeTeX
%--------------------------------------- not supported engine
@@ -34,10 +35,19 @@
\expandafter\endinput
\fi
+%--------------------------------------- load LuaTeX-ja
+
+\ifnum\bxqgg@engine=\thr@@
+ \RequirePackage{luatexja}
+ \@ifpackageloaded{luatexja-adjust}{}{%
+ \RequirePackage{luatexja-adjust}\ltjdisableadjust}
+\fi
+
%--------------------------------------- the verb option
\newif\ifbxqgg@verb \bxqgg@verbfalse
\DeclareOption{verb}{\bxqgg@verbtrue}
+\DeclareOption{noverb}{\bxqgg@verbfalse}
\ProcessOptions\relax
%--------------------------------------- eghostguarded
@@ -51,6 +61,8 @@
\ifcase\bxqgg@engine
\or % pTeX
\xspcode\bxqgg@cwm=3\relax
+\or % upTeX
+ \xspcode\bxqgg@cwm=3\relax
\or % LuaTeX
\ltjsetparameter{alxspmode={\bxqgg@cwm,3}}
\fi
@@ -77,7 +89,7 @@
%% \bxqgg@fwsp: a zenkaku space (U+3000)
\begingroup
- \ifnum\bxqgg@engine=\@ne % pTeX
+ \ifnum\bxqgg@engine<\thr@@ % (u)pTeX
\kansujichar\@ne=\jis"2121\relax
\xdef\bxqgg@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@jafont\relax
+
+\ifcase\bxqgg@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@jafont{\usekanji{\k@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@jafont{\usekanji{\k@encoding}{bxqgg}{m}{n}}
+\fi
+
%% \bxqgg@kern@m@ne@zw: a negative zenkaku width kern
-\ifnum\bxqgg@engine=\@ne
- % pTeX knows the unit `zw'
+\ifnum\bxqgg@engine<\thr@@
+ % (u)pTeX knows the unit `zw'
\def\bxqgg@kern@m@ne@zw{\kern-1zw\relax}
\else
% for other engines, we use \zw instead
@@ -102,11 +132,26 @@
\fi
}
\edef\bxqgg@jghostguarded@a#1{%
- \bxqgg@fwsp\bxqgg@kern@m@ne@zw
+ \bgroup
+ \noexpand\bxqgg@jafont
+ \bxqgg@fwsp\bxqgg@kern@m@ne@zw
+ \egroup
#1%
- \bxqgg@kern@m@ne@zw\bxqgg@fwsp
+ \bgroup
+ \noexpand\bxqgg@jafont
+ \bxqgg@kern@m@ne@zw\bxqgg@fwsp
+ \egroup
}
+% better definition for LuaTeX-ja (20220211.0 or later)
+\ifnum\bxqgg@engine=\thr@@ % LuaTeX
+ \ifx\ltjghostbeforejachar\@undefined\else
+ \def\bxqgg@jghostguarded@a#1{%
+ \ltjghostbeforejachar #1\ltjghostafterjachar
+ }
+ \fi
+\fi
+
%--------------------------------------- all done
\endinput
%% EOF