Open mayurankv opened 1 year ago
Can you give some example use cases to help me understand the request?
So rather than using a=fraction(1/3)*(sin(1.5*pi))^2
, I would want to use a=\frac{1}{3}*(\sin(1.5*\pi))^{2}
.
I understand this isn't the most straightforward request. In many cases, simply ignoring the preceding backslash would make things work. I would only expect this to be implemented for extremely basic functions like fraction or those which work without the backslash in front. i.e. sin
works so \sin
should work but comb
is not an accepted function so I would not expect \comb
to work (combinatorics).
The only basic function I can think off that would need to be implemented differently is just fraction which goes from fraction(x/y)
to \frac{x}{y}
.
In addition treating {}
bracket pairs as ()
pairs would presumably work just fine for things like powers.
Essentially for functions the following rules could apply:
\func{x_1}{x_2},...,{x_n}
as math.func(x_1,x_2,...,x_n)
. Similarly \single_arg_func(x)
should be treated as math.single_arg_func(x)
.
\nonsense{3}
should be treated the same as nonsense(3)
.\frac{4}{5}
-> frac(4,5)
-> fraction(4/5)
(This could hypothetically solved by changing the fraction syntax too).{}
as brackets.This bit is hopefully quite a bit simpler, but allow for variables to be typed out using latex. This would be akin to allowing \vec{a}
to be a variable name that is rendered in latex or a_{i,j}
to be a variable name rendered properly. Currently using {}
gives an Unexpected operator error. In reality any variable name is a placeholder that should not really affect the program up to parsing.
Totally understand if this isn't something you want to pursue but I really do think the small addition of variables would be a big boost and proper treatment of latex functions would make this invaluable! Please let me know if you have any thoughts.
Just wondering if you've managed to have a think about this? (No worries if not!)
I use latex to take math notes in obsidian, compatibility would be nice
Writing latex with e.g. Latex Suite is super efficient and can even be customized.
For example, one can write @b
to get \beta
etc.
If Numerals would be interoperable with latex, this would already take care of e.g. #69, at least partially.
Another nice improvement would be the ability to write latex in comments. For example, I'd like to write this:
# Let $h$ be the hypotenuse of right triangle $\triangle{ABC}$:
h=5cm
# Let $@a$ be one of its angles:
@a=30
# Then the opposite $o$ of $@a$ is:
o=h\sin{@a}
I understand that it may be difficult to enable this.
Would it be possible to add latex support for the functions that mathjs supports? This would allow users who commonly type in latex to not use different syntaxes and be able to use other existing autocompletion tools!
EDIT: To clarify I meant without dropping of the . My title is a little bit misleading so apologies.