討論區: 公開討議/質問 (Thread #44671)

luatexja-fontspecのmatchオプションを付けた時の\ttfamily,\texttt (2021-09-23 08:15 by ぐっち #88063)

texlive 2021を使用しています。
luatexja-fontspecでmatchオプションを付けているのですが,\ttfamily・\textttで和文フォントがsetmonojfontで指定しているものに切り替わってくれません。
私の勘違いでしょうか。

%\documentclass[a4paper]{ltjsarticle}%こちらでは切り替わる
\documentclass[paper=a4]{jlreq}
\usepackage[no-math]{fontspec}
\usepackage[match]{luatexja-fontspec}
\setmonofont{PopRumCute}
\setmonojfont{PopRumCute}

\begin{document}
漢字仮名交じり文の例びっくりビックリ \\
rm abcdfixyzABCQWZ1234567890abcABC1236890零 \\
\textsf{sf abcdfixyzABCQWZ1234567890abcABC1236890零} \\
\texttt{tt abcdfixyzABCQWZ1234567890abcABC1236890零} \\
{\ttfamily ttfamily abcdfixyzABCQWZ1234567890abcABC1236890零} \\
\textbf{bf abcdfixyzABCQWZ1234567890abcABC1236890零} \\
\textit{it abcdfixyzABCQWZ1234567890abcABC1236890零} \\
\textsl{sl abcdfixyzABCQWZ1234567890abcABC1236890零}
\end{document}

回覆 #88063×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入

Re: luatexja-fontspecのmatchオプションを付けた時の\ttfamily,\texttt (2021-09-23 08:24 by h7k #88064)

メッセージ #88063 への返信
> texlive 2021を使用しています。
> luatexja-fontspecでmatchオプションを付けているのですが,\ttfamily・\textttで和文フォントがsetmonojfontで指定しているものに切り替わってくれません。

jlreq.cls を見たところ,
> % 和文ファミリと欧文ファミリの連動
> \AddToHook{rmfamily}{\prepare@family@series@update@kanji{mc}\mcdefault}
> \AddToHook{sffamily}{\prepare@family@series@update@kanji{gt}\gtdefault}
> \AddToHook{ttfamily}{\prepare@family@series@update@kanji{gt}\gtdefault}
と,\ttfamily では (u)pLaTeX と同様にゴシック体を用いるようになっています.

プリアンブルに
\makeatletter
\AddToHook{ttfamily}{\prepare@family@series@update@kanji{jtt}\jttdefault}
\makeatother
と記述するのがとりあえずの対処法ですが,jlreq.cls 側を直してもらうのが良いように思います.
回覆: #88063

回覆 #88064×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入

Re: luatexja-fontspecのmatchオプションを付けた時の\ttfamily,\texttt (2021-09-23 14:12 by ぐっち #88065)

早々の返信ありがとうございます。
なるほど,jlreq.cls内の設定がそのようになっていた訳ですか。
取りあえずの対処法,了解しました。本当にありがとうございます。
早くこのような原因を探れるレベルに達したいですが,なかなか。
回覆: #88064

回覆 #88065×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登入