Skip to content

Commit

Permalink
clearer overrightarrow label
Browse files Browse the repository at this point in the history
  • Loading branch information
krirkrirk committed Jan 2, 2025
1 parent 198ee60 commit 8b0099a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@ 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
<MathInput />
```

Getting the value of the input as a LaTeX string :

```js
```jsx
const [latex, setLatex] = useState("")
//...later
<MathInput setValue={setLatex} />
```

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<MathField>();
const onClick=()=> mf.current.latex("click!");
const onClick = () => mf.current.latex("click!");

//...later
<MathInput setMathfieldRef={(mathfield)=>mf.current=mathfield} />
Expand Down
12 changes: 11 additions & 1 deletion src/keyboard/keys/geometryKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { KeyProps } from "./key";
export const geometryKeysProps: KeyProps[] = [
{
id: "overrightarrow",
label: "\\overrightarrow{AB}",
label: "\\overrightarrow{\\ \\ \\ \\ \\ }",
labelType: "tex",
mathfieldInstructions: {
content: "overrightarrow",
Expand Down Expand Up @@ -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"],
},
];
2 changes: 1 addition & 1 deletion src/keyboard/keys/keyIds.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type KeyId =
export type KeyId =
/**quantities */
"volumeMere" | "volumeFille" | "concentrationMere" | "concentrationFille"
/**units */
Expand Down
1 change: 1 addition & 0 deletions src/keyboard/keys/keyIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type KeyId =
| "overrightarrow"
| "degree"
| "vectorU"
| "widehat"

/**operations */
| "plus"
Expand Down

0 comments on commit 8b0099a

Please sign in to comment.