Word processing method and device
By splitting documents into multiple independent article units and combining them with LaTeX fragments, the limitations of existing word processors in complex typesetting and multi-person collaboration are overcome, achieving professional-grade typesetting effects and document format consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-24
AI Technical Summary
Existing word processors cannot meet professional typesetting needs when handling complex mathematical formulas, advanced charts, or specific typesetting rules, and are prone to pointer misalignment issues caused by adding or deleting content when multiple people are collaborating.
The document structure is restructured into multiple independent article units, each of which can be directly edited. It combines LaTeX fragments for typesetting and editing, and generates the final document through compilation and rendering technology. It supports editing and previewing complex content such as formulas, images, and tables.
It achieves professional-grade typesetting effects, ensures document format consistency and high-quality output, overcomes the limitations of existing word processors in complex typesetting and multi-person collaboration, and provides real-time preview and adjustment functions.
Smart Images

Figure CN121723977A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of text processing technology, and in particular to a text processing method and apparatus. Background Technology
[0002] With the rapid development of information technology, text editing and typesetting have been widely applied in various fields such as scientific research, education, and publishing. Especially in the writing of academic papers, technical documents, and professional books, the quality of document typesetting is crucial to the presentation of the content.
[0003] Existing word processing technologies are mainly divided into intuitive editing methods, represented by WYSIWYG word processors such as Microsoft Word. The biggest advantage of WYSIWYG word processors lies in their ease of use; users do not need to write code, but can directly edit the document content to see the layout effect. For general document editing tasks, word processors provide a convenient operating experience, making them particularly suitable for daily office work and simple document writing. However, when documents involve complex mathematical formulas, advanced charts, or require specific layout rules, their built-in layout functions cannot fully meet the demanding professional layout needs. Summary of the Invention
[0004] This application provides a text processing method and apparatus to solve the problem that its built-in typesetting function cannot fully meet the high-requirement professional typesetting needs.
[0005] To achieve the above objectives, this application provides the following technical solution:
[0006] The first aspect of this application provides a text processing method, including:
[0007] Restructure the document into one or more article units; each article unit can be triggered directly.
[0008] In response to the triggered target article unit, the editing page of the target article unit is displayed; the target article unit can be any one of the article units.
[0009] In response to the triggered typesetting and editing operation on the editing page, typesetting and editing of the target article unit are performed using WYSIWYG editing mode and LaTeX fragments to generate integrated content;
[0010] The fused content is rendered using a compilation rendering method to obtain the rendering result;
[0011] The final document is generated based on all rendering results.
[0012] Optionally, the typesetting and editing operations include at least formula editing operations;
[0013] The typesetting and editing operation triggered by the editing page, through WYSIWYG editing and LaTeX fragments, performs typesetting and editing on the target article unit to generate integrated content, including:
[0014] In response to a formula editing operation triggered on the edit page, the formula editing page is displayed;
[0015] Based on the LaTeX fragment typed on the formula editing page, the LaTeX fragment is rendered as a preview formula on the formula editing page;
[0016] In response to the confirmation operation of the preview formula, the preview formula is inserted into the target article unit to obtain the fused content.
[0017] Optional, also includes:
[0018] On the formula editing page, the LaTeX fragments entered by the user are compiled and checked.
[0019] When a compilation error is detected, a LaTeX snippet containing the error code is displayed;
[0020] In response to a triggered preview operation of a LaTeX fragment containing an error code, the LaTeX fragment containing the error code is converted into an error message and displayed.
[0021] Optionally, the layout editing operation includes at least image editing operations;
[0022] The typesetting and editing operation triggered by the editing page, through WYSIWYG editing and LaTeX fragments, performs typesetting and editing on the target article unit to generate integrated content, including:
[0023] In response to an image editing operation triggered on the edit page, the image editing page is displayed;
[0024] In response to the triggered image upload operation on the image editing page, upload the image and display an image preview;
[0025] In the image editing page, image layout parameters are received, and LaTeX fragments are generated based on the image layout parameters;
[0026] The LaTeX fragment is rendered to obtain a preview rendering effect;
[0027] In response to the confirmation operation of the triggered preview rendering effect, the LaTeX fragment is inserted into the target article unit to obtain the fused content.
[0028] Optionally, the layout editing operation includes at least table editing operations;
[0029] The typesetting and editing operation triggered by the editing page, through WYSIWYG editing and LaTeX fragments, performs typesetting and editing on the target article unit to generate integrated content, including:
[0030] In response to a table editing operation triggered on the aforementioned editing page, the LaTeX fragment for creating the table is displayed;
[0031] Based on the table content entered in the LaTeX fragment, the table is generated and inserted into the target article unit to obtain the fused content.
[0032] Optional, also includes:
[0033] In response to the triggered table creation operation on the edit page, the table creation page is displayed;
[0034] The table is displayed in response to the table formatting operation triggered on the table creation page.
[0035] Optional, also includes:
[0036] In response to the triggered footnote addition operation on the edit page, the footnote addition page is displayed;
[0037] The footnote content is inserted into the target article unit based on the footnote content typed on the footnote addition page.
[0038] Optional, also includes:
[0039] In response to the triggered code insertion operation on the editing page, the code editing page is displayed;
[0040] The code content is inserted into the target article unit based on the code content entered on the code editing page.
[0041] Optional, also includes:
[0042] In response to the triggered LaTeX fragment creation operation on the editing page, the LaTeX fragment creation page is displayed;
[0043] Based on the target LaTeX fragment typed on the LaTeX fragment creation page, insert the target LaTeX fragment into the target article unit;
[0044] In response to the preview operation triggered on the editing page, the target LaTeX fragment is rendered and the rendering effect of the target LaTeX fragment is displayed.
[0045] Optional, also includes:
[0046] In response to the preview operation triggered on the editing page, the target article unit is compiled into a print style;
[0047] In response to the triggered single-column display operation of the edit page, the print style is displayed in a single-column manner;
[0048] In response to the triggered two-column display operation of the editing page, the print style is displayed in a two-column manner.
[0049] Optional, also includes:
[0050] In response to a text input operation triggered on the edit page, a text input page is displayed;
[0051] In response to the triggered new text input page creation operation, a sub-unit is created.
[0052] Optional, also includes:
[0053] The text content is inserted into the target article unit based on the text content entered on the text input page;
[0054] In response to the triggered ordered list operation on the edit page, the text content is converted into an ordered format and displayed;
[0055] In response to the triggered unordered list operation on the edit page, the text content is converted to an unordered format and displayed.
[0056] Optional, also includes:
[0057] In response to a formula input operation triggered on the edit page, a block-shaped mathematical formula page is displayed;
[0058] The mathematical formula is inserted into the target article unit based on the mathematical formula entered on the block mathematical formula page.
[0059] Optional, also includes:
[0060] In response to the triggered comment input operation on the edit page, the comment input page is displayed;
[0061] An annotation identifier is generated based on the text annotation entered on the annotation input page.
[0062] A second aspect of this application provides a text processing apparatus, comprising:
[0063] Split units are used to restructure the document structure into one or more article units; each article unit can be triggered directly.
[0064] A page display unit is used to display the editing page of a target article unit in response to a triggered target article unit; the target article unit can be any one of the article units.
[0065] An editing unit is used to respond to the typesetting and editing operation of the triggered editing page, and to perform typesetting and editing on the target article unit through WYSIWYG editing mode and LaTeX fragments to generate fused content;
[0066] The rendering unit is used to render the fused content using a compile-and-render method to obtain the rendering result;
[0067] The generation unit is used to generate the final document based on all rendering results.
[0068] The technical solution provided in this application reconstructs the document structure from a traditional linear representation to a tree structure composed of one or more article units and multiple sub-units. Each article unit can be directly clicked and triggered, and they are both independent and cross-referenced. In response to the triggered target article unit, the editing page of the target article unit is displayed. The target article unit can be any article unit. In response to the typesetting and editing operations on the triggered editing page, the target article unit is typeset and edited using a WYSIWYG editing method and LaTeX fragments to obtain merged content. The merged content is rendered using a compilation and rendering method to obtain the rendering result. The final document is generated based on all rendering results. By splitting the document into multiple independent article units and combining them with LaTeX fragments for typesetting and editing, this effectively solves the limitations of existing WYSIWYG word processors in handling complex typesetting needs, as well as the pointer misalignment problem in other units caused by the addition or deletion of content in one unit during multi-person collaboration. Through compilation and rendering technology, users can preview the typesetting effect of a single LaTeX fragment or the entire unit in real time and accurately while writing an article unit, and make adjustments accordingly, thereby ensuring the consistency of the final document format and high-quality output, meeting professional-level typesetting requirements. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0070] Figure 1 A flowchart illustrating a text processing method provided in this application embodiment;
[0071] Figure 2 A schematic diagram of an article unit provided in an embodiment of this application;
[0072] Figure 3 A schematic diagram of a typesetting toolbar provided for an embodiment of this application;
[0073] Figure 4 A schematic diagram illustrating the creation of a table, provided as an embodiment of this application;
[0074] Figure 5 A schematic diagram of a table format provided for an embodiment of this application;
[0075] Figure 6 A schematic diagram of a footnote adding page provided for an embodiment of this application;
[0076] Figure 7 A schematic diagram of footnote content for an article unit provided in an embodiment of this application;
[0077] Figure 8 A schematic diagram of a code editing page provided in an embodiment of this application;
[0078] Figure 9 A schematic diagram illustrating the code content in an article unit provided in an embodiment of this application;
[0079] Figure 10 A schematic diagram of code content provided for an embodiment of this application;
[0080] Figure 11 A schematic diagram illustrating the creation of a page from a LaTeX fragment, provided in an embodiment of this application;
[0081] Figure 12 A schematic diagram of a target LaTeX fragment provided in an embodiment of this application;
[0082] Figure 13 A schematic diagram illustrating the rendering effect of a target LaTeX fragment provided in an embodiment of this application;
[0083] Figure 14 A schematic diagram of a single-page display page provided for an embodiment of this application;
[0084] Figure 15 A schematic diagram of a two-page display page provided in an embodiment of this application;
[0085] Figure 16 A schematic diagram of a drop-down menu for a typesetting tool provided in an embodiment of this application;
[0086] Figure 17 A schematic diagram of a list format provided for an embodiment of this application;
[0087] Figure 18 A schematic diagram of various units provided for an embodiment of this application;
[0088] Figure 19 A schematic diagram of a block-shaped mathematical formula page provided in an embodiment of this application;
[0089] Figure 20 A schematic diagram illustrating the effect of a formula provided in an embodiment of this application;
[0090] Figure 21 A schematic diagram of a preview formula provided for an embodiment of this application;
[0091] Figure 22 A schematic diagram of a LaTeX fragment containing error codes provided for an embodiment of this application;
[0092] Figure 23 This is a schematic diagram of an error message provided in an embodiment of this application;
[0093] Figure 24 A schematic diagram of an illustration mode provided for an embodiment of this application;
[0094] Figure 25 A schematic diagram illustrating an image upload method provided in an embodiment of this application;
[0095] Figure 26 A schematic diagram of a preview interface provided for an embodiment of this application;
[0096] Figure 27 A schematic diagram of an embodiment of this application;
[0097] Figure 28 This is a schematic diagram illustrating an image effect provided in an embodiment of this application.
[0098] Figure 29 A schematic diagram of another image editing page provided in an embodiment of this application;
[0099] Figure 30 This is a schematic diagram illustrating a preview of an uploaded image provided in an embodiment of this application.
[0100] Figure 31 A schematic diagram of a LaTeX fragment provided in an embodiment of this application;
[0101] Figure 32 A schematic diagram of an image label provided in an embodiment of this application;
[0102] Figure 33 A schematic diagram illustrating a preview rendering effect provided in an embodiment of this application;
[0103] Figure 34 A schematic diagram of a LaTeX fragment for creating a table, provided as an embodiment of this application;
[0104] Figure 35 A schematic diagram illustrating the contents of a figure provided in an embodiment of this application;
[0105] Figure 36 A schematic diagram of an inline mathematical formula provided for an embodiment of this application;
[0106] Figure 37 This is a schematic diagram of the architecture of a text processing device provided in an embodiment of this application. Detailed Implementation
[0107] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0108] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0109] like Figure 1 The diagram shown is a flowchart of a text processing method provided in an embodiment of this application, including the following steps:
[0110] S101: Restructure the document structure into one or more document units.
[0111] This allows for the creation of multi-level sub-units for article units to form a tree-like hierarchical structure; each article unit can be directly triggered by clicking, and they are both independent of each other and cross-referenced.
[0112] Specifically, an article may contain only one article unit, without sub-units. An article may also contain multiple article units, but without sub-units. More complex documents contain multiple article units, and at least one article unit contains multiple levels of sub-units.
[0113] Specifically, an article unit is a block, which can be a chapter of a document, such as an abstract.
[0114] Understandably, the document structure is split into multiple independently addressable article units. Each unit not only supports independent editing and caching, but also differential processing, that is, updating and processing only the newly modified parts.
[0115] Specifically, an article unit can contain nested sub-article units. Sub-article units are divided into sections, subsections, sub-subsections, and paragraphs, from largest to smallest. A section is the superior unit of a subsection, and so on. Any unit can contain various subordinate units.
[0116] For example, see article unit. Figure 2 The content shown is in Figure 2 In this paper, the abstract, the title of the first section, ... the title of the Nth section, the conclusion, the references, and the appendix are the unit of the article. Each section title can contain text fragments from word processors and LaTeX fragments.
[0117] In LaTeX, any valid segment in the body of the text that does not contain a preamble is called a LaTeX segment. Specifically, it refers to any valid code segment located after \begin{document} and before \end{document} (excluding the bibliography). LaTeX segments can be used to compensate for the shortcomings of ordinary word processors in complex typesetting capabilities.
[0118] Accordingly, within any document unit, paragraphs of sibling text that do not contain LaTeX fragments are called word processor text fragments. Subheadings within a unit are considered part of the sibling text; however, LaTeX fragments are allowed in sub-units contained within word processor text fragments. The content of each unit consists of alternating word processor text fragments and LaTeX fragments.
[0119] In addition, LaTeX snippets can be directly inserted into any word processor text, thus achieving professional-grade LaTeX typesetting effects without leaving the editing environment, and ultimately supporting exporting or compiling to generate standard-compliant LaTeX documents.
[0120] S102: In response to the triggered target article unit, display the editing page of the target article unit.
[0121] The target article unit can be any article unit.
[0122] Understandably, the articles to be edited are organized into "sections" (i.e., article units). AI-generated content and logic modification suggestions can be provided for each section. The editing interface includes a title area listing the titles of all sections and their subsections, each title being a clickable anchor point. Clicking any anchor point automatically positions the cursor to the corresponding section node within the writing area, facilitating continued writing or formatting. In other words, when a user triggers a jump, the editing page for the target article unit will be displayed immediately.
[0123] Specifically, the editing page for the target article unit includes a layout toolbar, which includes layout functions such as inserting inline mathematical symbols, illustrations, creating tables, footnotes, program code, LaTeX snippets, and previewing. The layout toolbar can be found in [link to relevant documentation]. Figure 3 The content shown.
[0124] Optionally, after step S102, tables can be created directly in the article unit, which can not only improve the structure and clarity of the document, but also improve the typesetting effect. Therefore, in another embodiment of this application, a table creation method is provided, including process A1 to process A2.
[0125] A1: In response to the table creation operation triggered on the editing page, display the table creation page.
[0126] The table creation page is displayed in response to the table creation operation triggered on the editing page. The table creation page includes: (1) Create: setting rows / columns via the UI in the editor; (2) Create with LaTeX: defining the table structure using LaTeX fragments; (3) Upload Image: uploading the table generated by an external tool as an image; and (4) Upload Image with LaTeX: importing the table image generated by an external tool in LaTeX format. For details on creating a table, please refer to [link to documentation]. Figure 4 The content shown.
[0127] A2: Displays the table in response to the table formatting operation triggered on the table creation page.
[0128] The table formatting operations include the required number of rows and columns for the table.
[0129] For example, see Figure 5 The diagram illustrates a table format. In response to the Create button on the triggered table creation page, a table format selection page is displayed. In response to the table format operation on the triggered table format selection page, the table is displayed.
[0130] Optionally, after step S102, footnotes can be added directly to the article unit, which can effectively improve the document's structure, professionalism, and readability. Therefore, another embodiment of this application provides a footnote adding method, including processes B1 to B2.
[0131] B1: In response to the footnote addition action triggered on the edit page, display the footnote addition page.
[0132] Understandably, when a user clicks the "Add Footnote" icon, in response to the triggered footnote addition operation on the editing page, the footnote addition page is displayed. (See [link to footnote addition page] for details.) Figure 6 .
[0133] B2: Insert the footnote content into the target article unit based on the footnote content entered on the footnote addition page.
[0134] Understandably, the footnote content is inserted into the target article unit based on the footnote content entered on the footnote addition page. For the article unit's footnote content, please refer to... Figure 7 .exist Figure 7 The part highlighted in red in the image shows the footnote content.
[0135] Optionally, after step S102, code can be added directly to the article unit. Through code examples, readers can more intuitively understand the article content and can more easily practice and apply it. Therefore, in another embodiment of this application, a code addition method is provided, including processes C1 to C2.
[0136] C1: In response to a code insertion operation triggered on the editing page, display the code editing page.
[0137] Understandably, when a user clicks the "Insert Code" icon, in response to the triggered code insertion operation on the editing page, the code editing page is displayed. On the code editing page, the user can enter LaTeX snippets of code. The code editing page can be found in [link to relevant documentation]. Figure 8 .
[0138] C2: Insert the code content into the target article unit based on the code content entered on the code editing page.
[0139] The code content in the article unit can be found here. Figure 9 .from Figure 9 As can be seen, after receiving the code content, it automatically highlights it with different colors based on its function or type to enhance readability. This feature also supports collaborative editing scenarios, enabling multiple collaborators to more clearly and intuitively identify and process specific code elements in the document.
[0140] Furthermore, after compiling the code, it will automatically align according to the standard format of the programming language and clearly label each line with a line number. See the attached image for details. Figure 10 .
[0141] Optionally, after step S102, LaTeX fragments can also be created directly in the article unit. LaTeX fragments can not only handle complex mathematical formulas, but also support various citations, charts, symbols, etc., thus offering great flexibility for writing academic papers, reports, books, and other content. Therefore, another embodiment of this application provides a method for adding LaTeX fragments, including processes D1 to D3.
[0142] D1: In response to the LaTeX fragment creation operation triggered on the editing page, display the LaTeX fragment creation page.
[0143] Understandably, when a user clicks the "Create LaTeX Fragment" icon, in response to the triggered LaTeX fragment creation operation on the editing page, the LaTeX fragment creation page is displayed. The LaTeX fragment creation page can be found in [link to relevant documentation]. Figure 11 .
[0144] D2: Insert the target LaTeX fragment into the target article unit based on the target LaTeX fragment typed on the LaTeX fragment creation page.
[0145] The target LaTeX fragment is the LaTeX fragment newly input by the user.
[0146] Users can input any target LaTeX fragment on the LaTeX fragment creation page for formatting. For details on the specific format of the target LaTeX fragment, please refer to [link / reference]. Figure 12 .
[0147] D3: In response to the preview operation triggered on the editing page, render the target LaTeX fragment and display the rendering effect of the target LaTeX fragment.
[0148] The target LaTeX fragment can be previewed individually. Clicking the preview icon triggers a preview operation on the edit page, rendering the target LaTeX fragment and displaying its rendering effect. The rendering effect of the target LaTeX fragment can be found in [link to relevant documentation]. Figure 13 .
[0149] Optionally, after step S102, the target article unit can be previewed to help the user confirm whether the article's format meets expectations. Therefore, another embodiment of this application provides an article preview method, including processes E1 to E3.
[0150] E1: In response to the preview action triggered on the edit page, compile the target article unit into a print style.
[0151] Understandably, when a user clicks the "Preview" icon on the far right of the layout toolbar, in response to the triggered preview operation on the editing page, the currently edited target article unit is compiled into a print style, and the preview result is displayed in the right-hand area of the screen. This preview supports both single-column and two-column modes, and the content is displayed paginated according to the actual page numbers.
[0152] E2: In response to a single-column display operation triggered on the edit page, display the print style in a single-column manner.
[0153] Depending on the length of the article unit, it can be one page or multiple pages.
[0154] For details, please see the preview. Figure 14 On the right side.
[0155] E3: In response to the triggered two-column display operation on the editing page, display the print style in a two-column manner.
[0156] For details, please refer to the two-column display. Figure 15 On the right side.
[0157] Optionally, after step S102, lower-level units can be established to further refine the division and management of article units. Therefore, in another embodiment of this application, a method for establishing lower-level units is provided, including processes F1 to F2.
[0158] F1: Displays the text input page in response to a text input action triggered on the editing page.
[0159] When a user types " / " at the cursor position in the writing area, a drop-down menu for that set of typesetting tools will appear (see [link]). Figure 16 After selecting a typesetting tool, the input will begin from the current cursor position. If the user selects the "Text" tool, the text input operation will be responded to, and the corresponding text editing page will be accessed.
[0160] Alternatively, in other editing modes in the writing area, you can press the Enter key to quickly enter the text input mode and display the corresponding text input interface.
[0161] Optionally, after process F1, converting the text content into an ordered or unordered list helps to clearly organize information and paragraph structure, making the article more logically structured and helping readers better understand and absorb information. Therefore, another embodiment of this application provides a text content display method, including processes G1 to G3.
[0162] G1: Insert the text content into the target article unit based on the text content entered on the text input page.
[0163] G2: In response to an ordered list operation triggered on the edit page, convert the text content into an ordered format and display it.
[0164] Specifically, when a user clicks "Ordered List" on the edit page, in response to the triggered ordered list operation on the edit page, the text content is converted into an ordered format and displayed. For details on the ordered format, please refer to [link to documentation]. Figure 17 .
[0165] G3: In response to an unordered list operation triggered on the edit page, converts the text content into an unordered format and displays it.
[0166] Understandably, when a user clicks "Bullet List" on the editing page, in response to the triggered unordered list operation on the editing page, the text content is converted to an unordered format and displayed. For details on unordered formatting, please refer to [link / reference needed]. Figure 17 .exist Figure 17 In the middle, the left side shows the writing area display style, and the right side shows the preview style.
[0167] In addition, you can return to the original state by clicking the button twice in the current list.
[0168] F2: In response to a new text input page creation operation, create a sub-cell.
[0169] Understandably, within the target article unit, selecting "Heading2" creates a new section; similarly, selecting "Heading3" or "Heading4" creates a lower-level content unit. Clicking on the title of a parent unit within any lower-level unit inserts a new sibling unit at that level. For clarity, section titles (Heading1) are displayed in blue, while newly created section titles (Heading2) are black by default. Other lower-level units are indented according to their hierarchy; see [link to example]. Figure 18 .
[0170] Optionally, after step S102, mathematical formulas can be added to the article unit to convey complex mathematical content more intuitively and clearly, making the article easier to understand. Therefore, another embodiment of this application provides a method for adding mathematical formulas, including processes H1 to H2.
[0171] H1: Displays a block-shaped mathematical formula page in response to a formula input operation triggered on the editing page.
[0172] Specifically, when a user clicks "Equation" on the editing page, a block-style mathematical formula page is displayed in response to the triggered formula input operation on the editing page. The block-style mathematical formula page can be found here. Figure 19 .
[0173] H2: Insert the mathematical formula into the target article unit based on the mathematical formula entered on the block mathematical formula page.
[0174] In this feature, after entering a mathematical formula in the block-based mathematical formula editing page and confirming it, the user can insert it into the target article unit, where the formula will be displayed in real-time within the writing area with a "what you see is what you get" effect. For details on the formula effect, please refer to [link / reference]. Figure 20 .
[0175] Optionally, after step S102, annotations can be added to the article units to improve the document's comprehensibility, interactivity, and professionalism. Therefore, another embodiment of this application provides an annotation-adding method, including processes I1 and I2.
[0176] I1: In response to the comment input action triggered on the edit page, display the comment input page.
[0177] Understandably, when a user clicks the "Comment" button on the editing page, a comment input window will open at the current cursor position. At this point, the triggered comment input action will be responded to, and the corresponding comment editing page will be displayed.
[0178] I2: Generate annotation identifiers based on the text annotations entered on the annotation input page.
[0179] Specifically, users can enter text annotations in the annotation input window, which are supplementary explanations or clarifications that are not directly displayed in the main text. Annotations are saved along with the main text content, but are not directly visible in the main text interface; only an annotation marker is generated at the cursor insertion point. When the content of the writing area is exported to LaTeX format, these annotations are automatically converted and placed in the standard LaTeX annotation environment.
[0180] S103: In response to the typesetting and editing operations triggered on the editing page, typesetting and editing of the target article unit are performed using WYSIWYG editing and LaTeX fragments to generate integrated content.
[0181] Understandably, editing target text units using LaTeX fragments is essentially a process of merging and uniformly compiling and rendering the text from the word processor with the LaTeX fragments. This retains the intuitive "what you see is what you get" editing experience of the word processor while using LaTeX fragments to compensate for its limitations in handling complex formulas, technical symbols, and fine typesetting.
[0182] Optionally, in another embodiment of this application, the typesetting and editing operation includes at least the formula editing operation; the specific implementation of step S103 includes processes J1 to J3.
[0183] J1: Displays the formula editing page in response to a triggered formula editing operation.
[0184] Clicking the "Insert Inline Mathematical Formula" icon allows you to insert mathematical symbols, formulas, or special symbols within a line. When a user clicks the "Insert Inline Mathematical Formula" icon, the formula editing page will be displayed in response to the triggered formula editing operation.
[0185] J2: Renders the LaTeX fragment as a preview formula on the formula editing page based on the LaTeX fragment typed in the formula editing page.
[0186] As is understandable, user input is in LaTeX format (i.e., LaTeX snippets), and there's no need to use symbols to enter or exit mathematical mode. The input will be rendered instantly with publication-quality typesetting and displayed in the current line position. See the preview formulas below. Figure 21 .
[0187] Optionally, after process J2, a compilation check of the LaTeX fragment is also required to ensure the accuracy of the formulas in terms of syntax and display, and to avoid typesetting errors. Therefore, another embodiment of this application provides a method for checking LaTeX fragments, including processes K1 to K3.
[0188] K1: In the formula editing page, perform a compilation check on the LaTeX fragments entered by the user.
[0189] K2: When a compilation error is detected, display a LaTeX snippet containing the error code.
[0190] See the LaTeX snippet containing the error code. Figure 22 .
[0191] K3: In response to a triggered preview action of a LaTeX fragment containing an error code, convert the LaTeX fragment containing the error code into an error message and display it.
[0192] Understandably, when a user clicks "Preview," in response to the triggered preview operation of the LaTeX fragment containing the error code, the LaTeX fragment containing the error code is converted into an error message and displayed. The error message can be found in [link to error message]. Figure 23 .
[0193] Optionally, in another embodiment of this application, the typesetting and editing operation includes at least the formula editing operation; the specific implementation of step S103 includes processes L1 to L5.
[0194] L1: Displays the image editing page in response to the triggered image editing operation.
[0195] When a user clicks the "Illustration" icon on the editing page, two illustration modes are available: direct upload and import of LaTeX snippets. Both modes support image preview and cross-referencing (see [link]). Figure 24 ).exist Figure 24 In the text, "Upload" corresponds to the direct upload mode, while "Upload with LaTeX" corresponds to the mode of importing via LaTeX fragments.
[0196] L2: In response to the image upload operation triggered on the image editing page, upload the image and display the image preview.
[0197] Among them, see Figure 25 After clicking "Upload Figure," the system will connect to your local disk for image selection. Once an image is selected, you can enter a caption in the "Caption" box. This will then trigger an image upload operation on the image editing page, uploading the image and displaying a preview (see [link to preview interface] for details). Figure 26 ).
[0198] Accordingly, after selecting an image, the user can preview it in a pop-up window; after confirming that everything is correct, clicking "Confirm" will upload the image and insert it at the current cursor position in the writing area (as shown in the image). Figure 27 (As shown). After uploading, users can view this figure through the "Figure" option in the reference area. Note that the system has automatically generated a label "figure_1" for this figure (as shown in the red box) for cross-referencing in documents.
[0199] In addition, users can click the stretch symbol on the image in the writing area to view the original image. See [link / reference] for the specific image effect. Figure 28 .
[0200] It should be noted that directly uploaded images will be inserted at the current cursor position, with their width automatically adapting to the current page's display area and their height adjusted proportionally. If you need to specify the image's position (such as the top of the page, bottom of the page, or the current position) and set the image width, you can do so by uploading a LaTeX snippet.
[0201] L3: In the image editing page, receive image layout parameters and generate LaTeX fragments based on the image layout parameters.
[0202] Specifically, when a user clicks "Upload with LaTeX", they will be taken to another image editing page (see...). Figure 29 On this page, click "Upload Figure" and select an image from your local disk to upload. A preview of the uploaded image can be found here. Figure 30 After confirming the selected image, click "Confirm" to enter the writing area. The system will then receive the image's layout parameters and generate the corresponding LaTeX fragment based on these parameters (see [link to LaTeX documentation]). Figure 31 ). Figure 31 In Chinese, the font color varies depending on the function.
[0203] from Figure 31 The LaTeX snippet shows that the filename is already included in the standard statement (see the yellow box), and the image width is set to 80% of the line width. Users can modify the image display width here and enter captions. After saving, image tags are automatically generated (see...). Figure 32 Click the corresponding image label in the reference area to view the image.
[0204] L4: Render the LaTeX fragment to obtain a preview rendering effect.
[0205] Clicking the "Preview" icon in the upper right corner of the LaTeX snippet allows you to compile and preview the snippet separately. See the preview rendering for details. Figure 33 . Figure 33 It's a two-column display effect.
[0206] L5: In response to the confirmation action of the triggered preview rendering effect, insert the LaTeX fragment into the target article unit to obtain the merged content.
[0207] Optionally, in another embodiment of this application, the typesetting and editing operation includes at least the formula editing operation; the specific implementation of step S103 includes processes M1 to M2.
[0208] M1: In response to a table editing operation triggered on the editing page, display the LaTeX fragment that created the table.
[0209] Additionally, when a user clicks "Create with LaTeX", in response to a table editing operation on the triggered editing page, a LaTeX snippet showing the creation of the table is displayed (see [link]). Figure 34 ).
[0210] M2: Generates and inserts the table into the target article unit based on the table content entered in the LaTeX fragment, resulting in merged content.
[0211] Understandably, after entering the relevant content and figure captions into the LaTeX snippet and saving it, a table will be created, and figure labels will be automatically generated for easy cross-referencing. Hovering the mouse over the corresponding label in the reference area will display the figure's content. See [link to relevant documentation]. Figure 35 .
[0212] J3: In response to the confirmation action of the triggered preview formula, insert the preview formula into the target article unit to obtain the merged content.
[0213] Understandably, once the user confirms, in response to the confirmation action of the triggered preview formula, the preview formula is inserted into the target article unit. The formula displayed in the writing area is a "what you see is what you get" formula, i.e., integrated with the content. For inline mathematical formulas, please refer to [link / reference needed]. Figure 36 .
[0214] S104: Render the merged content using a compilation rendering method to obtain the rendering result.
[0215] Understandably, a unified compilation and rendering method is used to process the merged content and output the rendering results in real time, thereby using LaTeX fragments to accurately compensate for the shortcomings of word processors in formula editing and professional typesetting.
[0216] It should be noted that it can also provide segment preview and full article merge preview, and perform incremental compilation on selected segments (i.e. selected article units), thereby improving compilation efficiency.
[0217] S105: Generate the final document based on all rendering results.
[0218] Understandably, the final document is generated based on all the rendering results, and then exported as LaTeX text and compiled into PDF text.
[0219] In addition, compilation logs can be mapped back to the corresponding chapters to describe errors and fix suggestions in natural language, thereby improving the efficiency of LaTeX syntax debugging.
[0220] In summary, by breaking down a document into multiple independent text units and combining them with LaTeX fragments for typesetting and editing, the limitations of existing WYSIWYG word processors in handling complex typesetting needs are overcome. Through compilation and rendering technology, users can accurately preview and adjust the typesetting effect of each unit, ensuring consistency in the final document format and high-quality output, thus meeting professional typesetting requirements.
[0221] like Figure 37 The diagram shown is an architectural schematic of a text processing device provided in an embodiment of this application. The text processing device includes: a splitting unit 100, a page display unit 200, an editing unit 300, a rendering unit 400, and a generation unit 500.
[0222] Split Unit 100 is used to restructure the document structure into one or more article units; each article unit can be directly triggered.
[0223] Page display unit 200 is used to display the editing page of the target article unit in response to the triggering of the target article unit; the target article unit can be any article unit.
[0224] The editing unit 300 is used to respond to the typesetting and editing operations of the triggered editing page, and to perform typesetting and editing on the target article unit through WYSIWYG editing mode and LaTeX fragments to generate integrated content; the typesetting and editing operations include at least formula editing operations, image editing operations and table editing operations.
[0225] The editing unit 300 is specifically used for: displaying the formula editing page in response to the triggered formula editing operation on the editing page; rendering the LaTeX fragment as a preview formula on the formula editing page based on the LaTeX fragment entered on the formula editing page; and inserting the preview formula into the target article unit in response to the triggered confirmation operation of the preview formula to obtain the merged content.
[0226] The editing unit 300 is specifically used for: displaying the image editing page in response to the triggered image editing operation on the editing page; uploading an image and displaying an image preview in response to the triggered image upload operation on the image editing page; receiving image layout parameters on the image editing page and generating a LaTeX fragment based on the image layout parameters; rendering the LaTeX fragment to obtain a preview rendering effect; and inserting the LaTeX fragment into the target article unit in response to the triggered confirmation operation of the preview rendering effect to obtain the merged content.
[0227] The editing unit 300 is specifically used to: display the LaTeX fragment for creating the table in response to the table editing operation triggered on the editing page; generate and insert the table into the target article unit based on the table content entered in the LaTeX fragment, thereby obtaining the merged content.
[0228] Rendering unit 400 is used to render the merged content using a compile-based rendering method to obtain the rendering result.
[0229] Generation unit 500 is used to generate the final document based on all rendering results.
[0230] In summary, by breaking down a document into multiple independent text units and combining them with LaTeX fragments for typesetting and editing, the limitations of existing WYSIWYG word processors in handling complex typesetting needs are overcome. Through compilation and rendering technology, users can accurately preview and adjust the typesetting effect of each unit, ensuring consistency in the final document format and high-quality output, thus meeting professional typesetting requirements.
[0231] Combination Figure 37 The text processing device also includes, as shown, the following:
[0232] The check unit is used to perform compilation checks on the LaTeX fragments typed by the user in the formula editing page.
[0233] The first display unit is used to display a LaTeX fragment containing the error code when a compilation error is detected.
[0234] The second display unit is used to convert and display the LaTeX fragment containing the error code into an error message in response to a triggered preview operation of the LaTeX fragment containing the error code.
[0235] Combination Figure 37 The text processing device also includes, as shown, the following:
[0236] The third display unit is used to display the table creation page in response to the triggered table creation operation on the editing page.
[0237] The fourth display unit is used to display the table in response to the table formatting operation triggered by the table creation page.
[0238] Combination Figure 37 The text processing device also includes, as shown, the following:
[0239] The fifth display unit is used to display the footnote addition page in response to the triggered footnote addition operation on the editing page.
[0240] The first insertion unit is used to insert footnote content into the target article unit based on the footnote content typed on the footnote addition page.
[0241] Combination Figure 37 The text processing device also includes, as shown, the following:
[0242] The sixth display unit is used to display the code editing page in response to a triggered code insertion operation on the editing page.
[0243] The second insertion unit is used to insert code content into the target article unit based on the code content entered on the code editing page.
[0244] Combination Figure 37 The text processing device also includes, as shown, the following:
[0245] The seventh display unit is used to display the LaTeX fragment creation page in response to the triggered LaTeX fragment creation operation on the editing page.
[0246] The third insertion unit is used to insert the target LaTeX fragment into the target article unit based on the target LaTeX fragment typed on the LaTeX fragment creation page.
[0247] The fragment rendering unit is used to render the target LaTeX fragment in response to the preview operation triggered by the editing page, and to display the rendering effect of the target LaTeX fragment.
[0248] Combination Figure 37 The text processing device also includes, as shown, the following:
[0249] The compilation unit is used to compile the target article unit into a print style in response to a preview operation triggered by the editing page.
[0250] The eighth display unit is used to display the print style in a single-column manner in response to the single-column display operation of the triggered editing page.
[0251] The ninth display unit is used to display the print style in a two-column manner in response to the triggered two-column display operation of the editing page.
[0252] Combination Figure 37 The text processing device also includes, as shown, the following:
[0253] The tenth display unit is used to display the text input page in response to a triggered text input operation on the editing page.
[0254] Create a new cell to create a sub-cell in response to a new text input page.
[0255] Combination Figure 37 The text processing device also includes, as shown, the following:
[0256] The fourth insertion unit is used to insert text content into the target article unit based on the text content typed on the text input page.
[0257] The conversion unit is used to convert text content into an ordered format and display it in response to an ordered list operation triggered on the editing page.
[0258] The eleventh display unit is used to convert text content into an unordered format and display it in response to an unordered list operation triggered by the editing page.
[0259] Combination Figure 37 The text processing device also includes, as shown, the following:
[0260] The twelfth display unit is used to display a block-shaped mathematical formula page in response to a formula input operation triggered on the editing page.
[0261] The fifth insertion unit is used to insert mathematical formulas into the target article unit based on the mathematical formulas entered on the block mathematical formula page.
[0262] Combination Figure 37 The text processing device also includes, as shown, the following:
[0263] The thirteenth display unit is used to display the annotation input page in response to the annotation input operation triggered on the editing page.
[0264] The identifier generation unit is used to generate an annotation identifier based on the text annotation entered on the annotation input page.
[0265] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. In particular, for system or system embodiments, since they are fundamentally similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. Components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0266] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0267] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A text processing method, characterized in that, include: Restructure the document into one or more article units; each article unit can be triggered directly. In response to the triggered target article unit, the editing page of the target article unit is displayed; the target article unit can be any one of the article units. In response to the triggered typesetting and editing operation on the editing page, typesetting and editing of the target article unit are performed using WYSIWYG editing mode and LaTeX fragments to generate integrated content; The fused content is rendered using a compilation rendering method to obtain the rendering result; The final document is generated based on all rendering results.
2. The method according to claim 1, characterized in that, The typesetting and editing operations include at least formula editing operations; The typesetting and editing operation triggered by the editing page, through WYSIWYG editing and LaTeX fragments, performs typesetting and editing on the target article unit to generate integrated content, including: In response to a formula editing operation triggered on the edit page, the formula editing page is displayed; Based on the LaTeX fragment typed on the formula editing page, the LaTeX fragment is rendered as a preview formula on the formula editing page; In response to the confirmation operation of the preview formula, the preview formula is inserted into the target article unit to obtain the fused content.
3. The method according to claim 2, characterized in that, Also includes: On the formula editing page, the LaTeX fragments entered by the user are compiled and checked. When a compilation error is detected, a LaTeX snippet containing the error code is displayed; In response to a triggered preview operation of a LaTeX fragment containing an error code, the LaTeX fragment containing the error code is converted into an error message and displayed.
4. The method according to claim 1, characterized in that, The layout editing operations include at least image editing operations; The typesetting and editing operation triggered by the editing page, through WYSIWYG editing and LaTeX fragments, performs typesetting and editing on the target article unit to generate integrated content, including: In response to an image editing operation triggered on the edit page, the image editing page is displayed; In response to the triggered image upload operation on the image editing page, upload the image and display an image preview; In the image editing page, image layout parameters are received, and LaTeX fragments are generated based on the image layout parameters; The LaTeX fragment is rendered to obtain a preview rendering effect; In response to the confirmation operation of the triggered preview rendering effect, the LaTeX fragment is inserted into the target article unit to obtain the fused content.
5. The method according to claim 1, characterized in that, The layout editing operations include at least table editing operations; The typesetting and editing operation triggered by the editing page, through WYSIWYG editing and LaTeX fragments, performs typesetting and editing on the target article unit to generate integrated content, including: In response to a table editing operation triggered on the aforementioned editing page, the LaTeX fragment for creating the table is displayed; Based on the table content entered in the LaTeX fragment, the table is generated and inserted into the target article unit to obtain the fused content.
6. The method according to claim 1, characterized in that, Also includes: In response to the triggered table creation operation on the edit page, the table creation page is displayed; The table is displayed in response to the table formatting operation triggered on the table creation page.
7. The method according to claim 1, characterized in that, Also includes: In response to the triggered footnote addition operation on the edit page, the footnote addition page is displayed; The footnote content is inserted into the target article unit based on the footnote content typed on the footnote addition page.
8. The method according to claim 1, characterized in that, Also includes: In response to the triggered code insertion operation on the editing page, the code editing page is displayed; The code content is inserted into the target article unit based on the code content entered on the code editing page.
9. The method according to claim 1, characterized in that, Also includes: In response to the triggered LaTeX fragment creation operation on the edit page, the LaTeX fragment creation page is displayed; Based on the target LaTeX fragment typed on the LaTeX fragment creation page, insert the target LaTeX fragment into the target article unit; In response to the preview operation triggered on the editing page, the target LaTeX fragment is rendered and the rendering effect of the target LaTeX fragment is displayed.
10. The method according to claim 1, characterized in that, Also includes: In response to the preview operation triggered on the editing page, the target article unit is compiled into a print style; In response to the triggered single-column display operation of the edit page, the print style is displayed in a single-column manner; In response to the triggered two-column display operation of the editing page, the print style is displayed in a two-column manner.
11. The method according to claim 1, characterized in that, Also includes: In response to a text input operation triggered on the edit page, a text input page is displayed; In response to the triggered new text input page creation operation, a sub-unit is created.
12. The method according to claim 11, characterized in that, Also includes: The text content is inserted into the target article unit based on the text content entered on the text input page; In response to the triggered ordered list operation on the edit page, the text content is converted into an ordered format and displayed; In response to the triggered unordered list operation on the edit page, the text content is converted to an unordered format and displayed.
13. The method according to claim 1, characterized in that, Also includes: In response to a formula input operation triggered on the edit page, a block-shaped mathematical formula page is displayed; The mathematical formula is inserted into the target article unit based on the mathematical formula entered on the block mathematical formula page.
14. The method according to claim 1, characterized in that, Also includes: In response to the triggered comment input operation on the edit page, the comment input page is displayed; An annotation identifier is generated based on the text annotation entered on the annotation input page.
15. A word processing device, characterized in that, include: Split units are used to restructure the document structure into one or more article units; each article unit can be triggered directly. A page display unit is used to display the editing page of a target article unit in response to a triggered target article unit; the target article unit can be any one of the article units. An editing unit is used to respond to the typesetting and editing operation of the triggered editing page, and to perform typesetting and editing on the target article unit through WYSIWYG editing mode and LaTeX fragments to generate fused content; The rendering unit is used to render the fused content using a compile-and-render method to obtain the rendering result; The generation unit is used to generate the final document based on all rendering results.