Math equation formating

Hi kodular community i am working on a little math question solver and i tried to type some mathematical symbol and format as they are. is there possible HTML code font to do that.
like typing such equations.

help me this to do without extension using fonts only

:white_check_mark: What can be done using HTML + Unicode in Kodular:

Use superscripts and subscripts:

x2 + y1

Use Unicode math symbols (∫, √, π, ∞, etc.):

∫ x2 dx

Use basic styling (color, bold, italic):

∫ x2 dx

Approximate fractions using slash or Unicode fraction characters:

1/2 or ½


:cross_mark: What cannot be done purely with HTML in Kodular:

Display nicely formatted stacked fractions (like LaTeX: \frac{a}{b})

Display aligned integrals with upper/lower bounds in proper math format

Matrix or equation systems

Render square roots with a horizontal line above


this is a complex integral equation that includes:

Definite integral from -∞ to ∞

Exponential term with imaginary number

A rational function

π and imaginary unit i

A complex limit expression


:puzzle_piece: Objective:

Recreate this equation in Kodular using only HTML + Unicode (since LaTeX is not supported directly).


:memo: Here’s an HTML + Unicode Approximation:

−∞ e−3i·x2(x² + 4) dx + 0 = −2πi · limz→−2i (z + 2i)·f₂(z)

:magnifying_glass_tilted_right: Rendered Approximation (as close as possible in plain HTML):

∫₋∞^∞ e⁻³ⁱˣ / 2(x² + 4) dx + 0 = −2πi · limz→−2i (z + 2i)·f₂(z)


:wrench: How to Use in Kodular

  1. Drag a Label component into your screen.

  2. In Label Properties, enable HTML Format (Use HTML = true).

  3. Paste the above HTML into the Text field of the label.

  4. Set font to a monospace font or use larger size for better readability.


:prohibited: Limitations:

The fraction is represented inline (with slash) because HTML can’t stack numerators and denominators without full LaTeX.

Superscripts and subscripts are supported, but not automatically resized.

You may tweak font size manually to improve appearance.

if helpful mark as solution

2 Likes

For a solution with extension see

  • LatexViewer Extension by Passos_0213 (10 USD) to process and render LaTeX expressions and text as HTML using KaTeX

taken from the extensions directory App Inventor Extensions | Pura Vida Apps

@Glich nice answer… can you teach us, how you generated that answer? Obviously you did not write everything your own… Which AI did you use also to get this nice formatting?

Taifun

1 Like

Hey @Taifun i saw this project as a solution on MIT but some blocks are missed how can i fix.
Maths.aia (56.6 KB)

the result they show is perfect for me so how can you guise fix this.

Which blocks are you talking about?
Taifun


RunJavaScript and JsonObjectEncode blocks

Check the custom webviewer extension and the several json extensions

Taifun

Is there no way to get such blocks on kodualr? With out extension ??

Just do it manually
Pass the data in the correct format in the webviewstring and refresh the webviewer

You will need some html and Javascript know how, also it helps to understand, how the webviewstring works

Taifun

1 Like

Ow but i can’t figure out it for my project. Because of am not technical…:pensive_face:

Hi solomon,

I created this little project by importing the KaTex libraries to demonstrate that it is possible, the only problem is that it doesn’t allow you to create too complex formulas and you have to learn how to use its language.
If you need I can try to help you even if I’m not an expert (I took some examples from the internet, I didn’t make them myself).

immagine

immagine

immagine

immagine

immagine

Let’s see if it works for you.
HelpProjectMathExp.aia (406.9 KB)

2 Likes

Wow that’s so nice it works for me but how can i right system of linear equation and matrix, it shows “/n” that’s the only remain thing and i tried too much …thanks too

Hi solomon,
These are the functions supported by Katex,

I added some examples in the project to represent matrix, let me know if this is what you were looking for.

\begin{pmatrix} a_{11} & a_{12} & \dots & a_{1n} & b_1 \\ 
a_{21} & a_{22} & \dots & a_{2n} & b_2 \\ 
\vdots & \vdots & \ddots & \vdots & \vdots \\ 
a_{m1} & a_{m2} & \dots & a_{mn} & b_m 
\end{pmatrix}

