Skip to content

Interrupting theta after th leaves \operatorname{th} instead of \theta #3112

Open

Description

@malav2110

Typing theta in one go gives \theta. If the user presses an arrow key or clicks in the field after th, the field keeps \operatorname{th}. This differs from #2536. Instead of staying as plain letters, the interrupted name becomes an operator name the user did not type.

Steps, on MathLive 0.111.1, Chrome 154.0.8037.99, macOS:

<!doctype html>
<script defer src="https://cdn.jsdelivr.net/npm/mathlive@0.111.1"></script>
<math-field id="field"></math-field>
<pre id="value"></pre>
<script>
  const field = document.getElementById("field");
  field.addEventListener("input", () => {
    document.getElementById("value").textContent = field.value;
  });
</script>
  1. Type t h, press Left, press Right, then type eta. The value is \operatorname{\mathrm{th}eta}.
  2. Clear the field. Type t h, click in the field, then type eta. The value is \operatorname{\mathrm{th}}\eta.

Expected: \theta, or the plain letters theta as in #2536.

From reading the source: th is a default shortcut for \operatorname{th}, and it is also the start of theta. So it converts on the h. The theta match normally replaces it, but an arrow key or a click clears the shortcut buffer first. The pairs ch and chi, and del and delta, overlap the same way.

Would you be open to removing th and ch from the default shortcuts? An app that wants them can still add them back. We remove them in our own config for now. If that direction works for you, I can open a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions