LaTex2Web logo

Documents Live, a web authoring and publishing system

If you see this, something is wrong

Collapse and expand sections

To get acquainted with the document, the best thing to do is to select the "Collapse all sections" item from the "View" menu. This will leave visible only the titles of the top-level sections.

Clicking on a section title toggles the visibility of the section content. If you have collapsed all of the sections, this will let you discover the document progressively, from the top-level sections to the lower-level ones.

Cross-references and related material

Generally speaking, anything that is blue is clickable.

Clicking on a reference link (like an equation number, for instance) will display the reference as close as possible, without breaking the layout. Clicking on the displayed content or on the reference link hides the content. This is recursive: if the content includes a reference, clicking on it will have the same effect. These "links" are not necessarily numbers, as it is possible in LaTeX2Web to use full text for a reference.

Clicking on a bibliographical reference (i.e., a number within brackets) will display the reference.

Speech bubbles indicate a footnote. Click on the bubble to reveal the footnote (there is no page in a web document, so footnotes are placed inside the text flow). Acronyms work the same way as footnotes, except that you have the acronym instead of the speech bubble.

Discussions

By default, discussions are open in a document. Click on the discussion button below to reveal the discussion thread. However, you must be registered to participate in the discussion.

If a thread has been initialized, you can reply to it. Any modification to any comment, or a reply to it, in the discussion is signified by email to the owner of the document and to the author of the comment.

Publications

The blue button below that says "table of contents" is your tool to navigate in a publication.

The left arrow brings you to the previous document in the publication, and the right one brings you to the next. Both cycle over the publication list.

The middle button that says "table of contents" reveals the publication table of contents. This table is hierarchical structured. It has sections, and sections can be collapsed or expanded. If you are a registered user, you can save the layout of the table of contents.

Table of contents

First published on Saturday, Jan 25, 2025 and last modified on Saturday, Jul 19, 2025

The Inline Editor

François Chaplais

1 Introduction

You can access a document in edit mode in two ways:

  • in the document dashboard, select the Inline edit item in the Action menu for your document
  • from the View page of your document, select the Inline edit item in the View menu

Apart from some initial code, most of this documentation was written interactively using the Inline Editor.

Note: before reading what follows, make sure you have understood the help text about the LaTeX2Web workflow and the internal model.

2 Opening the Inline Editor

After entering the edit mode, the Inline Editer in invoked simpling by clicking anywhere in the document main content (this exludes the front matter and bibliography). Once this is done, you are presented with a dialog that offers you several options. Here is a screenshot.

The initial object selection dialog.
Figure 1. The initial object selection dialog.

The important element is the list (above the buttons) that presents the objects that you can edit starting from here. It is the list of the LaTeX2Web object that contain the object you clicked in. In this example we have successively

  • Paragraph-1: this the paragraph where you clicked
  • Section 2 Opening the Inline Editor; this is the section that contains the paragraph
  • Presenting-the-inline-editor is the document itself.

Below this list is a group of buttons that perform actions of the selected object. In the next section we will concentrate on the Edit action.

Note: if you click on a section title, this will collapse/expand the corresponding section. This functionality is active to let you to organize your work space. To open a section in the Inline Editor, press the alt/option key while clicking on the section title. This will edit the section.

3 Edit

If you click the Edit button, this will open the Inline Editor for the selected object. Here we have opened the editor for this very paragraph. Here is the screenshot.

The editor panes.
Figure 2. The editor panes.

3.1 The editor panes

The editor consists in two stacked panes:

  • On top is a preview corresponding to the code. It has a gray background, unless you are editing a section, which has a slightly different user interface.
  • Below is the code editor for the object.

3.2 The code editor

Th code editor has two parts: on top is the toolbar, and below is the code editor itself. The editor is powered by Ace.

3.2.1 The toolbar

