A method, device, electronic device and storage medium for typesetting handouts

The standard content model is used to standardize the handout files and generate target typesetting system files, which solves the differences and compatibility problems of online handouts and Word files, and achieves high-accurate handout typesetting, reducing typesetting errors and losses.

CN113221506BActive Publication Date: 2025-01-10BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110527443.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-14
Publication Date
2025-01-10
Estimated Expiration
2041-05-14

AI Technical Summary

Technical Problem

The format difference between online handouts and Word files leads to a erroneous format after export, and the Word files are incompatible with the layout software, resulting in more losses and errors in the content and style of the final courseware.

Method used

The standard content model is used to standardize the lecture notes, generate standard files, and generate target layout system files based on the target layout system configuration information to ensure compatibility, reduce the probability of loss and error of layout content, and improve the layout accuracy.

Benefits of technology

Through standardized processing and the generation of target typesetting system files, the high-accuracy typesetting of handout files is achieved, format errors and compatibility issues are reduced, and the layout efficiency and effect are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113221506B_ABST
    Figure CN113221506B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, electronic device and storage medium for typesetting a lecture note, wherein the method comprises: obtaining a lecture note file in a first document format to be typeset; based on a standard content model, standardizing the lecture note file to obtain a standard file; the standard content model is used to uniformly describe the content and style of rich text documents in different document formats; based on the standard file and target typesetting system configuration information, obtaining a target typesetting system file; typeset the target typesetting system file to generate a lecture note file in a second document format after typeset. The standard file generated based on the standard content model in the present disclosure can well take into account the lecture note file and the typesetting system file, ensuring the compatibility between the target typesetting system file generated by subsequently configuring the standard file based on the target typesetting system configuration information and the typesetting system, thereby reducing the probability of loss and error of typesetting content, and making the typesetting accuracy higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for typesetting handouts. Background Art

[0002] With the expansion and penetration of Internet technology into the field of education, online education platforms have emerged one after another. In the online education scenario, teachers use online handouts to compile learning courseware. The typesetting and printing process of online handouts can be to export the handouts as Word files, and then import the Word files into offline typesetting software for secondary editing, and then obtain the edited learning courseware.

[0003] However, due to the format differences between online handouts and Word files, formatting errors are inevitable when exporting handouts as Word files. In addition, due to the incompatibility issues between Word files and typesetting software, the final edited courseware has many losses and errors in content and style. Summary of the invention

[0004] The embodiments of the present disclosure at least provide a method, device, electronic device and storage medium for typesetting handouts.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for typesetting a lecture note, the method comprising:

[0006] Obtaining a handout file in a first document format to be typeset;

[0007] Based on a standard content model, the lecture file is standardized to obtain a standard file; the standard content model is used to uniformly describe the content and style of rich text documents in different document formats;

[0008] Based on the standard file and the target typesetting system configuration information, a target typesetting system file is obtained;

[0009] The target typesetting system file is typeset to generate a lecture file in a typeset second document format.

[0010] By adopting the above-mentioned lecture notes typesetting method, the lecture notes files to be typeset can first be standardized based on the standard content model to obtain standard files. Since the standard content model here is used to uniformly describe the content and style of rich text documents under different document formats, the standard files generated based on the above-mentioned standard content model can well take into account the lecture notes files and the typesetting system files, ensuring the compatibility between the target typesetting system files generated by the subsequent configuration of the standard files based on the target typesetting system configuration information and the typesetting system, thereby reducing the probability of loss and errors in the typesetting content and making the typesetting accuracy higher.

[0011] In a possible implementation, the standardization process of the lecture file based on the standard content model to obtain a standard file includes:

[0012] Parsing the lecture file based on a predefined file parsing model to parse out first file data information matching the file parsing model;

[0013] Determine a parsed file according to the parsed first file data information and the file parsing model;

[0014] Converting the parsed file based on a predefined standard content model to obtain second file data information matching the standard content model;

[0015] The standard file is obtained based on the obtained second file data information and the standard content model.

[0016] Here, considering the problem of poor readability of the data structure of the lecture file, we can first parse it based on the file parsing model, and then convert the parsed file based on the standard content model, so as to obtain the second file data information matching the standard content model, and then obtain the standard file, realizing the conversion from lecture file to standard file, which is more practical.

[0017] In a possible implementation, the target typesetting system file includes a LaTeX file, and obtaining the target typesetting system file based on the standard file and the target typesetting system configuration information includes:

