tex
result = tex(x)
Input: x · Output: result
What it is
Not figure export — converts a single Qu value x (number, Vec, Mat, or complex) to a LaTeX math-mode string (e.g. a matrix becomes a bmatrix environment) and returns it as a string. Pairs with str the way printtex pairs with print.
Overloads
x can be number, Complex, scalar, Vec, or Mat.
3 forms. Each carries its own inputs, outputs and worked example — pick the tab for the one you are calling.
| Code | Input | Output | Description |
result = tex(x) | x numbernot documented yet | result Str | Small/large magnitudes get split into \times 10^{n} scientific notation; otherwise it's printed as an ordinary decimal. |
Examples
Written for this form and run by the build -- the output below is what the engine actually produced.
print(tex(4.7e-8))
$4.7 \times 10^{-8}$| Code | Input | Output | Description |
result = tex(x) | x Complex or scalarnot documented yet | result Str | Each component is formatted the same way a real scalar would be (including the scientific-notation split when a component is small/large), then joined as re + im i. |
Examples
Written for this form and run by the build -- the output below is what the engine actually produced.
print(tex(3 + 4j))
$3 + 4j$
| Code | Input | Output | Description |
result = tex(x) | x Vec or Matnot documented yet | result number | Returns a bmatrix environment instead of a bare number, with & separating entries. |
Examples
Written for this form and run by the build -- the output below is what the engine actually produced.
print(tex([1, 2, 3]))
$\begin{bmatrix} 1 & 2 & 3 \end{bmatrix}$printtex follows the exact same three cases — it just prints instead of returning the string.