Search in sources :

Example 1 with TeXUtilities

use of org.matheclipse.core.eval.TeXUtilities in project symja_android_library by axkr.

the class BasicTeXTestCase method setUp.

/**
	 * The JUnit setup method
	 */
protected void setUp() {
    try {
        //			F.initSymbols();
        EvalEngine engine = new EvalEngine();
        texUtil = new TeXUtilities(engine, true);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : EvalEngine(org.matheclipse.core.eval.EvalEngine) TeXUtilities(org.matheclipse.core.eval.TeXUtilities)

Example 2 with TeXUtilities

use of org.matheclipse.core.eval.TeXUtilities in project symja_android_library by axkr.

the class TeXForm method evaluate.

@Override
public IExpr evaluate(final IAST ast, EvalEngine engine) {
    Validate.checkSize(ast, 2);
    TeXUtilities texUtil = new TeXUtilities(engine, engine.isRelaxedSyntax());
    IExpr arg1 = engine.evaluate(ast.arg1());
    StringWriter stw = new StringWriter();
    texUtil.toTeX(arg1, stw);
    return F.$str(stw.toString());
}
Also used : StringWriter(java.io.StringWriter) IExpr(org.matheclipse.core.interfaces.IExpr) TeXUtilities(org.matheclipse.core.eval.TeXUtilities)

Aggregations

TeXUtilities (org.matheclipse.core.eval.TeXUtilities)2 StringWriter (java.io.StringWriter)1 EvalEngine (org.matheclipse.core.eval.EvalEngine)1 IExpr (org.matheclipse.core.interfaces.IExpr)1