[0018] Reading each paragraph of the standard file in sequence; each paragraph includes at least one block;

[0019] For each block in each of the paragraphs read, perform attribute analysis on the block based on a preset attribute analyzer to determine the attribute of the block;

[0020] Based on the preset correspondence between each attribute and each LaTeX command, determine the LaTeX command matching the attribute of each block;

[0021] Based on the LaTeX commands that match the properties of each block, a LaTeX file is obtained.

[0022] Considering the excellent characteristics of LaTeX files at the typesetting level, the target typesetting system files here may include LaTeX files. Here, the properties of the blocks can be determined based on the property analysis results of each block in each paragraph of the standard file, and then the LaTeX commands that match the properties of each block are determined based on the preset correspondence between the properties and the LaTeX commands. In this way, LaTeX files can be obtained based on the LaTeX command configuration, and the obtained LaTeX files can be better compatible with subsequent LaTeX typesetting systems. In addition, here is the LaTeX command corresponding to the property matching of the block, and the modification of the LaTeX command can be realized later to achieve unified modification of the properties, thereby improving the subsequent typesetting efficiency.

[0023] In a possible implementation, obtaining a LaTeX file based on a LaTeX command matching the attributes of each block includes:

[0024] For each block in each of the paragraphs, a LaTeX command matching the attribute of the block and the content of the block are bound to obtain a LaTeX command line corresponding to the block;

[0025] For each of the paragraphs, combining the LaTeX command lines corresponding to the blocks belonging to the paragraph to obtain a LaTeX command line corresponding to the paragraph;

[0026] The LaTeX command lines corresponding to the paragraphs are combined according to the arrangement order of the paragraphs to obtain a LaTeX file.

[0027] Here, the properties of the blocks and the contents of the blocks are bound to obtain the LaTeX command line corresponding to each paragraph, and the final LaTeX file can be obtained by combining the paragraphs. For LaTeX files, the properties of the blocks can be modified separately, and the contents of the blocks can also be modified separately, which improves the efficiency of subsequent typesetting.

[0028] In a possible implementation manner, the lecture file in the second document format includes a PDF file, and typeset the target typesetting system file to generate the typeset lecture file in the second document format, including:

[0029] When it is determined that an editing instruction for the LaTeX file is received from the client, modifying the LaTeX file based on the editing instruction to obtain a modified LaTeX file;

[0030] The modified LaTeX file is typeset to generate a typeset PDF file.

[0031] In a possible implementation, the LaTeX command includes a macro command; receiving an editing instruction from a client for the LaTeX file includes:

[0032] Receiving a style editing instruction of a macro command matching an attribute of any block included in the LaTeX file;

[0033] Alternatively, a content editing instruction for any block included in the LaTeX file is received.

[0034] Here, style editing can be implemented through style editing instructions of macro commands that match block attributes, and content editing can also be implemented through content editing instructions of blocks, supporting various editing requirements.

[0035] In a possible implementation, typeset the target typesetting system file to generate a typeset lecture file in the second document format, including:

[0036] The target typesetting system file is typeset by calling a preset typesetting engine to generate a lecture file in a typeset second document format.

[0037] In a possible implementation manner, after obtaining the standard file for describing each file format, the method further includes:

[0038] When it is determined that a conversion instruction pointing from the target typesetting system file to other target typesetting system files is received, a standard file corresponding to the target typesetting system file is obtained, and other typesetting system files are obtained based on the standard file and other typesetting system configuration information.

[0039] Here, considering that standard files can accommodate various document formats, arbitrary conversion between target typesetting system files and other typesetting system files can be achieved based on standard files, which has better adaptability.

[0040] In a second aspect, an embodiment of the present disclosure further provides a device for typesetting a lecture note, the device comprising:

[0041] An acquisition module, used for acquiring a handout file in a first document format to be typeset;

[0042] A first generation module is used to standardize the lecture file based on a standard content model to obtain a standard file; the standard content model is used to uniformly describe the content and style of rich text documents in different document formats;

[0043] A second generation module is used to obtain a target typesetting system file based on the standard file and the target typesetting system configuration information;

[0044] The typesetting module is used to typeset the target typesetting system file and generate a lecture file in a typeset second document format.

[0045] In the third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method for typesetting lecture notes as described in the first aspect and any of its various embodiments are performed.

