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

Different behaviour of / depending on the letter that precedes it #1869

Closed
Leon-Lj opened this issue Mar 7, 2023 · 1 comment
Closed

Different behaviour of / depending on the letter that precedes it #1869

Leon-Lj opened this issue Mar 7, 2023 · 1 comment

Comments

@Leon-Lj
Copy link

Leon-Lj commented Mar 7, 2023

Description

When typing / to create a fraction in mathlive the result differs depending on what comes before. All numbers will result in number/placeholder while some letter will be letter/placeholder while others will be letter * placeholder/placeholder.

For example typing r then / will result in r/placeholder while typing f then / will result in f * placeholder/placeholder.

So for example if you're to write an expression for the area of a triangle of base=b and height=h then you get different behavior depending on the order you write it in. A=hb/2 will result in A=(hb)/2, while A=bh/2 will result in A=bh*2/placeholder.

Arno wrote on Gitter

"f", "g" and "h" are considered functions which affects how they are handled. However, one could argue that the current behavior is incorrect. When trying to find an implicit argument for the numerator, functions are excluded, which is why it looks left and stops at "f", "g" or "h". This behavior is intended to deal with the case \cos 2 followed by /. In most cases you want the 2 in the numerator, but not the \cos. However, that works because \cos is a special function that can be written without parentheses around its arguments. That should not apply for "f", "g" and "h".

Note: This was just a curiosity that I found, not sure it's the most important of issues. :)

@gunnarmein-ts
Copy link
Contributor

A setting to control this behavior would be very nice!

mgreminger added a commit to mgreminger/mathlive that referenced this issue Jul 2, 2023
Removes special treatment of f, g, and h as implicit functions. Main side affect was that divide command worked different for variables containing f, g, or h compared to those without f, g, or h

fixes arnog#1869
@arnog arnog closed this as completed in 07ef4b4 Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants