If you see this, something is wrong
First published on Friday, Jul 25, 2025 and last modified on Thursday, Aug 20, 2026 by François Chaplais.
Documents Live provides an online editor for your source code that is based on the Ace editor . Most of the interface of the code editor is the same in all editors available in Documents Live: source code editor, inline editor and discussion editor.
The source code editor can be accessed for you document in two ways:
After that, you will be re-directed to a dedicated page to edit your code. Here is a screenshot.
The blue button at the right of the toolbar has only one function: save your code.
The left part is devoted to the search and replace operations. At its right is a collection of LaTeX-related editing buttons.
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.
You can initiate four types of searches:
When you have found your first match, hit Ctrl-K (Windows/Linux) or Command-G (Mac) to search for the next occurrence.
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 occurrences. The second button performs a global search and replace.
Here is a quick description of the LaTeX related dropdown menus, as seen in figure 1.
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.
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 M |
inserts \item
|
| Ctrl/Cmd L | inserts/makes a label |
| Ctrl/Cmd R | inserts/makes a reference |
| Ctrl/Cmd I | applies italic style |
| Ctrl/Cmd B | applies bold style |
| Ctrl/Cmd E | makes an environment out of the selection |
| Ctrl/Cmd shift C | inserts/make a caption |
The question mark reveals help for the editor.
Documents Live provides two special LaTeX commands that can be incorporated in your code for global modification of your code.
The first one is \alias. here is the syntax:
\alias{original}{replacement}
This command is very powerful. It replaces any occurence of original in the source code by replacement.
The second one is \regAlias. It has the same syntax as \alias, but executes a regular expression search and replace with the pattern original.
Both commands are executed at import time, which means they do not alter the source code. If you are unhappy with the result, modify or delete the commands in the code.
The editor’s search/replace box doesn’t just look for plain text — it understands LaTeX commands and their arguments. Type a command name in the search box (e.g. textbf) and, optionally, what to put instead in the replace box (e.g. emph): every matching command in your selection (or the whole document, if nothing is selected) gets swapped in one pass.
Leaving the replace box empty is a special, very common case: it removes the command but keeps the text that was inside it.
textbf or \textbf (the backslash is optional, it’s added for you if you forget it).
emph or \emph. Same rule: the backslash is optional.
The one thing to keep in mind, and the source of most surprises: the replace box is not a template that reuses the text you’re replacing. Whatever you type in the replace box is what ends up in the document, verbatim — the original command’s own arguments are discarded unless you retype them yourself. See the pitfall in the examples below.
If you only write a command name (no {...} or [...] after it), the search matches every occurrence of that command, no matter what’s inside its arguments.
If you add {...} or [...] after the command name in the search box, you’re asking for an exact match: only commands whose argument is exactly that text will be touched. This also means an empty {} in the search box is not a wildcard — it only matches a command whose argument is truly empty, not "any argument."
Matching is also case-sensitive: searching for textbf will not touch \TextBf.
| Search |
textbf
|
| Replace | (empty) |
| Before |
Hello \textbf{World} and \textbf{Foo}
|
| After |
Hello World and Foo
|
Leaving replace empty strips the command and its braces away and keeps the text that was inside — this is the standard way to "undo" a formatting command everywhere in a document.
| Search |
textbf
|
| Replace |
emph
|
| Before |
Hello \textbf{World} and \textbf{Foo}
|
| After |
Hello \emph and \emph
|
⚠️ Pitfall: "World" and "Foo" have vanished. Since the replace box didn’t include a {...} of its own, the tool has nothing to put the original text into, and drops it. If you want to keep the wrapped text, you need to write
it out yourself — see example 6.
| Search |
emph
|
| Replace |
textbf{fixed text}
|
| Before |
\emph{hi}
|
| After |
\textbf{fixed text}
|
Whatever text you put inside the replace box’s own {...} is what shows up — here, "hi" is discarded and "fixed text" appears instead, because that’s what was typed in the replace box, not because it was somehow derived from "hi".
| Search |
textbf{Warning}
|
| Replace |
emph
|
| Before |
\textbf{Warning}: careful. \textbf{Note}: ok.
|
| After |
\emph: careful. \textbf{Note}: ok.
|
Because the search box specified {Warning}, only the \textbf{Warning} occurrence was touched. \textbf{Note} was left alone because "Note" isn’t an exact match for "Warning".
{} mean "empty", not "anything"| Search |
textbf{}
|
| Replace |
emph
|
| Before |
\textbf{} and \textbf{World}
|
| After |
\emph and \textbf{World}
|
\textbf{} (a genuinely empty argument) matched, but \textbf{World} didn’t — {} in the search box asks for an empty value, not "match anything here". To match regardless of content, don’t write any braces at all in the search box (compare with example 2).
| Search |
ref{Intro}
|
| Replace |
autoref{Intro}
|
| Before |
\ref{Intro} text \ref{Methods} text
|
| After |
\autoref{Intro} text \ref{Methods} text
|
To rename a command and keep a specific piece of text, put that exact text in both boxes. Only the occurrence that matches the search box’s exact value is changed — \ref{Methods} is untouched. Run the tool again with ref{Methods} / autoref{Methods} to handle that one too. There’s no way to say "keep whatever was inside" for varying text — each distinct value needs its own search/replace pass.
| Search |
ref
|
| Replace |
autoref
|
| Before |
\ref{Intro} text \ref{Methods} text
|
| After |
\autoref {text} \autoref {text}
|
Both occurrences were replaced in a single click — but, as in example 2, their labels were dropped because the replace box didn’t repeat them.
[...]) follow the same rule| Search |
includegraphics
|
| Replace |
includegraphics[width=10cm]
|
| Before |
\includegraphics[width=5cm]{img.png}
|
| After |
\includegraphics[width=10cm]
|
The filename, {img.png}, is gone — the replace box only defined the [width=...] part, not a {...} part, so the mandatory argument had nowhere to go. To keep the filename, write out the full replacement including it: includegraphics[width=10cm]{img.png}.
| Search | (empty) |
| Replace |
anything
|
| Before |
\emph{hi}
|
| After |
\emph{hi} (unchanged)
|
With nothing to search for, no command is ever matched, so the document comes back exactly as it went in — the replace box is simply never used.
If you select some text before running the search/replace, only that selection is scanned and only that part of the document is changed — useful for restricting a rename to one paragraph or section. If nothing is selected, the whole document is scanned and updated.
{...}/[...] → matches only occurrences whose argument is exactly that text (case-sensitive; empty braces mean "empty", not "any value").
Here is a screenshot of the Editor menu (in the menu bar).
Basics pops up a modal with a recap of the basic shortkeys for the Editor
Editor shortcuts brings you to the help page that lists the default shortcuts of the Ace editor
Save just saves the source
Export saved source downloads the body of the last save as a .tex text file.
Compile compiles the document, i.e. import followed by export. This brings you to the web page view.
Inline edit brings you to the Inline Editor for this document without processing the code further.
Document view brings you to the web page view for this document without processing the code further.
Your document list brings you to the dashboard with the document underlined in the list, which is helpful if you have a long list of documents.
If your document is not very long, we advise you to do the following:
Then: