/** * Converts the inputExpression string into a TeX expression and writes the * result to the given <code>Writer</code> * * @param inputExpression * @param out */ synchronized public void toTeX(final String inputExpression, final Writer out) { IExpr parsedExpression = null; if (inputExpression != null) { try { parsedExpression = fParser.parse(inputExpression); // parsedExpression = AST2Expr.CONST.convert(node); } catch (final Throwable e) { // parsedExpression == null ==> fError occured } } toTeX(parsedExpression, out); }
@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()); }
/** * Converts the inputExpression string into a TeX expression and writes the * result to the given <code>Writer</code> * * @param inputExpression * @param out */ synchronized public void toTeX(final String inputExpression, final Writer out) { IExpr parsedExpression = null; ASTNode node; if (inputExpression != null) { try { node = fParser.parse(inputExpression); parsedExpression = AST2Expr.CONST.convert(node); } catch (final Throwable e) { // parsedExpression == null ==> fError occured } } toTeX(parsedExpression, out); }