Mathjs: Set functions do not have a LaTEX renderer

Created on 28 Oct 2018  Â·  2Comments  Â·  Source: josdejong/mathjs

When I export an expression containing set functions to TEX math, the operations don't get transformed to the standard mathematical notation. Instead I get the names of the functions.

Input

math.parse('setCartesian(B, C)').toTex()
math.parse('setDifference(B, C)').toTex()
math.parse('setIntersect(B, C)').toTex()
math.parse('setIsSubset(B, C)').toTex()
math.parse('setSymDifference(B, C)').toTex()
math.parse('setUnion(B, C)').toTex()
math.parse('setSize(B)').toTex()

math.parse('setMultiplicity(n, B)').toTex()
math.parse('setPowerset(B)').toTex()

Expected results

B \times C      % cartesian product
B \setminus C   % difference
B \cap C        % intersection
B \subseteq C   % subset
B \triangle C   % symmetric difference
B \cup C        % union
\card{B}        % size or cardinality

\mathrm{\nu}_B\left(n\right)    % multiplicity function [1]
\mathcal{P}\left(B\right)    …or…    2^B   % power set

Actual results

\mathrm{setCartesian}\left(\mathrm{B},\mathrm{C}\right)
% and similar

References

[1] [OEIS: Multiplicity function](https://oeis.org/wiki/Multisets#Multiplicity_function)

feature help wanted

All 2 comments

This is because nobody has implemented the LaTeX-Conversion for these functions yet so the default one using the function names is used. Feel free to implement the .toTex properties of them either as a function or a template string.

Thanks @m93a , would be nice to improve the tex output of these functions. Any help is welcome here, should be complicated to change.

Was this page helpful?
0 / 5 - 0 ratings