1 min read

Introducing KaTeX

Written By

QI

Qing

Creator, Quotion

Published on

5/10/2024

Many students are using Quotion. One of the most wanted features is KaTeX for math.

Today, we're excited to share that Quotion now supports KaTeX out of the box. 🔥

Preview

The note:

image_c55e15

The post:

image_2c0d86

Tech details

We need KaTeX css to render expressions correctly, but it is a pretty big chunk, to reduce the perf impact on unrelated pages, I loaded the css conditionally with next/dynamic, which only loads this dumb component when KaTeX is needed.

katex.tsx
import 'katex/dist/katex.min.css';
 
/**
 * Used to load katex conditionally
 */
export default function KaTeX() {
  return <></>;
}
post.tsx
const DynamicKatex = dynamic(() => import('./katex'));
 
export default function Post() {
  return (<div>
       {…otherJSX}
       {needKatex && <DynamicKatex />}
  </div>);
}

Write KaTeX in your Apple Notes, and share the Quotion post with your classmates seamlessly!

Create your blogs directly from Apple Notes.

Say goodbye to complex CMS updates and management issues!

You focus on creating quality content while Quotion takes care of the rest.

Latest

More from the blog