[0046] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, executes the steps of the method for typesetting lecture notes as described in the first aspect and any of its various embodiments.

[0047] For a description of the effects of the above-mentioned lecture note typeset device, electronic device, and computer-readable storage medium, please refer to the description of the above-mentioned lecture note typeset method, which will not be repeated here.

[0048] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0050] Figure 1 A flow chart showing a method for typesetting lecture notes provided by an embodiment of the present disclosure is shown;

[0051] Figure 2 A schematic diagram showing an application of a lecture typesetting method provided by an embodiment of the present disclosure;

[0052] Figure 3 A schematic diagram showing a device for typesetting lecture notes provided by an embodiment of the present disclosure is shown;

[0053] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0055] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0056] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0057] Research has found that due to the format differences between online handouts and Word files, formatting errors are inevitable when exporting handouts as Word files. In addition, due to the incompatibility between Word files and typesetting software, the final edited courseware has many losses and errors in content and style.

[0058] Based on the above research, the present disclosure provides a method, device, electronic device and storage medium for typesetting handouts, which have high typesetting accuracy.

[0059] To facilitate understanding of this embodiment, a method for typesetting a lecture note disclosed in an embodiment of the present disclosure is first introduced in detail. The execution subject of the method for typesetting a lecture note provided in an embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the method for typesetting a lecture note can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0060] See also Figure 1 FIG. 1 is a flowchart of a method for typesetting lecture notes provided in an embodiment of the present disclosure, wherein the method includes steps S101 to S104, wherein:

[0061] S101: Obtaining a lecture file in a first document format to be typeset;

[0062] S102: Based on the standard content model, the lecture file is standardized to obtain a standard file; the standard content model is used to uniformly describe the content and style of rich text documents in different document formats;

[0063] S103: Obtaining a target typesetting system file based on the standard file and the target typesetting system configuration information;

[0064] S103: Typesetting the target typesetting system file to generate a typesetting lecture file in a second document format.

[0065] In order to facilitate understanding of the method for typesetting handouts provided by the embodiment of the present disclosure, the application scenario of the method is briefly described below. The above-mentioned method for typesetting handouts can be mainly applied to online education scenarios, which can help teaching and research teachers to typeset handout files into typeset high-printing quality handout files for the convenience of teaching and research teachers. The handout files to be typeset here can be handout files edited using an online handout editing tool, which have a special data structure. The high-printing quality handout files here can refer to rendered PDF files, which have better visualization effects.

[0066] The format of the lecture file to be typeset may be a first document format that describes the content and style of the rich text using the EasySync OT data structure of the collaborative protocol. The readability of the EasySync OT data structure is relatively poor.

[0067] In order to better realize the typesetting of the lecture file, the lecture file with the first document format can be standardized to obtain a standard file, which can not only well describe the conversion relationship between the lecture file and other various files, but also solve the above-mentioned problem of poor readability. In this way, after configuring the standard file using the target typesetting system configuration information, the target typesetting system file can be obtained.

[0068] The target typesetting system file here can be a file with good typesetting performance, for example, it can be a LaTeX file, so that after typesetting the target typesetting system file, a lecture file in the second document format after typesetting can be obtained. For example, in the case where the LaTeX file is used as the target typesetting system file, the lecture file in the second document format after typesetting here can be a PDF file. In specific applications, the final typesetting effect can be achieved through rendering technology, which will not be elaborated here.

[0069] In the disclosed embodiment, standardized processing of lecture files can be implemented based on a standard content model. The standard content model here is used to uniformly describe the content and style of rich text documents in different document formats. That is, it can be used as an intermediate model for conversion of various document formats. This ensures the universality and scalability of the content conversion service and realizes mutual conversion between various document formats.

[0070] The above standard content model can be a standard model extracted from various document formats, and can take into account various document formats. In this way, the target typesetting system file can be obtained conveniently and quickly using the target typesetting system configuration information. It can be seen that for the lecture file with poor readability in the first document format, standardization processing under the constraint of high readability can be performed here, and then the typesetting operation for the target typesetting system file with good typesetting characteristics can be realized. In this way, the lecture file with the second document format obtained greatly reduces the probability of loss and error in typesetting content, making the typesetting accuracy higher.

[0071] The target typesetting system configuration information in the disclosed embodiment may be a configuration command for a target typesetting system file. In a specific application, corresponding configuration commands may be selected based on different target typesetting system files. Considering the excellent characteristics of LaTeX files at the typesetting level, LaTeX files may be used as target typesetting system files.

