GithubHelp home page GithubHelp logo

TeXViewRenderingEngine katex(); $Package's mathematical formula $... $, and does not translate into a mathematical formula about flutter_tex HOT 2 CLOSED

MisterZhu avatar MisterZhu commented on June 5, 2024
TeXViewRenderingEngine katex(); $Package's mathematical formula $... $, and does not translate into a mathematical formula

from flutter_tex.

Comments (2)

MisterZhu avatar MisterZhu commented on June 5, 2024

This is the code I used
Figure 1 is renderingEngine: TeXViewRenderingEngine katex (),
Figure 2 is renderingEngine: TeXViewRenderingEngine mathjax (),
But now I need renderingEngine: TeXViewRenderingEngine katex (), can display properly
Related code:

TeXView mathdown(String content) {
  String str = r"""Calculus is a branch of mathematics that deals with the derivatives and integrals of functions. Here is an example calculus:
Example: Find the derivative of the function $f(x)=x^3$at $x=2$.
Solution: Using the derivation formula, we can find the derivation of $f'(x)$:
$$f'(x) = 3x^2$$
Then, put $x=2$into $f'(x)$to get:
$$f'(2) = 3(2)^2 = 12$$
Thus, the derivative of the function $f(x)$at $x=2$is $12$.""";
    return TeXView(
      renderingEngine: TeXViewRenderingEngine.katex(),
      child:
      TeXViewDocument(
        str,
        style: TeXViewStyle(
          margin: TeXViewMargin.only(top: 10),
          fontStyle: TeXViewFontStyle(
            fontSize: 16,
          ),
          contentColor: TBDefVal.chatRegularColor,
        ),
        // 设置字体颜色
      ),
      style: const TeXViewStyle(
        backgroundColor: Colors.white,
      ),
    );
  }

from flutter_tex.

shah-xad avatar shah-xad commented on June 5, 2024

use (your latex code) for inline rendering.

from flutter_tex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.