The left part is devoted to the search and replace operations. At its right is a collection of LaTeX-related editing buttons. Finally, at the right, you have the Inline Editor dropdown menu that lets you perform top-level operations related to the Inline Editor.

3.2.1.1 Search and replace

The input field on the left is where you enter the string you are looking for. The search is case-sensitive. To launch the search, click on the magnifier icon next to it. Pressing the enter/return key will not initiate the search. Actually, the keyboard action is first intercepted by the browser which, in this case, will reload the page. Doing so would lose your unsaved changes.

When you have found your first match, hit Ctrl-K (Windows/Linux) or Command-G (Mac) to search for the next occurence.

At the right of the replace field are two search and replace buttons. The first one will do a single search and replace operation. Hitting it repeatedly will repeat the process for the next occurences. The second button performs a global search and replace.

3.2.1.2 LaTeX tools

Here is a quick description of the LaTeX related dropdown menus, as seen in figure 2.

  • This dropdown menu lets you insert a sectioning command. If some text was selected before performing the action, it will be used as the parameter of the sectioning command, i.e., the section title. This is a general behavior (when applicable) of the LaTeX editor actions.
  • This lets you style the selected text.
  • gives you access to some common LaTeX commands.
  • gives you access to some common LaTeX environments.
  • gives access to LaTeX2Web specific commands. The environment action creates an environment whose name is the selected text. For instance, to create a verbatim environment, type verbatim in the editor, select the word, and use the environment action on it.

3.2.1.3 Keyboard shortcuts

Keyboard shortcuts are available in all of LaTeX editors. Make sure you are editing code, or the shortcut may have undesirable results. Most of the shortcuts apply to the selection, if any. Here is a list.

Ctrl/Cmd Minserts \item
Ctrl/Cmd Linserts/makes a label
Ctrl/Cmd Rinserts/makes a reference
Ctrl/Cmd Iapplies italic style
Ctrl/Cmd Bapplies bold style
Ctrl/Cmd Emakes an environment out of the selection

3.2.1.4 Editor help

The question mark reveals help for the editor.

3.2.1.5 The Edit dropdown menu

Below is a snapshot of the Edit menu in context.

The <code>Edit</code> dropdown menu in action.
Figure 3. The Edit dropdown menu in action.

Here are the actions available

  • Render This renders the current code in the top render pane. This lets you preview if the output of your code will be correct.
  • Revert to saved This reset the editor state to the HTML and LaTeX code corresponding to the last save.
  • Close This closes the Inline Editor. You cannot have to editors open at the same time. This will not reload the page. To recover the saved HTML version of the document, just reload the page.
  • Save to model This saves the currently edited object to the model. The next Revert to saved action wil revert to this.
  • Save to model and update HTML This saves the currently edited object to the model and to HTML. This only modifies the part of the document that correspond to the edited objects. The next Revert to saved action wil revert to this.
  • Export model to HTML This exports the saved model to HTML and reloads the page. This is a global export to HTML, you should avoid it on large documents.

3.2.2 The editor

The editor is Ace.

It has a full undo/redo system.

It has an excellent syntax coloring for LaTeX code. We use the Cobalt theme.

You can navigate using the arrow keys.

It is quite helpful with delimiters. For the parentheses, curly braces and bracket delimiters, it will create an open/close pair when typing the opening character. It will enclose the selection (if present) with the chosen delimiter pair. Clicking near an opening delimiter will reveal the scope of it.

It also has a auto-complete feature.

A full list of Ace’s default shorcuts in available in the LaTeX2Web online help.

4 Render

Chosing the Render menu item of the Edit dropdown menu will render the Web version of the current code that is in the editor. This gives you an instant preview of what your code will produce.

Render does not alter your data in any way. It just generates HTML code from the code in the editor and renders it in the top pane of the Inline Editor. Most of the LaTeX2Web functionalities are available in the preview, including reference inclusion, etc....

5 Save and restore

