[go: up one dir, main page]

CN102033858A - Method and system for typesetting and outputting formula - Google Patents

Method and system for typesetting and outputting formula Download PDF

Info

Publication number
CN102033858A
CN102033858A CN2009102356289A CN200910235628A CN102033858A CN 102033858 A CN102033858 A CN 102033858A CN 2009102356289 A CN2009102356289 A CN 2009102356289A CN 200910235628 A CN200910235628 A CN 200910235628A CN 102033858 A CN102033858 A CN 102033858A
Authority
CN
China
Prior art keywords
description data
formula
current application
data
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2009102356289A
Other languages
Chinese (zh)
Inventor
王宝龙
杨雷鸣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Original Assignee
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Peking University Founder Group Co Ltd, Beijing Founder Electronics Co Ltd filed Critical Peking University Founder Group Co Ltd
Priority to CN2009102356289A priority Critical patent/CN102033858A/en
Publication of CN102033858A publication Critical patent/CN102033858A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

本发明公开了一种排版输出公式的方法及系统,用以解决现有技术中排版输出公式的过程比较复杂问题,该方法包括:根据保存的公式编码与公式的第一描述数据的对应关系,确定输入的公式编码对应的第一描述数据,根据当前应用程序的类型,将确定的所述第一描述数据转换为公式的第二描述数据,向所述当前应用程序下发通知,使所述当前应用程序根据所述第二描述数据进行排版输出。

Figure 200910235628

The invention discloses a method and system for typesetting and outputting formulas, which are used to solve the problem that the process of typesetting and outputting formulas is relatively complicated in the prior art. Determine the first description data corresponding to the input formula code, convert the determined first description data into the second description data of the formula according to the type of the current application program, send a notification to the current application program, and make the The current application performs typesetting output according to the second description data.

Figure 200910235628

Description

一种排版输出公式的方法及系统 A method and system for typesetting and outputting formulas

技术领域technical field

本发明涉及印刷排版技术领域,特别涉及一种排版输出公式的方法及系统。The invention relates to the technical field of printing and typesetting, in particular to a method and system for outputting formulas through typesetting.

背景技术Background technique

目前,有一些专业的公式排版软件可以对公式进行排版输出,例如:交互式公式排版软件,该排版软件保存了了一些常用公式的模版,这样,用户可以在模版库中找到想要输入的公式,极大的提高了公式的录入效率。但是,模版库中提供的公式的数量和能力毕竟是有限的,而且,需要用户在模版中选择,影响输入的连贯性。另外,如果模版库保存了太多的自定义的模版,会使用户很不方便查找需输出的公式。At present, there are some professional formula typesetting software that can typeset and output formulas, such as: interactive formula typesetting software, which saves the templates of some commonly used formulas, so that users can find the formulas they want to input in the template library , greatly improving the efficiency of formula entry. However, the number and capabilities of the formulas provided in the template library are limited after all, and users need to select from the templates, which affects the consistency of input. In addition, if too many custom templates are stored in the template library, it will be very inconvenient for the user to find the formula to be output.

现有的一些交互式公式排版软件中还提供了键盘快捷键和快捷输入命令,如word2007中的转义语言命令和域命令,但这些键盘快捷键和快捷输入命令相对比较长,也比较多,因此,很不方便记忆,而且,很容易输错命令而无法正确显示,影响了公式的输入效率。Some existing interactive formula typesetting software also provide keyboard shortcuts and shortcut input commands, such as escape language commands and field commands in word2007, but these keyboard shortcuts and shortcut input commands are relatively long and many, Therefore, it is very inconvenient to memorize, and it is easy to enter wrong commands and cannot be displayed correctly, which affects the efficiency of formula input.

专业的公式排版软件还包括:非交互的基于命令的公式排版软件,该排版软件的命令语言就更复杂了,而且有各种描述规则,一个简单的公式

Figure B2009102356289D0000011
用Latex语言描述为\[\sqrt{b^2-4ac}\]),这就对排版人员的要求就更高了,一个相对简单的公式可能需要输入一长串的命令才能实现。Professional formula typesetting software also includes: non-interactive command-based formula typesetting software. The command language of this typesetting software is more complicated, and there are various description rules. A simple formula
Figure B2009102356289D0000011
It is described as \[\sqrt{b^2-4ac}\]) in Latex language, which has higher requirements for typesetting personnel. A relatively simple formula may need to enter a long list of commands to realize it.

发明内容Contents of the invention

本发明实施例提供一种排版输出公式的方法及系统,用以解决现有技术中排版输出公式的过程比较复杂问题。Embodiments of the present invention provide a method and system for typesetting and outputting formulas, which are used to solve the problem that the process of typesetting and outputting formulas is relatively complicated in the prior art.

本发明实施例提供一种排版输出公式的方法,包括:An embodiment of the present invention provides a method for typesetting and outputting formulas, including:

根据保存的公式编码与公式的第一描述数据的对应关系,确定输入的公式编码对应的第一描述数据;According to the correspondence between the stored formula code and the first description data of the formula, determine the first description data corresponding to the input formula code;

根据当前应用程序的类型,将确定的所述第一描述数据转换为所述当前应用程序支持的第二描述数据;Converting the determined first description data into second description data supported by the current application according to the type of the current application;

向所述当前应用程序下发通知,使所述当前应用程序根据所述第二描述数据进行排版输出。A notification is sent to the current application program, so that the current application program performs typesetting output according to the second description data.

本发明实施例提供一种排版输出公式的系统,包括:An embodiment of the present invention provides a system for typesetting and outputting formulas, including:

确定单元,用于根据保存的公式编码与公式的第一描述数据的对应关系,确定输入的公式编码对应的第一描述数据;A determining unit, configured to determine the first description data corresponding to the input formula code according to the stored correspondence between the formula code and the first description data of the formula;

转换单元,用于根据当前应用程序的类型,将确定的所述第一描述数据转换为所述当前应用程序支持的第二描述数据;a conversion unit, configured to convert the determined first description data into second description data supported by the current application according to the type of the current application;

通知单元,用于向所述当前应用程序下发通知,使所述当前应用程序根据所述第二描述数据进行排版输出。The notification unit is configured to issue a notification to the current application program, so that the current application program performs typesetting and output according to the second description data.

本发明实施例中,首先根据保存的公式编码与公式的第一描述数据的对应关系,确定输入的公式编码对应的第一描述数据,然后根据当前应用程序的类型,将确定的所述第一描述数据转换为公式的第二描述数据,最后向所述当前应用程序下发通知,使所述当前应用程序根据所述第二描述数据进行排版输出。这样,就可以根据输入的公式编码,简单快捷地输出对应的公式,提高了输入效率。In the embodiment of the present invention, firstly, according to the correspondence between the saved formula code and the first description data of the formula, the first description data corresponding to the input formula code is determined, and then according to the type of the current application program, the determined first description data is determined. The description data is converted into the second description data of the formula, and finally a notification is sent to the current application program, so that the current application program performs typesetting and output according to the second description data. In this way, the corresponding formula can be simply and quickly output according to the input formula coding, which improves the input efficiency.

附图说明Description of drawings

图1为本发明实施例中排版输出公式的流程图;Fig. 1 is the flowchart of typesetting output formula in the embodiment of the present invention;

图2为本发明实施例一中排版输出公式的流程图;Fig. 2 is a flow chart of the typesetting output formula in Embodiment 1 of the present invention;

图3为本发明实施例中排版输出公式的装置图。Fig. 3 is a device diagram for typesetting and outputting formulas in an embodiment of the present invention.

具体实施方式Detailed ways

本发明实施例中,首先建立公式编码与公式名称的映射关系,然后建立公式名称的第一描述数据,这样,系统就保存了公式编码与公式名称的映射关系,以及公式名称的第一描述数据。In the embodiment of the present invention, the mapping relationship between the formula code and the formula name is first established, and then the first description data of the formula name is established. In this way, the system saves the mapping relationship between the formula code and the formula name, as well as the first description data of the formula name .

本发明实施例中,公式包括:常用的数学公式、方程、以及定理,例如:求根公式、勾股定理、正弦定理等。当然,公式还包括:化学式、以及化学反应方程式,例如:高锰酸钾加热分解方程等等。这样,可以按照公式的类型进行了详细分类并进行编码,建立字符串编码与这些公式名称之间的映射关系,例如:求根公式的编码为qiugengongshi,勾股定理编码为gougudingli等等。In the embodiment of the present invention, the formulas include: commonly used mathematical formulas, equations, and theorems, such as root-finding formulas, Pythagorean theorem, sine theorem, and the like. Of course, the formula also includes: chemical formula, and chemical reaction equation, for example: potassium permanganate heating decomposition equation and so on. In this way, formulas can be classified and coded in detail according to the types of formulas, and the mapping relationship between character string codes and the names of these formulas can be established. For example, the code for finding the root is qiugengongshi, and the code for the Pythagorean theorem is gougudingli.

保存的常用公式名称的第一描述数据,一般仅仅是对公式数据基本信息的转义描述,例如:求根公式

Figure B2009102356289D0000031
其保存的第一描述数据可以表示为(-b±√(b^2-4ac))/2a,第一描述数据是系统内部保存的数据,属于基础描述数据,不能为任何排版软件所识别,只是一种简易的语意描述。The first description data of the saved common formula name is generally only an escape description of the basic information of the formula data, for example: root finding formula
Figure B2009102356289D0000031
The first description data stored in it can be expressed as (-b±√(b^2-4ac))/2a. The first description data is the data stored inside the system, which belongs to the basic description data and cannot be recognized by any typesetting software. It's just a simple semantic description.

参见图1,保存了公式编码与公式名称的映射关系,以及公式名称的第一描述数据后,排版输出公式的过程如下,包括:Referring to Figure 1, after saving the mapping relationship between the formula code and the formula name, and the first description data of the formula name, the process of typesetting and outputting the formula is as follows, including:

步骤101:接收输入的公式编码。Step 101: Receive an input formula code.

用户可以通过键盘输入公式编码,例如:qiugengongshi。这样,系统接收到输入的公式编码。The user can input the formula code through the keyboard, for example: qiugengongshi. In this way, the system receives the entered formula code.

步骤102:确定输入的公式编码对应的第一描述数据。Step 102: Determine the first description data corresponding to the input formula code.

系统保存了公式编码与公式名称的第一描述数据的对应关系,因此,可以根据保存的公式编码与公式名称的第一描述数据的对应关系,确定输入的公式编码对应的第一描述数据。The system stores the correspondence between the formula code and the first description data of the formula name. Therefore, the first description data corresponding to the input formula code can be determined according to the stored correspondence between the formula code and the first description data of the formula name.

这里,可以首先根据保存的公式编码与公式名称的映射关系,确定输入的公式编码对应的当前公式名称,然后根据根据保存的公式名称的第一描述数据,确定当前公式名称的第一描述数据。Here, the current formula name corresponding to the input formula code can be determined first according to the saved mapping relationship between the formula code and the formula name, and then the first description data of the current formula name can be determined according to the first description data according to the saved formula name.

步骤103:确定当前应用程序的类型。Step 103: Determine the type of the current application.

当前应用程序按类型划分为:公式排版软件和非公式排版软件,其中,公式排版软件又分为交互式排版软件和基于命令的非交互式排版软件,非公式排版软件中又包括:支持图片格式输出的软件、以及web编辑器。The current application programs are divided into: formula typesetting software and non-formula typesetting software according to type, among which, formula typesetting software is divided into interactive typesetting software and command-based non-interactive typesetting software, and non-formula typesetting software includes: supporting image format Output software, and web editors.

可以通过当前应用程序的名称来区分,如mathtype.exe,WINWORD.exe等等,即根据当前应用程序的名称,确定当前用程序的类型It can be distinguished by the name of the current application, such as mathtype.exe, WINWORD.exe, etc., that is, according to the name of the current application, determine the type of the current application

步骤104:根据确定的当前应用程序的类型,将确定的第一描述数据转换为当前应用程序支持的第二描述数据。Step 104: Convert the determined first description data into second description data supported by the current application program according to the determined type of the current application program.

这里,当步骤103中,确定当前应用程序为公式排版软件,则将第一描述数据转换为公式排版软件支持的第二描述数据,当步骤103中,确定当前应用程序为非公式排版软件,则将第一描述数据转换为非公式排版软件支持的第二描述数据。Here, when in step 103, it is determined that the current application program is formula typesetting software, then the first description data is converted into the second description data supported by formula typesetting software; when in step 103, it is determined that the current application program is non-formula typesetting software, then The first description data is converted into the second description data supported by non-formula typesetting software.

其中,将第一描述数据转换为公式排版软件所支持的第二描述数据包括:Wherein, converting the first description data into the second description data supported by formula typesetting software includes:

若当前应用程序为交互式排版软件,则将第一描述数据转换为该当前应用程序能支持或识别的第二描述数据,一般可以将第一描述数据转换为MathML格式的数据、或,LaTex\Tex格式的数据,当然还需添加当前应用程序对公式的附加描述信息。本发明实施例中,还可以直接将第一描述数据转换为当前应用程序自身提供的线性格式的数据,例如:WORD2007提供的线性格式的数据。If the current application program is interactive typesetting software, convert the first description data into the second description data that the current application program can support or recognize. Generally, the first description data can be converted into data in MathML format, or LaTex\ For the data in Tex format, of course, additional description information about the formulas of the current application needs to be added. In the embodiment of the present invention, the first description data may also be directly converted into data in a linear format provided by the current application itself, for example, data in a linear format provided by WORD2007.

若当前应用程序为非交互式排版软件,则将第一描述数据转换为命令语言格式的数据。例如:当前应用程序为LaTex,则将第一描述数据转换为LaTex格式的数据;当前应用程序为方正书板,则将第一描述数据转换为该公式的BD小样。If the current application program is non-interactive typesetting software, the first description data is converted into data in command language format. For example: if the current application program is LaTex, convert the first description data into data in LaTex format; if the current application program is Founder Bookboard, then convert the first description data into the BD sample of the formula.

另外,将第一描述数据转换为非公式排版软件支持的第二描述数据包括:In addition, converting the first description data into the second description data supported by non-formula typesetting software includes:

若当前应用程序为支持图片格式输出的软件,则将第一描述数据转换为图片格式的数据。If the current application program is software that supports image format output, the first description data is converted into data in image format.

若当前应用程序为Web编辑器,且Web编辑器支持MathML格式的输出,则可以将第一描述数据转换为MathML格式的数据。If the current application program is a web editor, and the web editor supports output in MathML format, the first description data may be converted into data in MathML format.

步骤105:通知当前应用程序,使当前应用程序根据第二描述数据进行排版输出。Step 105: notify the current application program, so that the current application program performs typesetting output according to the second description data.

将第一描述数据转换为第二描述数据之后,系统会通知当前应用程序,使当前应用应用程序根据第二描述数据进行排版输出。即系统会触发当前应用程序,从而当前应用程序根据第二描述数据,进行排版输出了。After converting the first description data into the second description data, the system will notify the current application program so that the current application program performs typesetting and output according to the second description data. That is, the system will trigger the current application program, so that the current application program performs typesetting output according to the second description data.

下面结合说明书附图对本发明实施例作进一步详细描述。The embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings.

