summaryrefslogtreecommitdiff
path: root/language/japanese/BX
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-01-31 03:01:20 +0000
committerNorbert Preining <norbert@preining.info>2020-01-31 03:01:20 +0000
commit1d1c81d42f36755f72bbd69c5a29c2d6a9fec04d (patch)
treec0ecbc7ed9fd2d67ea828d0ec80e160524fc61b3 /language/japanese/BX
parent1f2683ba3ec9c1855d5518e773c72d2241637449 (diff)
CTAN sync 202001310301
Diffstat (limited to 'language/japanese/BX')
-rw-r--r--language/japanese/BX/bxghost/README.md12
-rw-r--r--language/japanese/BX/bxghost/bxghost.sty22
2 files changed, 26 insertions, 8 deletions
diff --git a/language/japanese/BX/bxghost/README.md b/language/japanese/BX/bxghost/README.md
index f9096387cc..381c55c60e 100644
--- a/language/japanese/BX/bxghost/README.md
+++ b/language/japanese/BX/bxghost/README.md
@@ -7,14 +7,18 @@ LaTeX: ghost insertion for proper xkanjiskip
* TeX format: LaTeX
* TeX engine: LuaTeX, XeTeX, pTeX, upTeX, and ApTeX (pTeX-ng)
-Since this package is intended to create 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). BXghost does not load any external packages automatically.
## Usage
This package provides following commands:
-* `\eghostguarded{<text>}` inserts *Europian 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 Kanji) before and after the `<text>`. In math mode, it outputs only `<text>` without the ghosts.
+* `\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:
+
+* `verb` patches the `\verb` command of LaTeX to be guarded by European ghost.
## Acknowledgements
@@ -26,6 +30,8 @@ This package is distributed under [the MIT license](./LICENSE).
## Revision History
+* Version 0.3.0 ‹2020/01/31›
+ * Add the `verb` option
* Version 0.2.0 ‹2019/09/17›
* Add supports for XeTeX and ApTeX (pTeX-ng)
* Version 0.1.0 ‹2019/09/16›
diff --git a/language/japanese/BX/bxghost/bxghost.sty b/language/japanese/BX/bxghost/bxghost.sty
index 552d28ad9c..a00a4623ca 100644
--- a/language/japanese/BX/bxghost/bxghost.sty
+++ b/language/japanese/BX/bxghost/bxghost.sty
@@ -10,7 +10,7 @@
%% package declaration
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxghost}[2019/09/17 v0.2.0]
+\ProvidesPackage{bxghost}[2020/01/31 v0.3.0]
%% preparations
\def\bxqgg@pkgname{bxghost}
@@ -34,6 +34,12 @@
\expandafter\endinput
\fi
+%--------------------------------------- the verb option
+
+\newif\ifbxqgg@verb \bxqgg@verbfalse
+\DeclareOption{verb}{\bxqgg@verbtrue}
+\ProcessOptions\relax
+
%--------------------------------------- eghostguarded
% use an arbitrary font available in T1 encoding
@@ -56,10 +62,16 @@
\fi
}
\def\bxqgg@eghostguarded@a#1{%
- {\bxqgg@TI\bxqgg@cwm}%
- #1%
- {\bxqgg@TI\bxqgg@cwm}%
-}
+ \bxqgg@eghost #1\bxqgg@eghost}
+\def\bxqgg@eghost{\bgroup
+ \bxqgg@TI\bxqgg@cwm\egroup}
+
+% patch \verb
+\ifbxqgg@verb
+ \edef\verb{\noexpand\bxqgg@eghost\unexpanded\expandafter{\verb}}
+ \edef\verb@egroup{%
+ \unexpanded\expandafter{\verb@egroup}\noexpand\bxqgg@eghost}
+\fi
%--------------------------------------- jghostguarded