My public wiki
Find a file
Hrishikesh Barman 2f99339dcf
feat: add transformations for latex in oxhugofm (#510)
ox-hugo currently supports the following syntax for latex equations:
- https://orgmode.org/manual/LaTeX-fragments.html
- https://ox-hugo.scripter.co/doc/equations

This syntax is supported by mathjax as is mentioned in the ox-hugo documentation.

But quartz uses remark-math which has some issues with the \( \) syntax.
See https://github.com/remarkjs/remark-math/issues/39

This change adds few more transformations to the OxHugoFlavouredMarkdown
plugin, which makes a best effort conversion of this syntax into what
the Quartz Latex transformer plugin supports.

With these changes, the generated files show latex formatting with
default quartz configuration.

Sidenote on `\_` escape by ox-hugo:

ox-hugo escapes, _ using \_, we match against it after we transform
equations into what quartz supports($$ and $).

This could be achieved using lookaround like regex as follows
```js
(?<=(\$|\$\$)[\s\S]*) -> Positive lookbehind for $ or $$
\\_ -> Matches \_
(?=[\s\S]*(?:\1)) Positive lookahead for $ or $$ if matched
const escapedUnderscoreRegex = new RegExp(/(?<=(\$|\$\$)[\s\S]*)\\_(?=[\s\S]*(?:\1))/, "g")
````

But since lookahead/behind can slow things down on large files, we just
look up all equations with $ and $$ delimiters and then try replacing \_
2023-09-29 11:35:26 -07:00
.github ci: print bundleInfo 2023-09-10 23:07:17 -07:00
content Fix #403 by moving documentation to separate directory to avoid merge conflicts (#405) 2023-08-23 12:09:04 -07:00
docs feat: add transformations for latex in oxhugofm (#510) 2023-09-29 11:35:26 -07:00
quartz feat: add transformations for latex in oxhugofm (#510) 2023-09-29 11:35:26 -07:00
.gitattributes add gitattributes for windows 2023-08-02 20:59:56 -07:00
.gitignore feat: support configurable ws port and remote development (#429) 2023-08-27 17:39:42 -07:00
.npmrc add engines field 2023-08-20 08:57:56 -07:00
.prettierignore fix notes 2023-08-07 23:57:24 -07:00
.prettierrc Use semi: false for prettier config 2022-05-02 08:57:25 -07:00
CODE_OF_CONDUCT.md run prettier 2023-07-22 17:27:41 -07:00
globals.d.ts run prettier 2023-07-22 17:27:41 -07:00
index.d.ts base path refactor to better support subpath hosting 2023-08-19 15:52:25 -07:00
LICENSE.txt add base structure 2021-07-18 09:35:42 -04:00
package-lock.json Revert "feat: Making Quartz available offline by making it a PWA (#465)" 2023-09-20 13:52:45 -07:00
package.json feat(explorer): improve accessibility and consistency (+ bug fix) (#488) 2023-09-20 13:55:29 -07:00
quartz.config.ts Revert "feat: Making Quartz available offline by making it a PWA (#465)" 2023-09-20 13:52:45 -07:00
quartz.layout.ts feat: implement breadcrumb component (#508) 2023-09-29 10:26:15 +02:00
README.md fix: use proper full base for links.ts 2023-08-23 12:18:50 -07:00
tsconfig.json run prettier 2023-07-22 17:27:41 -07:00

Quartz v4

“[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.” — Richard Hamming

Quartz is a set of tools that helps you publish your digital garden and notes as a website for free. Quartz v4 features a from-the-ground rewrite focusing on end-user extensibility and ease-of-use.

If you are looking for Quartz v3, you can find it on the hugo branch.

🔗 Read the documentation and get started: https://quartz.jzhao.xyz/

Join the Discord Community

Sponsors