实施例1,本发明实施例中,系统包括一个UI显示窗口及组件,用于显示输入的公式编码。并且,该系统保存了公式编码与公式名称的映射关系,以及公式名称的第一描述数据。参见图2,该系统排版输出公式的过程如下,包括:Embodiment 1. In the embodiment of the present invention, the system includes a UI display window and components for displaying input formula codes. Moreover, the system stores the mapping relationship between formula codes and formula names, as well as the first description data of formula names. Referring to Fig. 2, the process of the system typesetting output formula is as follows, including:

步骤201:接收输入的公式编码。Step 201: Receive an input formula code.

这里,接收通过输入装置输入的公式编码,例如接收通过键盘输入的公式编码。Here, the formula code input through the input device is received, for example, the formula code input through the keyboard is received.

步骤202:在UI显示窗口中显示输入的公式编码以及对应的公式名称。Step 202: Display the input formula code and the corresponding formula name in the UI display window.

根据保存的公式编码与公式名称的映射关系,确定输入的公式编码对应的公式名称,并将输入的公式编码以及对应的公式名称在UI显示窗口中显示。According to the saved mapping relationship between the formula code and the formula name, the formula name corresponding to the input formula code is determined, and the input formula code and the corresponding formula name are displayed in the UI display window.

步骤203:确定输入的公式编码对应的第一描述数据。Step 203: Determine the first description data corresponding to the input formula code.

在上一步骤中,已经确定了输入的公式编码对应的公式名称,这里,只需确定该公式名称的第一描述数据。In the previous step, the formula name corresponding to the input formula code has been determined, and here, only the first description data of the formula name needs to be determined.

步骤204:判断当前应用程序是否为公式排版软件,如果是,执行步骤205,否则,执行步骤210。Step 204: Determine whether the current application program is formula typesetting software, if yes, execute step 205, otherwise, execute step 210.

这里,可以根据应用程序名称来判断,如目前比较普遍的mathtype,word2007等。Here, it can be judged according to the name of the application program, such as mathtype, word2007, etc., which are relatively common at present.

步骤205:判断当前应用程序是否为交互式排版软件,若是,执行步骤206,否则,执行步骤208。Step 205: Determine whether the current application program is interactive typesetting software, if so, perform step 206, otherwise, perform step 208.

同样根据应用程序名称来判断,如Latex,方正书版。Also judge based on the name of the application, such as Latex, Founder Book Edition.

步骤206:将输入的公式编码对应的第一描述数据,转换为MathML格式、LaTex\Tex格式或线性格式的数据。Step 206: Convert the first description data corresponding to the input formula code into data in MathML format, LaTex\Tex format or linear format.

提取输入的公式编码对应的第一描述数据,将其转换为当前应用程序可以识别或者可以转换解析的第二描述数据,一般为MathML格式的数据、LaTex\Tex格式的数据或线性格式的数据。Extract the first description data corresponding to the input formula code, and convert it into the second description data that can be recognized or converted and analyzed by the current application program, generally data in MathML format, data in LaTex\Tex format or data in linear format.

步骤207:通知当前应用程序,使当前应用程序根据转换后的数据,进行排版输出。本次排版输出公式的流程结束。Step 207: notify the current application program, so that the current application program performs typesetting and output according to the converted data. The process of typesetting and outputting the formula is over.

上述步骤中转换完后,通知当前应用程序,即触发当前应用程序,从而,当前应用程序对MathML格式、LaTex\Tex格式或线性格式的数据进行解析,转换为内部格式数据,然后排版输出。After the conversion in the above steps, the current application is notified, that is, the current application is triggered, so that the current application parses the data in MathML format, LaTex\Tex format or linear format, converts it into internal format data, and then typesets the output.

步骤208:将输入的公式编码对应的第一描述数据,转换为命令语言格式的数据。Step 208: Convert the first description data corresponding to the input formula code into command language format data.

提取输入的公式编码对应的第一描述数据,将其转换为当前应用程序可以识别或者可以转换解析的第二描述数据,这里,第二描述数据为命令语言格式的数据。The first description data corresponding to the input formula code is extracted, and converted into second description data that can be recognized or converted and parsed by the current application program. Here, the second description data is data in a command language format.

步骤209:通知当前应用程序,使当前应用程序排版以命令行格式输出转换后的命令语言格式的数据。本次排版输出公式的流程结束。Step 209: notify the current application program, so that the current application program typeset and output the converted data in the command language format in the command line format. The process of typesetting and outputting the formula is over.

步骤210:判断当前程序是否为支持MathML格式输出的Web编辑器?如果当前程序是支持MathML格式输出的Web编辑器,则执行步骤211。否则,执行步骤213。Step 210: Determine whether the current program is a web editor supporting output in MathML format? If the current program is a web editor supporting output in MathML format, step 211 is executed. Otherwise, go to step 213.

目前,一些Web编辑器可以支持MathML格式,有些则不能,因此,需要判断当前程序是否为支持MathML格式输出的Web编辑器。Currently, some web editors can support MathML format, while others cannot. Therefore, it is necessary to determine whether the current program is a web editor that supports MathML format output.

步骤211:将输入的公式编码对应的第一描述数据,转换为MathML格式的数据。Step 211: Convert the first description data corresponding to the input formula code into data in MathML format.

步骤212:通知当前应用程序,利用MathML格式语言对转换后的数据进行转换排版。本次排版输出公式的流程结束。Step 212: notify the current application program, and use the MathML format language to convert and format the converted data. The process of typesetting and outputting the formula is over.

支持MathML格式输出的Web编辑器可以将转换后的MathML格式的数据以MathML格式输出,还可以安装类似mathplayer的插件进行输出显示,达到更好的显示效果。Web editors that support MathML format output can output converted MathML format data in MathML format, and can also install plug-ins similar to mathplayer for output display to achieve better display effects.

步骤213:判断当前应用程序是否支持图片格式输出,如果支持,执行步骤214,否则,不做处理,本次排版输出公式的流程结束。Step 213: Determine whether the current application program supports image format output, if yes, execute step 214, otherwise, do not process, and the process of typesetting and outputting the formula ends.

步骤211:根据输入的公式编码对应的第一描述数据,生成图片格式的数据。Step 211: Encode the corresponding first description data according to the input formula to generate data in picture format.

当前应用程序支持图片格式输出,因此,可以利用内置的公式编辑器对第一描述数据进行解析,生成图片格式的数据。The current application program supports image format output, therefore, the built-in formula editor can be used to analyze the first description data to generate data in image format.

步骤212:通知当前应用程序,根据图片格式的数据,生成一张对应的图片后输出。本次排版输出公式的流程结束。Step 212: Notify the current application program to generate a corresponding picture according to the data in the picture format and then output it. The process of typesetting and outputting the formula is over.

支持图片格式输出的当前应用程序,根据图片格式的数据,生成一张与公式区域大小一样的图片,并进行输出。The current application that supports image format output generates a picture with the same size as the formula area according to the data in the image format, and outputs it.

例如:当前应用程序为交互式排版公式,输入的公式编码是qiugengongshi,则,首先系统获得qiugengongshi对应的第一描述数据(-b±√(b^2-4ac))/2a,然后系统确定当前应用程序为交互式排版软件,则可将第一描述数据(-b±√(b^2-4ac))/2a转换为第二描述数据,这里可以MathML2.0格式的数据,其具体如下:For example: the current application program is an interactive typesetting formula, and the entered formula code is qiugengongshi, then first, the system obtains the first description data corresponding to qiugengongshi (-b±√(b^2-4ac))/2a, and then the system determines the current If the application program is interactive typesetting software, the first description data (-b±√(b^2-4ac))/2a can be converted into the second description data. Here, the data in MathML2.0 format can be used. The details are as follows:

Figure B2009102356289D0000071
Figure B2009102356289D0000071

Figure B2009102356289D0000081
Figure B2009102356289D0000081

最后,系统将上述的MathML2.0格式的数据发送给交互式排版软件,这样,交互式排版软件根据上述的MathML2.0格式的数据,进行解析排版,从而,输出求根公式

Figure B2009102356289D0000082
Finally, the system sends the above-mentioned data in the MathML2.0 format to the interactive typesetting software, so that the interactive typesetting software performs analysis and typesetting according to the above-mentioned data in the MathML2.0 format, thereby outputting the root-finding formula
Figure B2009102356289D0000082

根据上述排版输出公式的方法,可以构造一种排版输出公式的系统,参见图3,该系统包括:确定单元100、转换单元200和通知单元300。According to the above method for typesetting and outputting formulas, a system for typesetting and outputting formulas can be constructed. Referring to FIG. 3 , the system includes: a determination unit 100 , a conversion unit 200 and a notification unit 300 .

确定单元100,用于根据保存的公式编码与公式的第一描述数据的对应关系,确定输入的公式编码对应的第一描述数据。The determining unit 100 is configured to determine the first description data corresponding to the input formula code according to the stored correspondence between the formula code and the first description data of the formula.

转换单元200,用于根据当前应用程序的类型,将确定的所述第一描述数据转换为所述当前应用程序支持的第二描述数据。The converting unit 200 is configured to convert the determined first description data into second description data supported by the current application according to the type of the current application.

通知单元300,用于向所述当前应用程序下发通知,使所述当前应用程序根据所述第二描述数据进行排版输出。The notification unit 300 is configured to send a notification to the current application program, so that the current application program performs typesetting and output according to the second description data.

其中,确定单元100包括:第一确定子单元110和第二确定子单元120。Wherein, the determining unit 100 includes: a first determining subunit 110 and a second determining subunit 120 .

第一确定子单元110,用于根据保存的公式编码与公式名称的映射关系,确定输入的公式编码对应的当前公式名称。The first determination subunit 110 is configured to determine the current formula name corresponding to the input formula code according to the saved mapping relationship between the formula code and the formula name.

第二确定子单元120,用于根据保存的公式名称的第一描述数据,确定所述当前公式名称的第一描述数据。The second determining subunit 120 is configured to determine the first description data of the current formula name according to the saved first description data of the formula name.

而转换单元200包括:类型子单元210、第一转换子单元220和第二转换子单元230。The conversion unit 200 includes: a type subunit 210 , a first conversion subunit 220 and a second conversion subunit 230 .

类型子单元210,用于根据当前应用程序的名称,确定当前用程序的类型。The type subunit 210 is configured to determine the type of the currently used program according to the name of the current application program.

第一转换子单元220,用于当确定所述当前应用程序为公式排版软件,将所述第一描述数据转换为公式排版软件支持的第二描述数据。The first conversion subunit 220 is configured to convert the first description data into second description data supported by the formula typesetting software when it is determined that the current application program is formula typesetting software.

第二转换子单元230,用于当确定所述当前应用程序为非公式排版软件,将所述第一描述数据转换为非公式排版软件支持的第二描述数据。The second conversion subunit 230 is configured to convert the first description data into second description data supported by the non-formula typesetting software when it is determined that the current application program is non-formula typesetting software.

第一转换子单元220又包括:交互转换模块和非交互转换模块。其中,The first conversion subunit 220 further includes: an interactive conversion module and a non-interactive conversion module. in,

交互转换模块,用于若当前应用程序为交互式排版软件,将所述第一描述数据转换为MathML格式的数据、LaTex\Tex格式的数据或线性格式的数据。The interactive conversion module is used to convert the first description data into data in MathML format, data in LaTex\Tex format or data in linear format if the current application program is interactive typesetting software.

非交互转换模块,用于若当前应用程序为非交互式排版软件,将所述第一描述数据转换为命令语言格式的数据。The non-interactive conversion module is configured to convert the first description data into data in command language format if the current application program is non-interactive typesetting software.

第二转换子单元240又包括:The second conversion subunit 240 also includes:

图片转换模块,用于若当前应用程序为支持图片格式输出的软件,将所述第一描述数据转换为图片格式的数据。The image conversion module is configured to convert the first description data into data in an image format if the current application program is software that supports output in an image format.

编辑器转换模块,用于若当前应用程序为Web编辑器,将所述第一描述数据转换为MathML格式的数据。The editor conversion module is configured to convert the first description data into MathML format data if the current application program is a Web editor.

本发明实施例中,排版输出公式的系统可以为输入法系统,可在常用的输入法系统中加入上述的功能模块,这样就可以实现准确,快速地排版输出公式。In the embodiment of the present invention, the system for typesetting and outputting formulas can be an input method system, and the above-mentioned functional modules can be added to commonly used input method systems, so that accurate and fast typesetting and outputting formulas can be realized.

综上所述,本发明实施例中,系统首先根据保存的公式编码与公式的第一描述数据的对应关系,确定输入的公式编码对应的第一描述数据,然后根据当前应用程序的类型,将确定的所述第一描述数据转换为公式的第二描述数据,最后向所述当前应用程序下发通知,使所述当前应用程序根据所述第二描述数据进行排版输出。这样,就只需输入简单的公式编码,就可以简单快捷地输出对应的公式,提高了输入效率。To sum up, in the embodiment of the present invention, the system first determines the first description data corresponding to the input formula code according to the correspondence between the stored formula code and the first description data of the formula, and then according to the type of the current application program, The determined first description data is converted into the second description data of the formula, and finally a notification is sent to the current application program, so that the current application program performs typesetting and output according to the second description data. In this way, you only need to input a simple formula code, and you can simply and quickly output the corresponding formula, which improves the input efficiency.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若对本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and equivalent technologies, the present invention also intends to include these modifications and variations.

Claims (10)

1.一种排版输出公式的方法,其特征在于,包括:1. A method for typesetting output formulas, characterized in that, comprising: 根据保存的公式编码与公式的第一描述数据的对应关系,确定输入的公式编码对应的第一描述数据;According to the correspondence between the stored formula code and the first description data of the formula, determine the first description data corresponding to the input formula code; 根据当前应用程序的类型,将确定的所述第一描述数据转换为所述当前应用程序支持的第二描述数据;Converting the determined first description data into second description data supported by the current application according to the type of the current application; 向所述当前应用程序下发通知,使所述当前应用程序根据所述第二描述数据进行排版输出。A notification is sent to the current application program, so that the current application program performs typesetting output according to the second description data. 2.如权利要求1所述的方法,其特征在于,所述确定输入的公式编码对应的第一描述数据包括:2. The method according to claim 1, wherein the first description data corresponding to the determined input formula code comprises: 根据保存的公式编码与公式名称的映射关系,确定输入的公式编码对应的当前公式名称;Determine the current formula name corresponding to the entered formula code according to the saved mapping relationship between the formula code and the formula name; 根据保存的公式名称的第一描述数据,确定所述当前公式名称的第一描述数据。The first description data of the current formula name is determined according to the saved first description data of the formula name. 3.如权利要求1所述的方法,其特征在于,所述根据当前应用程序的类型,将确定的所述第一描述数据转换为所述当前应用程序支持的第二描述数据包括:3. The method according to claim 1, wherein, according to the type of the current application, converting the determined first description data into the second description data supported by the current application comprises: 根据当前应用程序的名称,确定当前用程序的类型;Determine the type of the current application according to the name of the current application; 当确定所述当前应用程序为公式排版软件,将所述第一描述数据转换为公式排版软件支持的第二描述数据;When it is determined that the current application program is formula typesetting software, converting the first description data into second description data supported by formula typesetting software; 当确定所述当前应用程序为非公式排版软件,将所述第一描述数据转换为非公式排版软件支持的第二描述数据。When it is determined that the current application program is non-formula typesetting software, converting the first description data into second description data supported by non-formula typesetting software. 4.如权利要求3所述的方法,其特征在于,将所述第一描述数据转换为公式排版软件支持的第二描述数据包括:4. The method according to claim 3, wherein converting the first description data into the second description data supported by formula typesetting software comprises: 若当前应用程序为交互式排版软件,将所述第一描述数据转换为MathML格式的数据、LaTex\Tex格式的数据或线性格式的数据;If the current application program is an interactive typesetting software, the first description data is converted into data in MathML format, data in LaTex\Tex format or data in linear format; 若当前应用程序为非交互式排版软件,将所述第一描述数据转换为命令语言格式的数据。If the current application program is non-interactive typesetting software, converting the first description data into data in command language format. 5.如权利要求3所述的方法,其特征在于,将所述第一描述数据转换为非公式排版软件支持的第二描述数据包括:5. The method according to claim 3, wherein converting the first description data into the second description data supported by non-formula typesetting software comprises: 若当前应用程序为支持图片格式输出的软件,将所述第一描述数据转换为图片格式的数据;If the current application program is software that supports image format output, converting the first description data into data in image format; 若当前应用程序为Web编辑器,将所述第一描述数据转换为MathML格式的数据。If the current application program is a web editor, converting the first description data into data in MathML format. 6.一种排版输出公式的系统,其特征在于,包括:6. A system for typesetting and outputting formulas, comprising: 确定单元,用于根据保存的公式编码与公式的第一描述数据的对应关系,确定输入的公式编码对应的第一描述数据;A determining unit, configured to determine the first description data corresponding to the input formula code according to the stored correspondence between the formula code and the first description data of the formula; 转换单元,用于根据当前应用程序的类型,将确定的所述第一描述数据转换为所述当前应用程序支持的第二描述数据;a conversion unit, configured to convert the determined first description data into second description data supported by the current application according to the type of the current application; 通知单元,用于向所述当前应用程序下发通知,使所述当前应用程序根据所述第二描述数据进行排版输出。The notification unit is configured to issue a notification to the current application program, so that the current application program performs typesetting and output according to the second description data. 7.如权利要求6所述的系统,其特征在于,所述确定单元包括:7. The system according to claim 6, wherein the determining unit comprises: 第一确定子单元,用于根据保存的公式编码与公式名称的映射关系,确定输入的公式编码对应的当前公式名称;The first determination subunit is used to determine the current formula name corresponding to the input formula code according to the saved mapping relationship between the formula code and the formula name; 第二确定子单元,用于根据保存的公式名称的第一描述数据,确定所述当前公式名称的第一描述数据。The second determining subunit is configured to determine the first description data of the current formula name according to the saved first description data of the formula name. 8.如权利要求6所述的系统,其特征在于,所述转换单元包括:8. The system according to claim 6, wherein the converting unit comprises: 类型子单元,用于根据当前应用程序的名称,确定当前用程序的类型;The type subunit is used to determine the type of the current application program according to the name of the current application program; 第一转换子单元,用于当确定所述当前应用程序为公式排版软件,将所述第一描述数据转换为公式排版软件支持的第二描述数据;The first conversion subunit is configured to convert the first description data into second description data supported by the formula typesetting software when it is determined that the current application program is formula typesetting software; 第二转换子单元,用于当确定所述当前应用程序为非公式排版软件,将所述第一描述数据转换为非公式排版软件支持的第二描述数据。The second conversion subunit is configured to convert the first description data into second description data supported by the non-formula typesetting software when it is determined that the current application program is non-formula typesetting software. 9.如权利要求8所述的系统,其特征在于,所述第一转换子单元包括:9. The system according to claim 8, wherein the first converting subunit comprises: 交互转换模块,用于若当前应用程序为交互式排版软件,将所述第一描述数据转换为MathML格式的数据、LaTex\Tex格式的数据或线性格式的数据;An interactive conversion module, used to convert the first description data into data in MathML format, data in LaTex\Tex format or data in linear format if the current application program is an interactive typesetting software; 非交互转换模块,用于若当前应用程序为非交互式排版软件,将所述第一描述数据转换为命令语言格式的数据。The non-interactive conversion module is configured to convert the first description data into data in command language format if the current application program is non-interactive typesetting software. 10.如权利要求8所述的系统,其特征在于,所述第二转换子单元包括:10. The system according to claim 8, wherein the second converting subunit comprises: 图片转换模块,用于若当前应用程序为支持图片格式输出的软件,将所述第一描述数据转换为图片格式的数据;A picture conversion module, used to convert the first description data into data in a picture format if the current application program is software that supports picture format output; 编辑器转换模块,用于若当前应用程序为Web编辑器,将所述第一描述数据转换为MathML格式的数据。The editor conversion module is configured to convert the first description data into MathML format data if the current application program is a Web editor.
CN2009102356289A 2009-09-30 2009-09-30 Method and system for typesetting and outputting formula Pending CN102033858A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009102356289A CN102033858A (en) 2009-09-30 2009-09-30 Method and system for typesetting and outputting formula

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009102356289A CN102033858A (en) 2009-09-30 2009-09-30 Method and system for typesetting and outputting formula

