It is a wrap for this Github project. No other libs required other than the attached B4A libraries. Extract them and copy them to your additional library folder.
You need to download and extract this folder (https://www.dropbox.com/s/1sthbkm5vc7fa0h/katex.zip?dl=0) and copy the folder with its contents to be under the /Files folder of the B4A project i.e.
Files
1. B4A library files
2. B4A sample project.
Sample code:
See what I have done to change the formulas to display correctly.
Visit https://khan.github.io/KaTeX/
You can download it and test if but if you want to use it you need to
You need to download and extract this folder (https://www.dropbox.com/s/1sthbkm5vc7fa0h/katex.zip?dl=0) and copy the folder with its contents to be under the /Files folder of the B4A project i.e.
Files
katex
Posting:....a number of files and folders....
1. B4A library files
2. B4A sample project.
Sample code:
B4X:
#Region Project Attributes
#ApplicationLabel: b4aKatexMathView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private kmv1 As KatexMathView
Private kmv2 As KatexMathView
Private kmv3 As KatexMathView
Private kmv4 As KatexMathView
Private kmv5 As KatexMathView
Private kmv6 As KatexMathView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
kmv1.TextColor = Colors.White
kmv1.TextSize = 11
kmv1.ViewBackgroundColor = Colors.Black
kmv1.DisplayText = "$x=\frac{1+y}{1+2z^2}$"
kmv2.TextColor = Colors.Blue
kmv2.ViewBackgroundColor = Colors.White
kmv2.TextSize = 11
kmv2.DisplayText = "$\frac{4}{7}\times560=320$"
kmv3.ViewBackgroundColor = Colors.Yellow
kmv3.TextColor = Colors.Red
kmv3.TextSize = 11
kmv3.DisplayText = "$\int_0^\infty e^{-x^2} dx=\frac{\sqrt{\pi}}{2}$"
kmv4.TextColor = Colors.Magenta
kmv4.ViewBackgroundColor = Colors.Green
kmv4.TextSize = 11
kmv4.DisplayText = "$\int \!\! \int f(x,y)\,\mathrm{d}x\mathrm{d}y$"
kmv5.TextColor = Colors.Black
kmv5.ViewBackgroundColor = Colors.Magenta
kmv5.TextSize = 11
kmv5.DisplayText = "$\displaystyle \int_0^\infty e^{-x^2} dx$"
kmv6.TextColor = Colors.Magenta
kmv6.ViewBackgroundColor = Colors.LightGray
kmv6.TextSize = 11
kmv6.DisplayText = "${n+1\choose k} = {n\choose k} + {n \choose k-1}$"
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
See what I have done to change the formulas to display correctly.
Visit https://khan.github.io/KaTeX/
You can download it and test if but if you want to use it you need to
Attachments
Last edited: