System for editing, displaying and exporting mathematical formulas in HTML to Word documents

文档序号:1505363 发布日期:2020-02-07 浏览:6次 中文

阅读说明:本技术 用于数学公式在HTML中编辑显示和导出到Word文档中的系统 (System for editing, displaying and exporting mathematical formulas in HTML to Word documents ) 是由 李海涛 张德春 尹山 张雷 郑焕舒 于 2019-09-25 设计创作,主要内容包括:本发明涉及数据信息处理技术领域,涉及数学公式的编辑显示和导出到Word文档中的系统。该系统包括:数学公式模板生成器,使用数学公式编辑器MathQuill生成数学公式的HTML元素模板;数据清洗器,用于将HTML元素集导出成字符串,利用正则表达式整理成带格式标记的文本数据,抹去没有数据的空元素、跟格式无关的标记,提炼出公式内各个模块及其子模块的数据与格式标记;格式转化器,用于将加上格式标记到的数学公式转为MathML格式的文本;数学公式渲染器,用于将所述的MathML格式的文本在HTML中显示为数学公式;数学公式输出器,用于实现数学公式的网页打印和导出到Word文档中。本发明的系统,为用户提供一种方便快捷的网页数学公式编辑器,并能实现网页打印和导出到Word文档中。(The invention relates to the technical field of data information processing, in particular to a system for editing, displaying and exporting mathematical formulas into Word documents. The system comprises: a mathematical formula template generator, which uses a mathematical formula editor MathQuill to generate an HTML element template of a mathematical formula; the data cleaner is used for exporting the HTML element set into a character string, utilizing the regular expression to arrange text data with format marks, erasing null elements without data and marks irrelevant to the format, and extracting data and format marks of each module and sub-modules thereof in the formula; the format converter is used for converting the mathematical formula added with the format mark into a text in a MathML format; the mathematical formula renderer is used for displaying the text in the MathML format in the HTML as a mathematical formula; and the mathematical formula outputter is used for printing the webpage realizing the mathematical formula and exporting the webpage to a Word document. The system of the invention provides a convenient and fast web page mathematical formula editor for users, and can realize the printing and exporting of web pages to Word documents.)

1. A system for editing display of mathematical formulas in HTML and export into a Word document, characterized by: the method comprises the following steps:

a mathematical formula template generator, which uses a mathematical formula editor MathQuill to generate an HTML element template of a mathematical formula;

the data cleaner is used for exporting the HTML element set into a character string, utilizing the regular expression to arrange text data with format marks, erasing null elements without data and marks irrelevant to the format, and extracting data and format marks of each module and sub-modules thereof in the formula;

the format converter is used for converting the mathematical formula added with the format mark into a text in a MathML format;

the mathematical formula renderer is used for displaying the text in the MathML format in the HTML as a mathematical formula;

and the mathematical formula outputter is used for printing the webpage realizing the mathematical formula and exporting the webpage to a Word document.

2. The system for mathematical formula editing display in HTML and export into Word documents according to claim 1, wherein: the format converter comprises a LaTeX text generation unit and a LaTeX to MathML unit; the LaTeX text generation unit is used for adding format marks to corresponding data of each part in a MathQuill user keyboard input record to obtain a LaTeX text of a mathematical formula; the LaTeX to MathML unit converts a LaTeX text into a text in a MathML format through a LaTeX2MathML format conversion tool.

3. The system for mathematical formula editing display in HTML and export into Word documents according to claim 2, wherein: the math formula renderer renders a math ML formula into a visual math formula of an HTML element or an SVG picture in a browser by utilizing a MathJax visual rendering function.

4. The system for mathematical formula editing display in HTML and export into Word documents according to claim 3, wherein: the mathematical formula output device comprises a webpage printing unit; the webpage printing unit prints the mathematical formula in the form of SVG vector graphics by using a JavaScript engine through MathJax.

5. The system for mathematical formula editing display in HTML and export into Word documents according to claim 3, wherein: the mathematical formula output device comprises a Word derivation unit; the Word export unit comprises a MathML text converter and a Word document generator; the MathML text converter is used for converting the MathML text generated in the format converter into OMML text which can be recognized by Word; the Word document generator is used for inserting the text in the OMML format into a specific position in the Word document, and normal mathematical formulas can be displayed in the Word document.

Technical Field

The invention relates to the technical field of data information processing, in particular to a system for editing, displaying and exporting mathematical formulas to Word documents in HTML (hypertext markup language).

Background

During the office work using a computer, a mathematical formula is often used, and the mathematical formula is found to be displayed in the edition and display of a webpage and a Word document, and has the following problems:

