-\DeclareRobustCommand\rmfamily
- {\not@math@alphabet\rmfamily\mathrm
- \romanfamily\rmdefault
- \if@ltj@match@family\kanjifamily\mcdefault\fi\selectfont}
-\DeclareRobustCommand\sffamily
- {\not@math@alphabet\sffamily\mathsf
- \romanfamily\sfdefault
- \if@ltj@match@family\kanjifamily\gtdefault\fi\selectfont}
-\DeclareRobustCommand\ttfamily
- {\not@math@alphabet\ttfamily\mathtt
- \romanfamily\ttdefault
- \if@ltj@match@family\kanjifamily\jttdefault\fi\selectfont}
+
+\def\@ltj@hook@family#1#2{ % #1: csname #2: contents
+ \ifcsname @#1hook\endcsname % LaTeX 2020-02-02
+ \csappto{@#1hook}{#2}%
+ \else % LaTeX 2019-10-01
+ \ifcsname #1 \endcsname
+ \expandafter\patchcmd\csname #1 \endcsname{\selectfont}{#2\selectfont}{}{}%
+ \else
+ \PackageWarningNoLine{luatexja}{%
+ Patching to \expandafter\string\csname #1\endcsname\space failed
+ }%
+ \fi
+ \fi
+}
+\@ltj@hook@family{rmfamily}{%
+ \if@ltj@match@family
+ \prepare@family@series@update@kanji{mc}\mcdefault
+ \fi
+}
+\@ltj@hook@family{sffamily}{%
+ \if@ltj@match@family
+ \prepare@family@series@update@kanji{gt}\gtdefault
+ \fi
+}
+\@ltj@hook@family{ttfamily}{%
+ \if@ltj@match@family
+ \prepare@family@series@update@kanji{jtt}\jttdefault
+ \fi
+}
+