Coder Social home page Coder Social logo

zzugbb / formula-edit Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 8.03 MB

此工程为公式在线编辑demo

Home Page: https://zzugbb.github.io/formula-edit/

License: MIT License

CSS 10.02% HTML 67.51% JavaScript 22.46%
mathjax latex formula formula-editor

formula-edit's Introduction

Hello, I'm Gbb. Love Code!


About me 👋

  • 🔭 I’m currently working on Frontend development

  • 🌱 Sharing awesome-my-website, Learning, Work, Entertainment, My Star, Catch all in one draft.

  • ⚡ Sharing My blog, Hoping it can be updated frequently


html javascript css jquery Ajax

git webpack npm eslint

React Vue nodejs

formula-edit's People

Contributors

zzugbb avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

agang235

formula-edit's Issues

mathJax使用说明

说明

本文档主要对公式渲染组件 MathJax 整体部署及使用加以说明。

整理时间

2018-07-25

MathJax介绍

MathJax 是一个 JavaScript 引擎,用来显示网络上的数学公式。它可以工作于所有流行的浏览器上。

使用场景

MathType公式 都转化为了 latex公式代码

接口将其题目查出后返回到页面展示层,为了能够正确展示给用户看,需要用到渲染组件MathJax

具体效果

使用组件渲染前的题目效果

before

使用组件渲染后的题目效果

after

具体使用

页面引入

<script type="text/javascript" src="/MathJax/2.7.2/MathJax.js?config=TeX-AMS_CHTML"></script>

页面代码

<div>$\frac{x^3}{e^x-1}$</div> 

页面Js相关配置项

MathJax.Hub.Config({
  showProcessingMessages: false,
  messageStyle: "none", 
  extensions: ["tex2jax.js"],
  jax: ["input/TeX", "output/HTML-CSS"],
  tex2jax: {inlineMath: [["$","$"],["\\(","\\)"],["\[","\]"]]},
});

注意事项&&问题

试题相关信息可能是页面发异步请求而得到的,由于js执行顺序的问题,此时需要在渲染完毕的回调中加入代码,保证能够正确渲染。

MathJax.Hub.Queue(["Typeset", MathJax.Hub]);

参考资料

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.