TIMath23 / TIM

TIM (The Interactive Material) is an open-source cloud-based platform for creating interactive learning documents.
https://tim.education/view/about/en-US
MIT License
0 stars 0 forks source link

Fix \& not working in align formulas #246

Open janmatla opened 1 year ago

janmatla commented 1 year ago

\& character can't be written in align type formulas. It is replaced by align symbol &.

janmatla commented 1 year ago

When editing a formula, replacing the characters are done by editHandler and handleLatexInput in formula-field.component.ts.

Values used for replacing are defined by type-, write- and editReplace in formula-types.ts.

In editHandler, typeReplace first replaces characters inside visual field and then writeReplace replaces characters before string is sent to LaTeX field.

https://github.com/TIMath23/TIM/blob/dd0d31f3d5f78b552b1f09b8f5bcd66338f0c3fa/timApp/modules/cs/js/editor/math-editor/formula-field.component.ts

https://github.com/TIMath23/TIM/blob/dd0d31f3d5f78b552b1f09b8f5bcd66338f0c3fa/timApp/modules/cs/js/editor/math-editor/formula-types.ts