When you are in edit mode, there are two ways to save your work. The first one consists in saving from the Inline Editor itself.

The second one is accessed by selecting the Backup... item from the Edit menu.

5.1 Save and restore from the Inline Editor

5.1.1 Saving

When you are in the Inline Editor, you can save you work from the Edit dropdown menu of the editor. You have two options

  • Save to model save the object that you are editing to the document model.
  • Save to model and update HTML saves your modifications to the model and exports the result to the HTML code of the document.

Both options perform a local update. This means that only the current object is modified in the model, and the updated HTML code replaces only the previous code for the current object.

This also means that use can use the Inline Editor on very large or complex documents without impacting the editor’s performance.

5.1.2 Restoring

At the right of the Inline Editor control panel, you have a Restore... button. Clicking on it enters the restore mode. In this mode, when you click on an element in the left pane, a list of its backups is presented in the right pane.

The backup selection form. Older backups exists, but they are not in the list because they do not contain the selected object.
Figure 4. The backup selection form. Older backups exists, but they are not in the list because they do not contain the selected object.

Once you you have selected a backup, you can do two things:

  1. directly restore the saved version
  2. view the differences between the two versions

The second option will reveal a couple of dual panes that let you compare the saved version with the current one. Here is a screenshot of the diff panes.

This screenshot was taken while editing this very section. 
<br> The top dual panes show the diferences between the versions. <br> Below, you have to editor panes. The left one shows the saved version (its content cannot be saved). The right one is an editor for the current version. It is is full featured editor, except for the render option, which is not offered due to the lack of space.
Figure 5. This screenshot was taken while editing this very section.
The top dual panes show the diferences between the versions.
Below, you have to editor panes. The left one shows the saved version (its content cannot be saved). The right one is an editor for the current version. It is is full featured editor, except for the render option, which is not offered due to the lack of space.

5.2 Use the backup system

5.2.1 Saving

When using the Backup... menu item, you will be prompted for a description of the work that was done between the previous backup and now.

After hitting the Save button, a number of tasks will be executed:

  1. the model will be exported to LaTeX code
  2. the body of the code will be save as a backup file on the server
  3. create a backup in the database of the model in its current state, together with the description and backup timestamp
  4. insert the computed body into the LaTeX source code and save it to the database

As a summary, three kinds of backups are performed: the model is saved, the LaTeX code is saved to a file, and the LaTeX code is saved to the database.

Subsequently, if you compile the document into a web page, the latest backup code will be used. Note that an initial backup is performed when the document is created.

5.2.2 Restoring

You can access your backups by using the Manage backups menu item in the Edit menu. After that, you are presented with list of your backups. For each backup, you can

  • view the backup LaTeX code (which cannot be modified)
  • revert the LaTeX code to the previous version
  • revert both the code and the model to the previous version
  • delete the backup
Backup management
Figure 6. Backup management

Both revert operations restore the LaTeX code. The second one also restores the model, which spare you the work of re-creating the model. This can be useful for large documents for which the import process may be complicated.

Important: the restore operations work globally, by contrast to the restore operation in the Inline Editor, which is limited to the scope of the object being edited.

6 Create, delete objects

6.1 Create objects

You can prepend or append an object to another one.

To initiate an object creation, click on the Insert… button. This will reveal a new pane at the right of the main one.

Once this is done, select an object in the list at the left. This will list in the right pane all the object types that you can append or prepend to the one at the left. Here is a screenshot for the current paragraph.

In the right pane, you see the list of object types that can be inserted. We appended a figure to the paragraph to create this very figure. Then we edited the figure: file name, and caption. All of this was done using the Inline Editor.
Figure 7. In the right pane, you see the list of object types that can be inserted. We appended a figure to the paragraph to create this very figure. Then we edited the figure: file name, and caption. All of this was done using the Inline Editor.

Sometimes, extra info will be requested before creation. For instance, if you want to create a theorem, you will have to select which type of theorem to create, according to the \newtheorem commands found in the preamble. Here is a screenshot.

