From 8b0099a23d8ce7a1bcaf5d1bdd07791803a93ea4 Mon Sep 17 00:00:00 2001 From: RobinG <80358683+krirkrirk@users.noreply.github.com> Date: Thu, 2 Jan 2025 23:17:56 +0100 Subject: [PATCH] clearer overrightarrow label --- README.md | 10 +++++----- src/keyboard/keys/geometryKeys.ts | 12 +++++++++++- src/keyboard/keys/keyIds.d.ts | 2 +- src/keyboard/keys/keyIds.ts | 1 + 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7e0c576..6d47dbc 100644 --- a/README.md +++ b/README.md @@ -23,19 +23,19 @@ npm i react-math-keyboard Then import the MathInput : -```js +```jsx import MathInput from "react-math-keyboard"; ``` You can then use it with no configuration : -```js +```jsx ``` Getting the value of the input as a LaTeX string : -```js +```jsx const [latex, setLatex] = useState("") //...later @@ -43,9 +43,9 @@ const [latex, setLatex] = useState("") If you need to do more specific stuff with the input, you should retrieve the ref to the MathField, and then the whole [MathQuill API](http://docs.mathquill.com/en/latest/Api_Methods/) is available to use. -```js +```jsx const mf = useRef(); -const onClick=()=> mf.current.latex("click!"); +const onClick = () => mf.current.latex("click!"); //...later mf.current=mathfield} /> diff --git a/src/keyboard/keys/geometryKeys.ts b/src/keyboard/keys/geometryKeys.ts index b83d22f..b385f9b 100644 --- a/src/keyboard/keys/geometryKeys.ts +++ b/src/keyboard/keys/geometryKeys.ts @@ -3,7 +3,7 @@ import { KeyProps } from "./key"; export const geometryKeysProps: KeyProps[] = [ { id: "overrightarrow", - label: "\\overrightarrow{AB}", + label: "\\overrightarrow{\\ \\ \\ \\ \\ }", labelType: "tex", mathfieldInstructions: { content: "overrightarrow", @@ -32,4 +32,14 @@ export const geometryKeysProps: KeyProps[] = [ }, groups: ["units", "geometry"], }, + { + id: "widehat", + label: "\\widehat{\\square}", + labelType: "tex", + mathfieldInstructions: { + content: "widehat", + method: "cmd", + }, + groups: ["geometry"], + }, ]; diff --git a/src/keyboard/keys/keyIds.d.ts b/src/keyboard/keys/keyIds.d.ts index e72559c..4288779 100644 --- a/src/keyboard/keys/keyIds.d.ts +++ b/src/keyboard/keys/keyIds.d.ts @@ -1,4 +1,4 @@ -export type KeyId = +export type KeyId = /**quantities */ "volumeMere" | "volumeFille" | "concentrationMere" | "concentrationFille" /**units */ diff --git a/src/keyboard/keys/keyIds.ts b/src/keyboard/keys/keyIds.ts index 7083e93..bd6e0a3 100644 --- a/src/keyboard/keys/keyIds.ts +++ b/src/keyboard/keys/keyIds.ts @@ -35,6 +35,7 @@ export type KeyId = | "overrightarrow" | "degree" | "vectorU" + | "widehat" /**operations */ | "plus"