[0072] For LaTeX files, a preset typesetting engine can be called in the disclosed embodiment to implement typesetting. In specific applications, the XeTeX typesetting engine can be used to compile and render to support OpenType font technology and generate PDF files.

[0073] The XeTeX typesetting engine can be included in the TeX Live software distribution package, and the distribution image in the TeX Live software distribution package can be packaged in the service image. In this way, the LaTeX file can be compiled into a PDF file by directly calling the XeTeX typesetting engine, and rendered on the client to display the PDF file.

[0074] Considering the key role of the generation of standard files in subsequent typesetting, the process of generating standard files can be described below, which specifically includes the following steps:

[0075] Step 1: parsing the lecture file based on a predefined file parsing model to parse out first file data information matching the file parsing model;

[0076] Step 2: Determine the parsed file based on the parsed first file data information and the file parsing model;

[0077] Step 3: converting the parsed file based on a predefined standard content model to obtain second file data information matching the standard content model;

[0078] Step 4: Obtain a standard file based on the obtained second file data information and the standard content model.

[0079] Here, considering that the readability of the lecture file in the first document format is poor, the lecture file can first be parsed using a predefined file parsing model to parse out the first file data information that matches the file parsing model. The analysis here can be an analysis of the collaborative data structure EasySync OT of the lecture file to be typeset.

[0080] The above file parsing model can be used to describe the content and attributes of file paragraphs and each block within a paragraph, and can be understood as a framework model. Taking online education as an example, the first file data information parsed here can be the content of the relevant blocks, including special business metadata such as test questions and subject plug-ins in online handouts, or the attributes of the relevant blocks, including data such as the style of the test questions.

[0081] It should be noted that the specific content of the corresponding file paragraphs may be different for different educational subjects. For example, in mathematics, the file paragraph here may point to a math problem, which may include the title, stem, etc. The title and stem here may correspond to a block respectively, and have their own attributes, for example, the title is in the style of size 4 font, and the stem is in the style of a picture; for another example, in Chinese, the file paragraph here may correspond to a paragraph of an article.

[0082] Here, the first file data system information is input into the file parsing model, and the parsed file can be determined. For the parsed file, the embodiment of the present disclosure can convert the parsed file based on the standard content model. The standard content model here can also be understood as a framework model that describes a universal document format. Similarly, here, the second file data information obtained by converting the parsed file can be input into the standard content model, and the standard file can be determined.

[0083] The method for typesetting handouts provided in the embodiment of the present disclosure can generate a target typesetting system file based on a standard file. In the case where a LaTeX file is used as the target typesetting system file, the LaTeX file can be obtained by following the steps below:

[0084] Step 1: Read each paragraph of the standard file in sequence; each paragraph includes at least one block;

[0085] Step 2: for each block in each paragraph read, perform attribute analysis on the block based on a preset attribute analyzer to determine the attribute of the block;

[0086] Step 3: Based on the preset correspondence between each attribute and each LaTeX command, determine the LaTeX command that matches the attribute of each block;

[0087] Step 4: Get the LaTeX file based on the LaTeX commands that match the attributes of each block.

[0088] In order to better implement batch modification based on attributes, the embodiment of the present disclosure provides a solution for separately configuring the attributes and contents of the blocks with commands.

[0089] Here, we can first implement attribute parsing of each block based on the attribute parser, and then determine the LaTeX command that matches the attributes of the block, and then determine the final LaTeX file through the inclusion relationship between the block and the paragraph, and the arrangement order between the paragraphs. This can be achieved through the following steps:

[0090] Step 1: For each block in each paragraph, bind the LaTeX command matching the attribute of the block and the content of the block to obtain the LaTeX command line corresponding to the block;

[0091] Step 2: For each paragraph, combine the LaTeX command lines corresponding to the blocks belonging to the paragraph to obtain the LaTeX command line corresponding to the paragraph;

[0092] Step 3: Combine the LaTeX command lines corresponding to each paragraph according to the arrangement order of each paragraph to obtain a LaTeX file.

[0093] Considering that in the actual writing process, LaTeX will reference a large number of macro packages and custom macro commands, and often needs to modify the style definitions used to achieve the setting of the style required for typesetting. Therefore, the LaTeX commands here can mainly be pre-defined macro commands. That is, each attribute can point to a macro command. After determining the corresponding macro command, the content of the corresponding block can be bound to the macro command to obtain the LaTeX command line corresponding to the block. In this way, if the style needs to be modified later, it is only necessary to modify the pre-defined macro command, which greatly saves typesetting editing time.

[0094] The typesetting operation in the disclosed embodiment may include a modification operation on a LaTeX file. Here, an editing window may be provided on the client, and when it is determined that an editing instruction for the LaTeX file is received from the client, the LaTeX file is modified based on the editing instruction to obtain a modified LaTeX file, and then the modified LaTeX file is typeset to generate a typeset PDF file.

[0095] The above-mentioned editing instruction may be determined by receiving a style editing instruction of a macro command matching the attributes of any block included in the LaTeX file, that is, the macro command may be modified on the client to select the style to be applied, or it may be determined by receiving a content editing instruction of any block included in the LaTeX file, that is, the block content may be modified on the client to determine the modified content.

[0096] No matter which of the above editing instructions is used, it can be initiated by the online LaTeX editor set up on the client, which is mainly to enable typesetters to perform editing operations better.

[0097] In order to understand the interaction process between the above server and client, we can combine Figure 2 Further explanation.

[0098] like Figure 2 As shown, an editor interface is presented on the client. On the current editor interface, the user can use the LaTeX editor to initiate editing instructions, so that the server can perform relevant modification operations directed to specific LaTeX files based on typesetting project management. The modification here can be a modification of the content of the handout or a modification of the handout layout.

[0099] Regardless of the above modification method, in the embodiment of the present disclosure, LaTeX file compilation can be performed on the server side, and the compiled PDF file can be rendered on the editor interface of the client side.

[0100] The method for typesetting lecture notes provided by the embodiment of the present disclosure can also use standard files to achieve conversion between different files to meet the user's file conversion needs. Here, when it is determined that a conversion instruction is received from a target typesetting system file to other target typesetting system files, the standard file corresponding to the target typesetting system file is obtained, and based on the standard file and other typesetting system configuration information, other typesetting system files are obtained.

[0101] The other typesetting system files here may be HTML files, Word files, or other system files, and the embodiments of the present disclosure do not impose specific limitations on this.

[0102] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0103] Based on the same inventive concept, an apparatus for lecture note typeset corresponding to the method for lecture note typeset is also provided in the embodiments of the present disclosure. Since the principle of solving the problem by the apparatus in the embodiments of the present disclosure is similar to the method for lecture note typeset mentioned above in the embodiments of the present disclosure, the implementation of the apparatus can refer to the implementation of the method, and the repeated parts will not be repeated.

[0104] Reference Figure 3 , which is a schematic diagram of a device for typesetting lecture notes provided by an embodiment of the present disclosure, the device comprises: an acquisition module 301, a first generation module 302, a second generation module 303 and a typesetting module 304; wherein,

[0105] An acquisition module 301 is used to acquire a lecture file in a first document format to be typeset;

[0106] The first generation module 302 is used to standardize the lecture file based on the standard content model to obtain a standard file; the standard content model is used to uniformly describe the content and style of rich text documents in different document formats;

[0107] The second generation module 303 is used to obtain a target typesetting system file based on the standard file and the target typesetting system configuration information;

[0108] The typesetting module 304 is used to typeset the target typesetting system file and generate a lecture file in a typeset second document format.

[0109] By using the above-mentioned lecture note typeset device, the lecture note files to be typeset can first be standardized based on the standard content model to obtain standard files. Since the standard content model here is used to uniformly describe the content and style of rich text documents under different document formats, the standard files generated based on the above-mentioned standard content model can well take into account the lecture note files and the typesetting system files, ensuring the compatibility between the target typesetting system files generated by the subsequent configuration of the standard files based on the target typesetting system configuration information and the typesetting system, thereby reducing the probability of loss and errors in the typeset content and making the typesetting accuracy higher.

[0110] In a possible implementation, the first generation module 302 is used to perform standardization processing on the lecture file based on the standard content model according to the following steps to obtain a standard file:

[0111] Parsing the lecture file based on a predefined file parsing model to parse out first file data information matching the file parsing model;

[0112] Determine a parsed file according to the parsed first file data information and the file parsing model;

[0113] Convert the parsed file based on a predefined standard content model to obtain second file data information matching the standard content model;

[0114] Based on the obtained second file data information and the standard content model, a standard file is obtained.

[0115] In a possible implementation, the target typesetting system file includes a LaTeX file, and the second generation module 303 is used to obtain the target typesetting system file based on the standard file and the target typesetting system configuration information according to the following steps:

[0116] Read each paragraph of the standard file in sequence; each paragraph includes at least one block;

[0117] For each block in each paragraph read, perform attribute analysis on the block based on a preset attribute analyzer to determine the attribute of the block;

[0118] Based on the preset correspondence between each attribute and each LaTeX command, determine the LaTeX command matching the attribute of each block;

[0119] Based on the LaTeX commands that match the properties of each block, a LaTeX file is obtained.

[0120] In a possible implementation, the second generation module 303 is used to obtain a LaTeX file based on a LaTeX command matching the attributes of each block according to the following steps:

[0121] For each block in each paragraph, bind the LaTeX command matching the attribute of the block and the content of the block to obtain the LaTeX command line corresponding to the block;

[0122] For each paragraph, combine the LaTeX command lines corresponding to the blocks belonging to the paragraph to obtain the LaTeX command line corresponding to the paragraph;

[0123] The LaTeX command lines corresponding to the paragraphs are combined according to the arrangement order of the paragraphs to obtain a LaTeX file.

[0124] In a possible implementation, the lecture file in the second document format includes a PDF file, and the typesetting module 304 is used to typeset the target typesetting system file according to the following steps to generate a typeset lecture file in the second document format:

[0125] When it is determined that an editing instruction for the LaTeX file is received from the client, the LaTeX file is modified based on the editing instruction to obtain a modified LaTeX file;

[0126] Typeset the modified LaTeX file and generate a typeset PDF file.

[0127] In a possible implementation, the LaTeX command includes a macro command; the typesetting module 304 is used to receive the editing instruction of the client for the LaTeX file according to the following steps:

[0128] Receiving a style editing instruction of a macro command matching an attribute of any block included in the LaTeX file;

[0129] Alternatively, a content editing instruction for any block included in the LaTeX file is received.

[0130] In a possible implementation, the typesetting module 304 is used to typeset the target typesetting system file according to the following steps to generate a typesetting lecture file in the second document format:

[0131] The target typesetting system file is typeset by calling a preset typesetting engine to generate a lecture file in a typeset second document format.

[0132] In a possible implementation manner, the above device further includes:

[0133] The conversion module 305 is used to obtain the standard files used to describe the formats of various files, and then, upon determining that a conversion instruction has been received from a target typesetting system file pointing to other target typesetting system files, obtain the standard files corresponding to the target typesetting system files, and obtain other typesetting system files based on the standard files and other typesetting system configuration information.

[0134] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0135] The present disclosure also provides an electronic device, such as Figure 4 4 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure, including: a processor 401, a memory 402, and a bus 403. The memory 402 stores machine-readable instructions executable by the processor 401 (for example, Figure 3 The machine-readable instructions of the acquisition module 301, the first generation module 302, the second generation module 303, and the typesetting module 304 are executed in the device, etc. When the electronic device is running, the processor 401 communicates with the memory 402 through the bus 403, and the following processing is performed when the machine-readable instructions are executed by the processor 401:

[0136] Obtaining a handout file in a first document format to be typeset;

[0137] Based on the standard content model, the lecture files are standardized to obtain standard files; the standard content model is used to uniformly describe the content and style of rich text documents in different document formats;

[0138] Based on the standard file and the configuration information of the target typesetting system, the target typesetting system file is obtained;

[0139] Typesetting the target typesetting system file to generate a lecture file in a typeset second document format.

[0140] The present disclosure also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of the lecture typesetting method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0141] The present disclosure also provides a computer program product that carries a program code. The program code includes instructions that can be used to execute the steps of the lecture note typeset method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0142] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0143] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0145] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0146] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0147] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A method for typesetting a lecture note, characterized in that: The method comprises: Obtaining a handout file in a first document format to be typeset; Based on a standard content model, the lecture file is standardized to obtain a standard file; the standard content model is used to uniformly describe the content and style of rich text documents in different document formats; Based on the standard file and the target typesetting system configuration information, a target typesetting system file is obtained; Typesetting the target typesetting system file to generate a typesetting handout file in a second document format; Wherein, the target typesetting system file includes a LaTeX file, and the target typesetting system file is obtained based on the standard file and the target typesetting system configuration information, including: Reading each paragraph of the standard file in sequence; each paragraph includes at least one block; For each block in each of the paragraphs read, perform attribute analysis on the block based on a preset attribute analyzer to determine the attribute of the block; Based on the preset correspondence between each attribute and each LaTeX command, determine the LaTeX command matching the attribute of each block; Based on the LaTeX commands matching the attributes of each block, a LaTeX file is obtained; The LaTeX file is obtained based on the LaTeX command matching the attributes of each block, including: For each block in each of the paragraphs, a LaTeX command matching the attribute of the block and the content of the block are bound to obtain a LaTeX command line corresponding to the block; For each of the paragraphs, combining the LaTeX command lines corresponding to the blocks belonging to the paragraph to obtain a LaTeX command line corresponding to the paragraph; The LaTeX command lines corresponding to the paragraphs are combined according to the arrangement order of the paragraphs to obtain a LaTeX file.

