Skip to content

Commit c65ee4a

Browse files
authored
Desktop: Fixed KaTeX font issue in exported PDF and HTML (#3089)
* Fixed issue: #3078 * updated comments * Changed as requested
1 parent feee162 commit c65ee4a

File tree

1 file changed

+24
-2
lines changed
  • ReactNativeClient/lib/joplin-renderer/MdToHtml/rules

1 file changed

+24
-2
lines changed

ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/katex.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,30 @@ katex = mhchemModule(katex);
1717
function katexStyle() {
1818
return [
1919
{ name: 'katex.css' },
20-
// Note: Katex also requires a number of fonts but they don't need to be specified here
21-
// since they will be loaded as needed from the CSS.
20+
// Note: Declaring the fonts is not needed for in-app rendering because
21+
// they will be loaded automatically from katex.css.
22+
// However they must be specified for exporting notes to HTML and PDF,
23+
// so that they can be bundled with the other assets.
24+
{ name: 'fonts/KaTeX_AMS-Regular.woff2' },
25+
{ name: 'fonts/KaTeX_Caligraphic-Bold.woff2' },
26+
{ name: 'fonts/KaTeX_Caligraphic-Regular.woff2' },
27+
{ name: 'fonts/KaTeX_Fraktur-Bold.woff2' },
28+
{ name: 'fonts/KaTeX_Fraktur-Regular.woff2' },
29+
{ name: 'fonts/KaTeX_Main-Bold.woff2' },
30+
{ name: 'fonts/KaTeX_Main-BoldItalic.woff2' },
31+
{ name: 'fonts/KaTeX_Main-Italic.woff2' },
32+
{ name: 'fonts/KaTeX_Main-Regular.woff2' },
33+
{ name: 'fonts/KaTeX_Math-BoldItalic.woff2' },
34+
{ name: 'fonts/KaTeX_Math-Italic.woff2' },
35+
{ name: 'fonts/KaTeX_SansSerif-Bold.woff2' },
36+
{ name: 'fonts/KaTeX_SansSerif-Italic.woff2' },
37+
{ name: 'fonts/KaTeX_SansSerif-Regular.woff2' },
38+
{ name: 'fonts/KaTeX_Script-Regular.woff2' },
39+
{ name: 'fonts/KaTeX_Size1-Regular.woff2' },
40+
{ name: 'fonts/KaTeX_Size2-Regular.woff2' },
41+
{ name: 'fonts/KaTeX_Size3-Regular.woff2' },
42+
{ name: 'fonts/KaTeX_Size4-Regular.woff2' },
43+
{ name: 'fonts/KaTeX_Typewriter-Regular.woff2' },
2244
];
2345
}
2446

0 commit comments

Comments
 (0)