immagine

\left| 
\begin{array}{cc} 
x_{11} & x_{12} \\ 
x_{21} & x_{22} 
\end{array} \right|

immagine

If you search online, always note that the formulas must be for KaTex and not Latex or others because they are not compatible

HelpProjectMathExp.aia (407.1 KB)

2 Likes

Glad to see your solution! thanks…

1 Like

Diff b/w LaTex & KaTex by web search google ai

KaTeX is a JavaScript library for rendering mathematical notation on the web, using a LaTeX-like syntax, but it’s not LaTeX itself. While it shares a similar syntax with LaTeX, it’s a separate tool designed for speed and ease of use in web browsers, whereas LaTeX is a full document preparation system. [1, 2]
Here’s a breakdown: [1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]

• LaTeX: A powerful document preparation system used for creating professional-quality documents, especially those with complex mathematical content.
• KaTeX: A JavaScript library focused on quickly rendering mathematical expressions in web browsers using a LaTeX-like syntax.
• Key Differences:
• Functionality: LaTeX is a full typesetting system, while KaTeX primarily focuses on rendering math notation within web pages.
• Complexity: LaTeX can handle complex document structure and formatting, while KaTeX is designed for simpler, focused math rendering.
• Dependencies: LaTeX requires a full TeX distribution, while KaTeX is a lightweight JavaScript library.
• Output: LaTeX produces PDF or other document formats, while KaTeX renders math directly in the browser’s HTML.

• Use Cases:
• KaTeX is ideal for situations where you need to display math on a website or in a web application, like in blog posts, documentation, or online learning platforms.
• LaTeX is preferred for creating complete documents, like research papers, books, or reports.

AI responses may include mistakes.

[1] https://tex.stackexchange.com/questions/648196/whats-the-difference-between-different-latex-versions-like-livetex-katex-macte[2] https://standardnotes.com/blog/what-are-latex-tex-and-katex[3] https://www.kaggle.com/code/jocelyndumlao/latex-for-mathematical-equations[4] https://www.zoology.ubc.ca/rikblok/TipsnTricks/miktex.html[5] https://astrobites.org/2018/01/20/getting-started-with-latex/[6] https://www.reddit.com/r/LaTeX/comments/n7zs8j/difference_between_latex_and_katex_also_asking/[7] https://www.bu.edu/math/files/2013/08/ShortTeX3.pdf[8] https://tilburgsciencehub.com/topics/research-skills/templates-dynamic-content/templates/amsmath-latex-cheatsheet/[9] https://www.bypeople.com/math-typesetting-javascript-library/[10] https://squidfunk.github.io/mkdocs-material/reference/math/[11] https://github.com/KaTeX/KaTeX/issues/382[12] https://support.discord.com/hc/en-us/community/posts/14426538726551-KaTeX-Capability-for-Text-Channels[13] https://typeset.io/resources/learn-latex-beginners-step-by-step-guide/[14] https://milq.github.io/install-latex-ubuntu-debian/[15] https://latex.knobs-dials.com/[16] Inroduction to Latex | PPTX

2 Likes

And in addition to that how can i remove \n like this


Without removing space manually, just some adjustment on block??

Hi,

Can you give me the Katex code?

Katex code 1

\begin{bmatrix}
   a_{11} & a_{12} & a_{13} \\
   a_{21} & a_{22} & a_{23} \\
   a_{31} & a_{32} & a_{33}
 \end{bmatrix}

Katex code 2

 \left\{
 \begin{aligned}
   2x + 3y &= 5 \\
   4x - y  &= 11 \\
   4x - y  &= 11
 \end{aligned}
\right.

i edit as a code, check it again!

\begin{bmatrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33}
\end{bmatrix}

immagine

\left\{
\begin{aligned}
2x + 3y &= 5 \\
4x - y &= 11 \\
4x - y &= 11
\end{aligned}
\right.

immagine

For me its working,
could you show me the blocks you are using?