Publications (1)

Publication Number Publication Date
CN102033858A true CN102033858A (en) 2011-04-27

Family

ID=43886773

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009102356289A Pending CN102033858A (en) 2009-09-30 2009-09-30 Method and system for typesetting and outputting formula

Country Status (1)

Country Link
CN (1) CN102033858A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021196A (en) * 2016-05-05 2016-10-12 广东小天才科技有限公司 Formula conversion method and system
CN106294480A (en) * 2015-06-04 2017-01-04 北京新唐思创教育科技有限公司 A file format conversion method, device and test question importing system
CN108280053A (en) * 2018-01-30 2018-07-13 北京仁和汇智信息技术有限公司 A kind of method and device of the formula typesetting based on Mathtype
CN108319724A (en) * 2018-02-28 2018-07-24 北京仁和汇智信息技术有限公司 A kind of Homepage Publishing method and device with formula file
CN109992121A (en) * 2017-12-29 2019-07-09 北京搜狗科技发展有限公司 A kind of input method, device and the device for input
CN109271569B (en) * 2018-09-30 2021-10-22 联想(北京)有限公司 Output method, apparatus, system and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6934910B2 (en) * 1999-12-14 2005-08-23 Sun Microsystems, Inc. Method and system for inserting a data object into a computer-generated document using a text instruction
JP2008129687A (en) * 2006-11-17 2008-06-05 Nec Saitama Ltd Special character input support device and electronic equipment with the same
CN101286118A (en) * 2007-04-10 2008-10-15 北京搜狗科技发展有限公司 Method for quick calling program instruction, system and an input method system
CN101436308A (en) * 2008-12-15 2009-05-20 北大方正集团有限公司 Formula input method and system for interactive formula typesetting software

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6934910B2 (en) * 1999-12-14 2005-08-23 Sun Microsystems, Inc. Method and system for inserting a data object into a computer-generated document using a text instruction
JP2008129687A (en) * 2006-11-17 2008-06-05 Nec Saitama Ltd Special character input support device and electronic equipment with the same
CN101286118A (en) * 2007-04-10 2008-10-15 北京搜狗科技发展有限公司 Method for quick calling program instruction, system and an input method system
CN101436308A (en) * 2008-12-15 2009-05-20 北大方正集团有限公司 Formula input method and system for interactive formula typesetting software

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294480A (en) * 2015-06-04 2017-01-04 北京新唐思创教育科技有限公司 A file format conversion method, device and test question importing system
CN106021196A (en) * 2016-05-05 2016-10-12 广东小天才科技有限公司 Formula conversion method and system
CN106021196B (en) * 2016-05-05 2019-09-17 广东小天才科技有限公司 A formula conversion method and system
CN109992121A (en) * 2017-12-29 2019-07-09 北京搜狗科技发展有限公司 A kind of input method, device and the device for input
CN108280053A (en) * 2018-01-30 2018-07-13 北京仁和汇智信息技术有限公司 A kind of method and device of the formula typesetting based on Mathtype
CN108319724A (en) * 2018-02-28 2018-07-24 北京仁和汇智信息技术有限公司 A kind of Homepage Publishing method and device with formula file
CN108319724B (en) * 2018-02-28 2019-04-09 北京仁和汇智信息技术有限公司 A kind of Homepage Publishing method and device with formula file
CN109271569B (en) * 2018-09-30 2021-10-22 联想(北京)有限公司 Output method, apparatus, system and medium

Similar Documents

Publication Publication Date Title
RU2683174C2 (en) Ink to text representation conversion
US20110264705A1 (en) Method and system for interactive generation of presentations
CN102033858A (en) Method and system for typesetting and outputting formula
JP2010092501A (en) Error notification method and error notification device
CN110472251A (en) Method, the method for statement translation, equipment and the storage medium of translation model training
WO2016023424A1 (en) Character editing method and device for screen display device
US10699712B2 (en) Processing method and electronic device for determining logic boundaries between speech information using information input in a different collection manner
KR20150035798A (en) Generating localized user interfaces
CN104462030B (en) Character conversion equipment, character conversion method
CN105095160A (en) Document conversion reading method and system
CN102541948A (en) Method and device for extracting document structure
CN102566769B (en) Chinese character input method and system
CN110688315A (en) Interface code detection report generation method, electronic device, and storage medium
TW201339861A (en) Method, computer system and program product for performing a code conversion in a smaller target encoding space
CN104345897B (en) Deformed characters input method and system
KR20170029866A (en) Server, user terminal and a method for controlling thereof
CN112487138A (en) Information extraction method and device for formatted text
US12169680B2 (en) Converting a portable document format to a latex format
CN104216868A (en) Adaptation method and device for document display format
JP2015036886A (en) Information processing device, storage medium, and method
CN106547891A (en) For the quick visualization method of the pictured text message of palm display device
US9537928B2 (en) Remote computing device use of unsupported local computing device components
CN102053955A (en) Method and system for inputting symbols
KR101358005B1 (en) Method of inserting additional information in electronic documents in smart terminals by touch operations, and computer-readable recording medium for the same
CN102591851A (en) Method and device for editing target texts based on keyboard keys

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20110427