2. The method according to claim 1, characterized in that: The standard content model is used to standardize the lecture file to obtain a standard file, including: Parsing the lecture file based on a predefined file parsing model to parse out first file data information matching the file parsing model; Determine a parsed file according to the parsed first file data information and the file parsing model; Converting the parsed file based on a predefined standard content model to obtain second file data information matching the standard content model; The standard file is obtained based on the obtained second file data information and the standard content model.

3. The method according to claim 1, characterized in that The lecture file in the second document format includes a PDF file, and typeset the target typesetting system file to generate the lecture file in the second document format after typeset, including: When it is determined that an editing instruction for the LaTeX file is received from the client, modifying the LaTeX file based on the editing instruction to obtain a modified LaTeX file; The modified LaTeX file is typeset to generate a typeset PDF file.

4. The method according to claim 3, characterized in that The LaTeX command includes a macro command; receiving an editing instruction from a client for the LaTeX file, including: Receiving a style editing instruction of a macro command matching an attribute of any block included in the LaTeX file; Alternatively, a content editing instruction for any block included in the LaTeX file is received.

5. The method according to any one of claims 1 to 4, characterized in that: The step of typeset the target typesetting system file to generate a typeset second document format lecture file includes: The target typesetting system file is typeset by calling a preset typesetting engine to generate a lecture file in a typeset second document format.

6. The method according to any one of claims 1 to 4, characterized in that: After obtaining the standard files used to describe the formats of various files, it also includes: When it is determined that a conversion instruction pointing from the target typesetting system file to other target typesetting system files is received, a standard file corresponding to the target typesetting system file is obtained, and other typesetting system files are obtained based on the standard file and other typesetting system configuration information.

7. A device for typesetting lecture notes, characterized in that: The device comprises: An acquisition module, used for acquiring a handout file in a first document format to be typeset; A first generation module is used to standardize the lecture file based on a standard content model to obtain a standard file; the standard content model is used to uniformly describe the content and style of rich text documents in different document formats; A second generation module is used to obtain a target typesetting system file based on the standard file and the target typesetting system configuration information; A typesetting module, used for typeset the target typesetting system file to generate a typesetting handout file in a second document format; Wherein, the second generating module is further used for: Reading each paragraph of the standard file in sequence; each paragraph includes at least one block; For each block in each of the paragraphs read, perform attribute analysis on the block based on a preset attribute analyzer to determine the attribute of the block; Based on the preset correspondence between each attribute and each LaTeX command, determine the LaTeX command matching the attribute of each block; Based on the LaTeX commands matching the attributes of each block, a LaTeX file is obtained; Wherein, the second generating module is further used for: For each block in each of the paragraphs, a LaTeX command matching the attribute of the block and the content of the block are bound to obtain a LaTeX command line corresponding to the block; For each of the paragraphs, combining the LaTeX command lines corresponding to the blocks belonging to the paragraph to obtain a LaTeX command line corresponding to the paragraph; The LaTeX command lines corresponding to the paragraphs are combined according to the arrangement order of the paragraphs to obtain a LaTeX file.

8. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus. When the machine-readable instructions are executed by the processor, the steps of the lecture typesetting method as described in any one of claims 1 to 6 are performed.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the lecture typesetting method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Typesetting method and device based on format layout template

    CN101872340A

  • A method and device for converting an XML file into a Word file

    CN109815450A

  • Method and device for automatically generating lecture notes based on web technology

    CN110532525A

  • Paper document processing method and device, electronic equipment and storage medium

    CN112651217A