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

It seems not possible to enter a simple integral using the virtual keyboard #2111

Closed
rs-mobitech opened this issue Aug 26, 2023 · 17 comments
Closed
Labels

Comments

@rs-mobitech
Copy link

This is what I would like to try and enter:

Screenshot 2023-08-26 at 14 33 21

But so far the closest I have been able to enter is this:

Screenshot 2023-08-26 at 14 36 31

I am not at all sure how to enter the remaining part

", dx"

Can you let me know if this is something missing with the keyboard, or if I am doing something wrong.

@arnog
Copy link
Owner

arnog commented Aug 28, 2023

You can enter "dx" using the "abc" (alphabetic keyboard) by pressing the "d" keycap followed by the "x" keycap.

@arnog arnog added the question label Aug 28, 2023
@rs-mobitech
Copy link
Author

rs-mobitech commented Aug 28, 2023

I refer to the image I included. In your compute engine documentation (the attached image), you show the integral ending in dx, but the boxed expression shows it ending in x. I’m a bit confused. Also, can the compute engine compute values for integrals?

@arnog
Copy link
Owner

arnog commented Aug 28, 2023

The "d" is part of the notation in LaTeX to indicate the variable the integral is relative to. It does not need to be included in the MathJSON.

The Compute Engine currently does not evaluate integral. There is an issue tracking this here: cortex-js/compute-engine#79

At some point someone had volunteered to provide an implementation for this, but it seems it was never delivered.

@rs-mobitech
Copy link
Author

Do you feel adding that capability might be a feature that you add before year end, or do you have other more important features you are considering working on for MathLive or CortexJS?

@arnog
Copy link
Owner

arnog commented Aug 28, 2023

It's hard to tell. This is an open source project. If someone volunteered to contribute the code, or was interested in funding development for it, this would affect its priority.

@rs-mobitech
Copy link
Author

rs-mobitech commented Aug 29, 2023

I spent some more time on this, and I still find it impossible to enter the correct Latex, which from my research is:

 \int \sin(x) \, dx

or get the correct MathJSON

here are some of my attempts at entering what's needed

Screenshot 2023-08-29 at 18 32 49 Screenshot 2023-08-29 at 18 22 08 Screenshot 2023-08-29 at 18 22 28 Screenshot 2023-08-29 at 18 27 54

Can you please give some advice on how I can enter the correct latex using the virtual keyboard:

\int \sin(x) , dx

Even if the "d" part is not needed, I still assume that people will want to enter that, and without that then the Latex is not correct and even when I tried to omit the d, I think it's likely that the mathJSON here:

[
  0"Sequence", 
  1["Integrate", ["Sin", "x"], "Nothing"], 
  2"x"
]

is not correct as it shows integration relative to nothing.

Thanks

@arnog
Copy link
Owner

arnog commented Aug 29, 2023

There is no comma before the dx

@rs-mobitech
Copy link
Author

I am sorry, I don't understand. Are you saying it's not normal convention to have a comma before the dx. If that is what you are saying then when I look at your documentation all the integrals use a comma. Also my research on the web that I looked at also said there should be a comma.

https://cortexjs.io/compute-engine/reference/calculus/

Can you enter an example into the mathfield, take a screen print to show the mathJSON, so I will understand what to do.

Thanks

@arnog
Copy link
Owner

arnog commented Aug 29, 2023

Are you saying it's not normal convention to have a comma before the dx

Yes, that is what I am saying.

when I look at your documentation all the integrals use a comma

Good catch. There was a bug in the documentation software that did not render the formula correctly. The comma should have been a horizontal space.

Also my research on the web that I looked at also said there should be a comma.

Interesting. Could you please provide some references? If that is indeed the case, I'd be happy to add support for this convention, but I haven't seen it before.

You may be confusing a comma , with the command \,. The latter is a spacing command, i.e. it adds a small horizontal space before the dx. It's optional, and can be used sometimes, and it is parsed correctly.

Screenshot 2023-08-29 at 10 32 19

@rs-mobitech
Copy link
Author

Thanks! Yes you are correct, I was confusing a comma , with the command \,.

  • I realize now that it's not needed, but is there a way to enter the spacing command with the virtual keyboard?
  • Also do you think it would be a good idea to add dx to the virtual keyboard, I see you already have a number of similar keycaps that can be added.
Screenshot 2023-08-30 at 14 18 03

@rs-mobitech
Copy link
Author

rs-mobitech commented Aug 31, 2023

I tried again to enter the integral, and I had a work colleague try to do this also. Neither of us were able to do it correctly, (perhaps because we don't know where the space key is), so I think it's reasonable to assume that others would not be able to do it also. Can you explain the keypresses that you use to enter, we both must be doing something wrong. Also is there any way it could be made more easy to enter, as I believe this may be difficult for others also.

One more thing, I notice you didn't enter parenthesis. How can it be done with parenthesis also.

Here's an example of an application, that makes it very easy to enter the integral. With just one key, everything is set up like this.

Screenshot 2023-08-31 at 12 07 45

@rs-mobitech
Copy link
Author

rs-mobitech commented Sep 1, 2023

@arnog - Were some changes made to the way integrals are input. When I enter the integral sign, I now see this:

Screenshot 2023-09-01 at 22 30 26

and when I enter sin(x)

Screenshot 2023-09-01 at 22 31 15

and then when I add in an x

Screenshot 2023-09-01 at 22 32 15

I'm not sure if this is correct, so perhaps you can advise:

 ["Integrate",["Sin","x"],"Nothing"]

When I try to add an x after that, it assumes a multiplication

["Integrate",["Multiply","x",["Sin","x"]],"Nothing"]

Also I see your code adds in a "dx", but what if I had wanted to show an integral with respect to dy or dz. I was thinking that adding in a dx, would be something that could be done by tapping keys and not added automatically.

Here is what I believe is the correct Latex, but I entered this in manually and didn't use the keyboards to enter it:

\int \sin(x) dx

Screenshot 2023-09-01 at 22 36 55

@arnog
Copy link
Owner

arnog commented Sep 1, 2023

I'm sorry, I'm having a hard time following what this issue is about. Would you succinctly explain:

  • what you do
  • what you are getting
  • what you were expecting instead

@rs-mobitech
Copy link
Author

Hello, apologies for any confusion.

What I would like to be able to do is to use the virtual keyboard to create this latex.

  \int \sin(x) dx

which results in this, which shows "nothing", in the place where I would expect to see "x"

Screenshot 2023-09-02 at 13 44 45

I have tried many combinations, but I still cannot do this with the virtual keyboard.

The most close I can get now is this

Screenshot 2023-09-02 at 13 51 19

@arnog
Copy link
Owner

arnog commented Sep 2, 2023

You can enter "dx" using the "abc" (alphabetic keyboard) by pressing the "d" keycap followed by the "x" keycap.

@rs-mobitech
Copy link
Author

I don’t have my computer with me right now, but I believe when I did that it didn’t create a clean mathJSON. Can you show me the keypresses you do to achieve the correct json, and I wil try those. Thanks

@arnog
Copy link
Owner

arnog commented Sep 9, 2023

I am unable to reproduce this problem. If you still have difficulties, please file a new issue, and provide a step by step explanation of what you are doing, what happens and what you were expecting instead.

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

No branches or pull requests

2 participants