Skip to content

Desktop: Fixed KaTeX font issue in exported PDF #3089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 20, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions ReactNativeClient/lib/joplin-renderer/MdToHtml/rules/katex.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,31 @@ katex = mhchemModule(katex);

function katexStyle() {
return [
// Note: Declaring the fonts is not needed for in-app rendering because
// they will be loaded automatically from katex.css.
// However they must be specified for exporting notes to HTML and PDF,
// so that they can be bundled with the other assets.
{ name: 'katex.css' },
// Note: Katex also requires a number of fonts but they don't need to be specified here
// since they will be loaded as needed from the CSS.
{ name: 'fonts/KaTeX_AMS-Regular.woff2' },
{ name: 'fonts/KaTeX_Caligraphic-Bold.woff2' },
{ name: 'fonts/KaTeX_Caligraphic-Regular.woff2' },
{ name: 'fonts/KaTeX_Fraktur-Bold.woff2' },
{ name: 'fonts/KaTeX_Fraktur-Regular.woff2' },
{ name: 'fonts/KaTeX_Main-Bold.woff2' },
{ name: 'fonts/KaTeX_Main-BoldItalic.woff2' },
{ name: 'fonts/KaTeX_Main-Italic.woff2' },
{ name: 'fonts/KaTeX_Main-Regular.woff2' },
{ name: 'fonts/KaTeX_Math-BoldItalic.woff2' },
{ name: 'fonts/KaTeX_Math-Italic.woff2' },
{ name: 'fonts/KaTeX_SansSerif-Bold.woff2' },
{ name: 'fonts/KaTeX_SansSerif-Italic.woff2' },
{ name: 'fonts/KaTeX_SansSerif-Regular.woff2' },
{ name: 'fonts/KaTeX_Script-Regular.woff2' },
{ name: 'fonts/KaTeX_Size1-Regular.woff2' },
{ name: 'fonts/KaTeX_Size2-Regular.woff2' },
{ name: 'fonts/KaTeX_Size3-Regular.woff2' },
{ name: 'fonts/KaTeX_Size4-Regular.woff2' },
{ name: 'fonts/KaTeX_Typewriter-Regular.woff2' },
];
}

Expand Down