Skip to content

Commit 7b4944e

Browse files
committed
fix russian missing
1 parent 7cfab54 commit 7b4944e

File tree

2 files changed

+84
-1
lines changed

2 files changed

+84
-1
lines changed

next.config.mjs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,21 @@ const withMDX = nextMDX({
7070

7171
[rehypeParseCodeMeta, { defaultShowCopyCode: true }],
7272
rehypeStringify,
73-
rehypeKatex,
73+
[
74+
rehypeKatex,
75+
{
76+
strict: false,
77+
trust: true,
78+
throwOnError: false,
79+
errorColor: '#cc0000',
80+
macros: {
81+
"\\RR": "\\mathbb{R}",
82+
"\\NN": "\\mathbb{N}",
83+
},
84+
// Allow Unicode text in math mode
85+
unicodeTextInMathMode: true,
86+
},
87+
],
7488
[
7589
rehypeShiki,
7690
{

styles/math/mathstyles.css

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,75 @@
1212
text-rendering: auto;
1313
}
1414

15+
/* Fallback for Cyrillic and other Unicode characters in math mode */
16+
.katex .mord,
17+
.katex .mrel,
18+
.katex .mop,
19+
.katex .mbin,
20+
.katex .mopen,
21+
.katex .mclose,
22+
.katex .mpunct,
23+
.katex .minner {
24+
font-family:
25+
KaTeX_Main,
26+
SurveyWithCode,
27+
"Cambria Math",
28+
"STIX Two Math",
29+
Times New Roman,
30+
serif !important;
31+
}
32+
33+
/* Additional Unicode support for Cyrillic and other non-Latin characters */
34+
.katex .mord.mathnormal,
35+
.katex .mord.mathdefault,
36+
.katex .mord.textord {
37+
font-family:
38+
KaTeX_Main,
39+
SurveyWithCode,
40+
"Cambria Math",
41+
"STIX Two Math",
42+
Times New Roman,
43+
serif !important;
44+
}
45+
46+
/* Ensure Cyrillic characters use fallback fonts */
47+
.katex .mord[mathvariant="normal"] {
48+
font-family:
49+
SurveyWithCode,
50+
"Cambria Math",
51+
"STIX Two Math",
52+
Times New Roman,
53+
serif !important;
54+
font-style: normal;
55+
}
56+
57+
/* Handle Unicode text characters specifically */
58+
.katex .mord.mtight,
59+
.katex .mord.sizing,
60+
.katex .mord.fontsize-ensurer {
61+
font-family:
62+
SurveyWithCode,
63+
"Cambria Math",
64+
"STIX Two Math",
65+
Times New Roman,
66+
serif !important;
67+
}
68+
69+
/* Force text mode elements to use regular fonts */
70+
.katex .text,
71+
.katex .textit,
72+
.katex .textrm,
73+
.katex .textsf,
74+
.katex .texttt,
75+
.katex .textbf {
76+
font-family:
77+
SurveyWithCode,
78+
"Cambria Math",
79+
"STIX Two Math",
80+
Times New Roman,
81+
serif !important;
82+
}
83+
1584
.katex * {
1685
-ms-high-contrast-adjust: none !important;
1786
border-color: currentColor;

0 commit comments

Comments
 (0)