README update for matrices

This commit is contained in:
Lephenixnoir 2019-06-17 21:41:50 -04:00
parent d54f17fab2
commit 3ff304014b
2 changed files with 10 additions and 8 deletions

View File

@ -3,16 +3,17 @@
This library is a customizable 2D math rendering tool for calculators. It can be used to render 2D formulae, either from an existing structure or TeX syntax.
```latex
\frac{x^7\left[X,Y\right]+3\left|\frac{A}{B}\right>}
{\left\{\frac{a_k+b_k}{5!}\right\}^n}
+ \sum_{k=1}^nk(-1)^k
\frac{x^7 \left[X,Y\right] + 3\left|\frac{A}{B}\right>}
{\left\{\frac{a_k+b_k}{k!}\right\}^5}
+ \int_a^b \frac{\left(b-t\right)^{n+1}}{n!} dt
+ \left(\begin{matrix} \frac{1}{2} & 5 \\ -1 & a+b \end{matrix}\right)
```
![Sample image](https://framapic.org/MGABuOpMUDxn/duzY5eaLNVTj.png)
![Sample image](https://www.planet-casio.com/files/forums/TeX-13737.png)
## Features
* Build formulae from TeX syntax
* Build formulae from TeX syntax or using the structural API
* Highly-customizable graphical and layout parameters
* Drawing is based on a few user-provided primitives (point, line, text size,
text)
@ -26,12 +27,11 @@ List of currently supported elements:
* Grouping angle brackets, vertical lines, and dots (invisible)
* Sums, products and integrals (`\sum`, `\prod` and `\int`)
* Vectors (`\vec`) and limits (`\lim`)
* Matrices (`\begin{matrix} ... \end{matrix}`)
Features that are partially implemented (and what is left to finish them):
* Support for inline style and display style (expose a parameter)
* API functions to build TeX objects without a TeX formula (expose functions
which are currently in the parser)
* Full fx-CG 50 support (suitable parenthesis styles)
See the `TODO.md` file for more features to come.

View File

@ -171,6 +171,8 @@ static void matrix_layout(struct TeX_Env *env)
}
struct TeX_Flow *f = m->elements[i];
if(!f) { col++; continue; }
TeX_flow_layout(f);
/* Update the current row and column */
@ -214,7 +216,7 @@ static void matrix_render(struct TeX_Env *env, int x, int y, int color)
int cw = m->colwidth[col];
int rh = m->rowline[row] + m->rowdepth[row];
TeX_flow_render(flow,
if(flow) TeX_flow_render(flow,
x + dx + ((cw - flow->width) >> 1),
y + dy + ((rh - flow->height) >> 1),
color);