(1) the LaTeX language is convenient and quick to write mathematical formulas, but almost all writing rules and code writing capacity of the TeX language need to be mastered, and the code writing has high difficulty and complexity for non-professionals.

(2) The compatibility of the MathML format is poor, and the formula can only be directly displayed in a FireFox browser.

(3) Currently, Microsoft Office Word only supports the formula in an OMML format and does not support the mathematical formula written by LaTeX language.

(4) In addition, there is a lack of a tool in the market that can edit a display formula from a web page and then export it directly into Word.

Disclosure of Invention

In order to solve the problems in the prior art, the invention provides a system for editing, displaying and exporting mathematical formulas to a Word document in HTML. The system utilizes a LaTeX formula editor, a MathJax webpage formula visualization rendering technology, MathML and Open XML SDK to realize that a mathematical formula is edited, displayed and printed from a webpage and then is exported to a Word document.

The technical means for solving the technical problems of the invention is as follows: a system for editing display and export of mathematical formulas in HTML into a Word document, comprising:

a mathematical formula template generator, which uses a mathematical formula editor MathQuill to generate an HTML element template of a mathematical formula;

the data cleaner is used for exporting the HTML element set into a character string, utilizing the regular expression to arrange the character string into text data with format marks, erasing null elements without data and marks irrelevant to the format, and extracting data and format marks of each module and sub-modules thereof in the formula;

the format converter is used for converting the mathematical formula added with the format mark into a text in a MathML format;

the mathematical formula renderer is used for displaying the text in the MathML format into a mathematical formula in HTML;

and the mathematical formula outputter is used for printing the webpage realizing the mathematical formula and exporting the webpage to a Word document.

As a further improvement of the invention, the format converter comprises a LaTeX text generation unit and a LaTeX to MathML unit; the LaTeX text generation unit is used for adding format marks to corresponding data of each part in a user keyboard input record of MathQuill to obtain a LaTeX text of a mathematical formula; the LaTeX-to-MathML unit converts LaTeX text into text in MathML format through a LaTeX2MathML format conversion tool.

As a further improvement of the invention, the mathematical formula renderer renders the formula of the MathML language into a visual mathematical formula of an HTML element or an SVG picture in the browser by utilizing a MathJax visual rendering function.

As a further improvement of the invention, the mathematical formula output device comprises a webpage printing unit; the webpage printing unit prints the mathematical formula in the form of SVG vector graphics by using a JavaScript engine through MathJax.

As a further improvement of the invention, the mathematical formula output device comprises a Word derivation unit; the Word export unit comprises a MathML text converter and a Word document generator; the MathML text converter is used for converting the MathML text generated in the format converter into OMML text which can be recognized by Word; the Word document generator is used for inserting the text in the OMML format into a specific position in the Word document, and normal mathematical formulas can be displayed in the Word document.

The system for editing, displaying and exporting the mathematical formula to the Word document in the HTML has the following beneficial effects:

(1) a convenient and fast mathematical formula editor is provided for users needing to edit mathematical formulas in a Web system, and the formulas are displayed in a WYSIWYG (what you see is what you get) form in HTML (hypertext markup language).

In terms of mathematical formula output, two ways are provided, one is printing of a web page and one is exporting to a Word document. The mathematical formula can be conveniently and flexibly transplanted, and the formula format is reserved.

Drawings

FIG. 1 is a block diagram of the architecture of the system of the present invention for the editing display of mathematical formulas in HTML and export into a Word document;

FIG. 2 is a flow diagram of the operation of the system of the present invention for the editing display of mathematical formulas in HTML and export into a Word document.

Detailed Description

The system for editing, displaying and exporting mathematical formulas in HTML to a Word document according to the present invention is further described in detail with reference to the drawings and embodiments, so that those skilled in the art can better understand the technical solutions and effects of the present invention.

First, explanation is made on english vocabulary appearing in the present embodiment:

HTML, extensible hypertext markup language;

MathQuill: the JavaScript library realizes the editing of the pure HTML, the CSS and the JS on what you see is what you get mathematical formulas;

mathml: mathematical Markup Language (Mathematical Markup Language);

OMML: is a digital mark language made by Mathml of office;

MathJax: displaying a JavaScript frame of a LaTeX formula on a browser;

LaTeX: a TEX-based typesetting system;

MathJax: is a JavaScript engine used to display mathematical formulas on the network. It can work on all popular browsers;

open XML SDK: is Microsoft provides an interface class library in the operating ooxml format, and is implemented in c #.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:多人协同文档编辑方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!