You are invited to select the kind of theorem that you want to create.
Figure 8. You are invited to select the kind of theorem that you want to create.

6.2 Delete objects

To delete an object, select it in the list and click on the red Delete button. A confirmation dialog will appear. Once the operation is confirmed, the element is deleted from the model and the HTML is updated if possible (see next section about this).

6.3 About HTML update

After creating or deleting an object, in general the HTML code is updated accordingly.

There are actually two situations:

  1. The element was not just below the document in the hierarchy. Then it was the list of elements of the parent object which was updated. Then the HTML code for the parent is generated and it replaces the older code. This is generally safe.
  2. The element is just below the document in the hierarchy. This happens for paragraphs that appear before the first section. This also happens for top-level sections. In this case, the whole document HTML code should be re-generated. This is avoided because it could result in a large processing time that would impede the Inline Editor experience.

7 Cross-references

One of the powerful features of LaTeX (and LaTeX2Web) is its ability to manage cross-references.

But, how can one find the label for a reference when you are in edit mode and it is hidden from view?

Be re-assured that you do not have to look for the label inside your source code.

Before fetching labels interactively, the label fetching must be enabled. This can be done in two ways

  • you are in edit mode and the Inline Editor is open
  • you are viewing the page in ordinary display mode, but, in the status at the bottom of the page, the status bar has the Fetch labels checkbox activated (see below).
The status bar
Figure 9. The status bar

Once this mode is activated, when clicking anywhere in the view, a list of document objects that contain the clicked object will be created, very much like when a list was created before editing an object.

Important: the list will display only objects which can be referenced by some text. This the text that will be displayed as “link” to the reference. For instance, a numbered object can be referenced. A running text paragraph cannot be.

After selection, the browser will put the object reference into the clipboard. Paste the result into a \ref command and you are good to go!

Note that there are two kinds of reference code:

  • objects that have a \label will return the label
  • The other objects will return the ID of the object in the LaTeX2Web system.

In the object list, objects which have a label have a tag emoji 🏷️ next to the object item

Since it is unlikely that a label be modified inside a document, the label response is more robust than the object ID.

Below is a screenshot that shows the object list in this vary section.

A paragraph was clicked in the section while label fetching was enabled. The paragraph itself has no identifier, so it is not listed. The section itself has a label (it is cross-references). Above that is the document itself, which is not referenced by a sign.

Available labels for this section.
Figure 10. Available labels for this section.

Clicking “Select” will copy the label to the cliboard and you will be notified of the operation success.

Notification success with the clipbord content
Figure 11. Notification success with the clipbord content

8 Site-wide cross-references

Actually, when looking for a reference, you are not limited to the current document. You can go to another document view, and thanks to a cookie that say that you are in a label fetching mode, you will be able to fetch labels from another document. Once the reference label or ID is in your clipboard, you can paste it into a \ref{} command inside the editor, and it will work.

Note: if it happens that you cannot fetch labels, check the corresponding box in the status bar at the bottom of the page to enable the fetch label behavior.

9 Document search and edit inside the model

In edit mode, just above the document title, there is a search bar that works a bit differently from usual search. Instead of looking for text in the web page, it looks for content in the document model.

What is returned is a list of matches, each consisting of two lines

  • a breadcrumb that represents the object hierarchy above the match
  • an extract of the text where the match was found, with the match highlighted
Fuzzy search result
Figure 12. Fuzzy search result

The model search is useful when looking for data that is not visible in the web page render. Here are some examples of usages

  • search for a label: the search result will return where the label was found (and it is probably attached to the object itself)
  • search for math content
  • If the text is a parameter of a LaTeX command, the search will find it

Clicking on any segment of the breadcrumb will open an inline editor to the corresponding object.

Inline edit after searching in the model
Figure 13. Inline edit after searching in the model