zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

[Improvement] Multiline maths support and better editing interface (KaTeX) #2088

Closed aaronshenhao closed 5 months ago

aaronshenhao commented 3 years ago

Please refer to main issue thread in the ckeditor5-math repository: Edit window too small #10


The current math input box is too small and does not allow multiline equations like in Joplin. I haven't been successful in writing a multiline aligned equation (is begin{align} not supported?).

I think the best interface for writing TeX equations is the traditional vertically split interface with the code on the left and the output on the right, perhaps with the whole thing stacked under the bottom quarter to half of the screen (resizable, with possibility of being maximized).

Sidenote: Mathquill integration would be cool, perhaps as a shortcut for writing complex expressions.

abitofevrything commented 3 years ago

Hi, This is an issue with the math plugin used in Trilium and there is already an issue open over there. If you want to change the layout, you would have to submit an issue or PR over there.

aaronshenhao commented 3 years ago

Thanks for the link. Glad to know it's been brought up already. I searched for math, katex, latex, tex but it didn't show up. Should I close this issue?

Mirwaisse commented 3 years ago

To write multiline aligned equation, my workaround is to use on a second line \phantom{left part of the equation}.

For example, to get: image

I would write: \frac{dE}{dw_0} = -\frac 1 m \sum_{i=0}^m (y_i - \operatorname{sigmoid}(w_0+w_1x_{1,i}+w_2x_{2,i}))

and then in a second equation box: \phantom{\frac{dE}{dw_0}} = -\frac 1 m \sum_{i=0}^m (y_i - \hat y_i)

abitofevrything commented 3 years ago

@aaronshenhao you could close this issue since it is already present upstream, but then it technically isn't resolved so you might want to keep it open. Up to you.

aaronshenhao commented 3 years ago

@abitofevrything Thanks, I'll keep it open since I think the other issue is hard to find. I'll link it at the top of the thread.

aaronshenhao commented 3 years ago

Oddly enough, someone seems to have successfully used multiline align in that thread (link). Different version?

abitofevrything commented 3 years ago

They achieved this by using a phantom block, which isn't the cleanest way of doing it (a phantom block simply doesn't render it's content, but applies spacing).

As for begin{align}, I haven't tested so I am not sure if it is supported.

Mirwaisse commented 3 years ago

Wait, actually I have used multiline equation in the past like that: image f'(x) = \begin{Bmatrix} 1 & x>0 \\ 0 & x<0 \end{Bmatrix}

Oddly enough, someone seems to have successfully used multiline align in that thread (link). Different version?

They used \begin{aligned} in that thread and not \begin{align}

aaronshenhao commented 3 years ago

They used \begin{aligned} in that thread and not \begin{align}

Oh, that makes sense since its in math mode. I must have used the wrong one.

gp-fault commented 1 year ago

Any further ideas how to integrate MathQuill? That would be super cool!

Nyxiad commented 1 year ago

I'm going to make a separate issue regarding MathQuill

meichthys commented 5 months ago

Trilium has entered maintenance mode. Future enhancements will be addressed in TrilumNext: https://github.com/TriliumNext/Notes/issues/73