Skip to content
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

(Bug report) math formula format incorrectly #4387

Closed
LLouver opened this issue Nov 4, 2023 · 5 comments · May be fixed by #4408
Closed

(Bug report) math formula format incorrectly #4387

LLouver opened this issue Nov 4, 2023 · 5 comments · May be fixed by #4408

Comments

@LLouver
Copy link

LLouver commented Nov 4, 2023

Trilium Version

0.61.12

What operating system are you using?

Windows

What is your setup?

Local (no sync)

Operating System Version

Windows10 22H2

Description

When importing .md files with math formula, their style was lost, or infact, the Trilium Note does't support the .md style math formula like this:
图片

In Typora and other md readers, this should be shown as
图片

the md code like this:

#### 选择 Select 

- 单目运算,限制一些属性的域(缩小集合)

- $\sigma_P(r):=\{t|t\in r \and P(t)\}$

just wedge the math formula between '$$'

ps: when I wrote math formula in Trilium and export to .md files, the formula was not shown correctly, due to the loss of '$$'.

Error logs

No response

@LLouver LLouver changed the title math formula format incorrectly (Bug report) (Bug report) math formula format incorrectly Nov 6, 2023
@dousha
Copy link
Contributor

dousha commented Nov 7, 2023

There is one (known) thing that's in the markdown spec but trilium does not support: tables. (And it's actually in the spec.) Math expression in markdown does not come for free. They depend on MathJax or other TeX math expression render libraries. (Not to mention that $ ... $ is also an extension -- a lot of libraries actually expect \( \) and \[ \] for inline- and block-level expressions. But that would be another issue.)

However, it is a huge pain to re-type all math expressions. Poking around in the code suggests we could start here to add math expression import.

@Nriver
Copy link
Contributor

Nriver commented Nov 7, 2023

You can try to import your markdown files with trilium-py. It will handle your Latex equations.

ksnip_20231107-120211

Unfortunately, the \and symbol seems not recognized by the library used by trilium.

@dousha
Copy link
Contributor

dousha commented Nov 7, 2023

Hi. I've managed to get the things going. But there is a catch: \and is actually a predefined macro that is not a part of standard TeX. The "proper" way to typeset this symbol is to use \land (or to be more pedantic, \wedge). I haven't figured out how to add custom macros to KaTeX used by Trilium yet.

@zadam
Copy link
Owner

zadam commented Nov 12, 2023

@dousha 0.61 has a new markdown library and table import works. However, I don't believe tables are in the CommonMark spec.

@LLouver
Copy link
Author

LLouver commented Nov 16, 2023

yeah,now I've changes every \and \or into \land \lor , thx!

@LLouver LLouver closed this as completed Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants