Skip to content

Instantly share code, notes, and snippets.

@munepi
Last active May 28, 2022 03:39
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save munepi/5c9e53936e3540b8374b4ab14e6b7832 to your computer and use it in GitHub Desktop.
Save munepi/5c9e53936e3540b8374b4ab14e6b7832 to your computer and use it in GitHub Desktop.
\futureletのお勉強で作った漢文訓点スタイル https://qiita.com/munepi/items/5e6ac49fa5c025123305
We have moved this project to https://github.com/munepi/gckanbun.
@JPRidgeway
Copy link

gckanbunをluatexjaのテーブルと互換性があるようにするにはどうすればよいですか。この例は_gckanbun.sty_なしです:

\documentclass{book}

\usepackage{luatexja-fontspec}
\usepackage{luatexja-ruby}
\usepackage{lltjext}

\setmainfont{pala}[
Extension=.ttf,
ItalicFont=*i,
BoldFont=*b,
BoldItalicFont=*bi
]

\setmainjfont{SourceHanSerif}[
Extension = .ttc,
UprightFeatures = {
	FontIndex=8},
ItalicFeatures = {
	FontIndex=8},
BoldFeatures = {
	BoldFeatures = {Scale = 1.2},
	FontIndex=8},
BoldItalicFeatures = {
	BoldItalicFeatures = {Scale = 1.2},
	FontIndex=8}
]
\begin{tabular}<t>{|l|}
	\hline
	\ruby{漢}{ふり}\ruby{字}{がな}\ruby{漢}{ふり}\ruby{字}{がな}\ruby{漢}{ふり}\ruby{字}{がな}\ruby{漢}{ふり}\ruby{字}{がな}\\
	\hline
	\ruby{漢}{ふり}\ruby{字}{がな}\ruby{漢}{ふり}\ruby{字}{がな}\ruby{漢}{ふり}\ruby{字}{がな}\ruby{漢}{ふり}\ruby{字}{がな}\\
	\hline
\end{tabular}

image

これは_\usepackage{gckanbun}_を追加するだけです:

image

通常のふりがなは壊れています!

@munepi
Copy link
Author

munepi commented Sep 3, 2019

コメントをありがとうございます。

gckanbun.sty で提供される \ruby は、ルビ分の幅を0にしている(\smash)しているので、お示しの結果になりますね。
なので、

  • gckanbun.sty で提供される \ruby を何らか改修する(ルビ分の幅の考慮)
  • luatexja-ruby.sty で提供される \ruby(実態は、 \ltjruby)に対して、漢文訓点の実装を行う

などをやる必要がありますね。

@JPRidgeway
Copy link

あなたの反応をありがとうございました。

私はすでに一時的な解決策を採用していした。「gckanbun」から「\ruby」の名前を「\ kanbunruby」に変更し、今、矛盾はありません。

@munepi
Copy link
Author

munepi commented Mar 25, 2021

Hello @JPRidgeway ,

I have moved this project to https://github.com/munepi/gckanbun and have released v1.0.
Also, I just have uploaded gckanbun package to CTAN!!

@munepi
Copy link
Author

munepi commented Mar 25, 2021

FYI @JPRidgeway ,

When releasing gckanbun.sty v1.0, I added prefix=<prefix> option below:

%\usepackage{gckanbun}%%=> provides \gckanbunruby, \gckanbunokurigana, \gckanbunkaeriten as default
\usepackage[prefix=]{gckanbun}%%=> provides \ruby, \okurigana, \kaeriten
%\usepackage[prefix=kanbun]{gckanbun}%%=> provides \kanbunruby, \kanbunokurigana, \kanbunkaeriten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment