← Back to team overview

zim-wiki team mailing list archive

Change input

 

Hi!

I use zim for elementary school children. Now I'd like to get it working for basic arithmetics and I'm kind of stuck. Maybe you could direct me where I should get working on the code?

I'd like to let the user build calulations like these, where the numbers align "magicly" in the same way like you'd write it on paper, i.e.:
- numbers use monospaced font
- line is right aligned
- numbers are entered left-to-right
- numbers in the line under the summation-line are entered right-to-left

example:
	123
	 45
	---
	168

	 123
	4567
	----
	4690

To a monospaced font, I added to .config/zim/style.conf:
	[Tag indent]
	foreground=#000080
	family=monospace 
which takes perfectly care about entering "atithmetic mode". 

Now thew hard part:
The user types:	"<tab>123<return>4"
ZIM diplays:
<tab>123
<tab><space><space>4

the user continues: "5"
ZIM diplays:
<tab>123
<tab><space>45

the user continues: "<return>-<return>"
ZIM diplays:
<tab>123
<tab><space>45
<tab>---
<tab>

the user continues: "8"
ZIM diplays:
<tab>123
<tab><space>45
<tab>---
<tab><space><space>8

the user continues: "6"
ZIM diplays:
<tab>123
<tab><space>45
<tab>---
<tab><space>68

the user continues: "1"
ZIM diplays:
<tab>123
<tab><space>45
<tab>---
<tab>168

So, where should I start hacking?

Nik

-- 
Please do not email me anything that you are not comfortable also sharing with the NSA.


Follow ups