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

Make formula editing on Android usable #70

Open
orithena opened this issue Apr 3, 2018 · 13 comments
Open

Make formula editing on Android usable #70

orithena opened this issue Apr 3, 2018 · 13 comments
Milestone

Comments

@orithena
Copy link

orithena commented Apr 3, 2018

Hi, I'm having some issues with formula editing on Android. None of the methods I tried allow me to add a simple "* cos( sqrt(x^2 + y^2) )" to the example formula of the 3D plot example.

Before I try to explain what I tried here in words, please see this screencast.

I concede that this is my first attempt with this app, and overall, it looks great and would fill some of my use cases like no other app, but if I can't enter some basic formulae, it ceases to have any value :/

@mkulesh
Copy link
Owner

mkulesh commented Apr 5, 2018

Hi @orithena, thank for the screencast. How I see, the problem is related to summation and subtraction operation. It is a little bit confusing since the single "+" and "-" are used as a part of number (i.e -4, 5+4i). If you need summation operator, please put "+" twice, i.e "++" instead of "+" or use the corresponding button from mathematical palette. The same situation with subtraction operator: put "-" symbol twice, i.e "- -".
Do you have any ideas how the editing can be improved?

@orithena
Copy link
Author

orithena commented Apr 5, 2018

Thanks for taking the time to look into this!

Well, a "formula editing mode" might be a good thing, e.g. when you tap a formula, it gets exclusive screen estate, is displayed bigger, edit mode stops with an OK button, etc... (basically, the formula expands into a modal dialog).
Also, in this mode, a light gray button with a white + sign (for example) could be displayed at each possible insertion point to make it clear how the cursor could be moved to exactly that point; then the gray box could expand to the red boxes that are already in use. Or the standard method of moving the cursor (tap to get a handle below the cursor, move using the handle to the desired point).

I myself could also work with a LaTeX math syntax or a programming syntax (where each symbol is replaced with a function) mode :)

@vi
Copy link

vi commented Apr 11, 2018

Can a formula be displayed as a tree for editing?

With tree operations like change operator, remove operator (bring operands up one level), introduce parentheses, swap two parts operands, duplicate operand and so on

Or can it just support editing as TeX?

@jinx100
Copy link

jinx100 commented Jul 22, 2018

I like the formula entry and editing on Android. It is a new method but easy and forgiving after a little practice. This is a very polished math program and fun to use. Where can we share our work?

@mkulesh
Copy link
Owner

mkulesh commented Jul 27, 2018

Hi @jinx100, if you like to share some your calculatons, please ether send me your files per e-mail (mikhail.kulesh@gmail.com) or just add these files to the diectory https://github.com/mkulesh/microMathematics/tree/master/app/src/main/assets/examples and open a pull reqest.

@lonetech
Copy link

lonetech commented Aug 16, 2018

The screencast demonstrates a few unintuitive UI issues (such as the zoom center), but most of it is spent on one central difficulty: placing the cursor for entering more text into a formula. This is largely because the formula entry has more of an active element than cursor position. When selecting somewhere in the formula, an entire element is selected, and when entering a function that function is applied to the element. The element being operated on in such a manner is highlighted in blue in the screencast.

The workaround I found to achieve the desired operation of entering sqrt(x^2+y^2) is a bit tricky: First, I enter #x^2 for sqrt(x^2). Then, I long tap to select the x or 2. I then see that the blue selection doesn't cover the entire term, so I tap the widen button in the top toolbar; it's the one with four arrows, which might mean fullscreen, maximise or something in another program. Here, it widens the selection one operation, to x^2. Only then can I do the addition to add another term inside the square root.

Another option for entering this is to take more of a polish notation approach: enter the addition operator first within the square root. This is when the double operator comes into play, as a single plus just became a unary sign operator. The entry in this case looks like: #++x^2>y^2 (where > is right arrow). This works because there's always an unfilled red box node to enter.

I also didn't find a way to make node selections with the keyboard. Some small ways to improve this (but that don't completely alleviate the confusion shown):

  1. Add a hotkey for the Expand Selection operation (perhaps shift+up? or ctrl+a?).
  2. Automatically select a term when all its contents are selected as text.
  3. Make Expand Selection always visible.
  4. Make Expand Selection select the entire term the cursor is in if nothing was selected.

Currently ctrl+a will select the entire text content of the node being edited, but that doesn't select the node and doesn't make Expand Selection work or appear.

It might also be nice to have a simple way to remove a wrapping operator such as unneeded double parenthesis. My current workaround is to select the content node, cut, select the empty space, widen, then paste over the newly emptied wrapping operator.

@jinx100
Copy link

jinx100 commented Aug 17, 2018

You may be fighting the system by entering text directly. Try building the structure of an equation using strip of functions before typing in any variables. This building needs to be done from the outside to the inside like the layers of an onion.

To modify the 3D plot equation, long tap to select any element and use the expand button to get the entire right side selected. This gets to the correct layer to add a new factor. From the strip hit:

  1. Times block
  2. Cos block
  3. Sqrt block
  4. Plus block
  5. Exp block for each Plus block.

