Open stecydube opened 9 months ago
I think it can be done by adding an option for this (something like "align equations to the left"), and then tweaking MathJax settings just like here:
https://stackoverflow.com/a/61503435
I think it also worth thinking about block-local alignment, though I don't know what is the good way to implement this.
I think it's okay to just use the inline asciimath, and it is a paragraph in markdown and will be automatically aligned left...🤔
Yes, I'm using that for the moment. The only thing is it does not align the formulas this way.
Also related to alignment. On mobile with new-syntax blocks (dollar signs), I get my math right-aligned for some reason:
^^^
This happens only with more than one line blocks.
Oh, this is because the multiline formulas will be wrapped with aligned
environment, and then the default style of Latex is aligned right, unless you use & at the start of each line.
The example below will be aligned right.
\begin{aligned}
aaaaa\\
bb
\end{aligned}
If you add a &
at the beginning of each line, it will be aligned left.
If you add a & at the beginning of each line, it will be aligned left.
But what about centered?
The reason why I do not add a &
at the beginning of each line in asciimath is that, if we meet this kind of formulas:
f(x) & = xe^x
f'(x) & = (x+1)e^x
f''(x) & = (x+2)e^x
Then all the f(x)
s will be aligned left instead of sticking on the left edge of the equal sign.
In your case, it is recommended to just add a &
at the beginning of each line of formula.
I have no idea how to center all the aligned formulas. The way I've thought about is to split them into different blocks.
How about adding some modifier like color
inside of ASCIIMath parser library code?
It'll work like this:
centered(
... Centered ASCIIMath code...
)
I've found that if we use gathered
environment, the formulas will be aligned center.
However, it's quite hard for this package to analyze when to stop at the closing paren. For example, there may be [x,y)
in the center
environment, and it will stop earlier and cause problems.
The only solution I can think about is to make backtick ` be the delimiter, thus deprecating some rarely used accent symbols.
I'm thinking of rust multiline strings, which start and end with the #
. In fact, it can be ##
or ###
as long as there's matching closing sequence.
So, what I'm trying to say is that we can find some rarely used character that is almost never used twice in a row, maybe even that same ##
and use this as the delimiter.
for multi line math block the '=' equal sign should be aligned in the middle. ....2x = 6 .... ......x = 3/2..
for multi line math block the '=' equal sign should be aligned in the middle. ....2x = 6 .... ......x = 3/2..
The math block should be
2x &= 6
x &= 3
Then the equal sign will be aligned by their left edge, and the whole block is aligned center.
As of now, having an asciimath block makes the block horizontally centered.
Can we have it left-aligned instead?
Even better, have a way to select the correct behavior in the block, or at least a setting?
Kudos for this excellent plugin 😊