Then enter x, 2, y, and 2 in the appropriate blocks.

You already have a good feel for this system since removing an extra set of parentheses is tricky and you got that right. I select everything inside the parentheses, cut that, backspace to eliminate the parentheses, select the remaining block, paste back what was cut.

I think it is correct to hide the expand, cut and paste icons until something is selected by a long press. This helps differentiate between editing text and editing structure. Also, there is no ctrl key on my Android phone (or tablet) so key combinations make no sense.

This equation entry system is new and different but becomes logical and fun with practice.

@lonetech
Copy link

... what? Are you trying to argue that I should be browsing the ridiculously long toolbar strip with the touchscreen instead of directly writing on my very real keyboard (many devices have them, practically all can have them added)? And why, when this issue is in the first place about the difficulty in finding the function? How is your experience made any worse by making this function easier to find and use? The screencast posted in the original report shows specifically using the touchscreen navigation and failing to find the selection handling - which in turn perhaps shouldn't be so unidirectional (tap one element, then expand, no option to go from one element to e.g. one of its arguments). It's evident that the selection isn't obvious to everyone and you didn't provide the guidance, only kept repeating "it's fun, stop fighting the touchscreen".

I also already described the entry process you only now described, as a Polish notation process. Back when the help was first asked for you posted "I like it", no instructions. This is a problem. That process works when you have the formula to enter in a mental AST (abstract syntax tree), but still doesn't solve the editing difficulty. Pointing out the selection and expand selection is still necessary for that.

Your Android phone is not the only device out there. I started using this program on a Planet Computers Gemini PDA.

@jinx100
Copy link

jinx100 commented Aug 17, 2018

You are correct that you were first to describe the selection and expansion process. I just tried to give a concise solution to the original complaint.

I do suggest you use the "ridiculously" long strip, it is not that difficult. Android is a touch screen operating system and keyboards are optional.

@lonetech
Copy link

lonetech commented Aug 17, 2018

Except all the operations on that strip are the things I can easily type. It's the operations I can't do with it that are also hard or impossible with the keyboard. Like changing an addition to a subtraction (which in an actual formula is just changing the sign of a term). Or choosing where to place a new term, which requires this long-press + expand combination, that's awkward on touchscreen and inaccessible on keyboard. Just why does short pressing anywhere but a text field on a formula neither select anything nor place a cursor? Another oddity is that I can add parenthesis using (, but being a finished node type, typing ) doesn't leave or select the parenthesis - just add an invalid character in the text node.
This isn't a case of the keyboard being a worse entry device - it's an editor that's awkward with a pointing device and impossible without. We have examples of easier formula entry in TeXmacs, LyX, even LibreOffice. And it's mostly down to the inability to place a cursor, partly down to the tree editing where the only operation is add node, not alter.

For another example of where this tree structure is awkwardly unpredictable:

  1. Start a new formula.
  2. Make a two term operation, for instance a++b.
  3. Tap or arrow to place the cursor on the left side of the second term.
  4. Enter -- using the keyboard.

We now have a formula reading a+box-b, but hitting backspace in the empty box removes the - operator on the right, not the + operator on the left.

That sounds like an awkward procedure, but it's exactly the same result to enter a++b--c (go ahead, use the toolbar, same thing) then tapping the b and deleting. Suddenly the sign of c is gone. When standing between two operators of the same priority the only way to tell which you're in is to select one of them, which requires a long press, while a short press on them does nothing.

The workaround for the simple case of having entered a+b-c and wanting to remove the b term is: long press a, cut or copy, long press b, paste, long press -, cut or copy, long press +, paste.
Alternative workaround: copy the entire formula, but although I can copy an entire root equation I can't paste it, so I have to add a new equation and copy either side individually. Then copy the - operation from the original to the root, then the a term from the original over the b term of the new equation, then remove the old equation.

Better workaround still: Save the document, open the xml in another editor, and I can actually change node types and move terms freely. As a bonus, suddenly see the information that "a" is interpreted as a unit, not a variable (I guess I'd have found that out when evaluating).

The system is passable if you plan out all your formula entry from the outside in, but quite bad for editing your existing formula. The biggest positive, I guess, is that it can automatically render parenthesis to show its structure when required (but doesn't predict that it may be required to understand what you're changing).

For an interface that really would deal well with touchscreen, the visual tree transformation is a good idea. You could then have operations with arbitrary branchouts (think sum, not add two terms) and drag nodes about to rearrange. But that's definitely a lot more work than a few changes to make selection easier to do.

@hubgitti
Copy link

Is it possible to have kind of a "plain text edit"-mode in your software, so that the data just can be entered or edited directly, without the use of these boxes?

@mkulesh
Copy link
Owner

mkulesh commented Nov 5, 2020

Plus/Minus operators improved in the #97

@mkulesh
Copy link
Owner

mkulesh commented Nov 13, 2022

Insertion before a selected term improved in #126

@mkulesh mkulesh reopened this Nov 13, 2022
@mkulesh mkulesh added this to the Analized milestone Nov 13, 2022
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

No branches or pull requests

6 participants