El editor
Desde la 1.30.0 el editor no trata tu nota como Markdown genérico. Sabe qué es un wikilink, una cita, una etiqueta, una valla de teorema y un shorthand, así que puede completarlos, colorearlos, comprobarlos y saltar entre ellos. Todo corre en tu máquina, sobre tu propio vault, sin red.
Autocompletado
Las sugerencias no aparecen mientras escribes prosa. Se abren en cuanto tecleas un disparador estructural, de modo que el widget está cuando puede ayudar y no estorba cuando no. También puedes pulsar Ctrl+Space para pedir sugerencias.
| Escribes | Obtienes |
|---|---|
[[ | Las notas del vault, con su carpeta. Dos notas con el mismo nombre se insertan como la ruta única más corta ([[fisica/intro]]). [[nota# lista los encabezados de esa nota. Las notas de la carpeta actual van primero. |
[@ | Las entradas de references.bib, con búsqueda por clave, autor, título y año. Cada una muestra algo como “Levin & Peres 2017”, el título y una tarjeta con la revista o editorial. Sigue funcionando después de ; y , @ en [@a; @b, p. 3]. |
@ | Los tipos de referencia (eq:, thm:, etc.) y las notas que contienen entornos referenciables. |
@thm: @def: @eq: … | Las etiquetas de ese tipo: primero las de este archivo, en orden de documento, con número y título (“Teorema 2 · Tiempo de mezcla”), y luego los entornos de otros archivos. Enfoca una y pulsa Ctrl+Space para previsualizar la ecuación dibujada con KaTeX, o la primera línea del entorno. |
@ruta@ | Los tipos disponibles en esa nota; @ruta@def: lista solo las etiquetas de esa nota. |
[^ | Las notas al pie que define este documento, las usadas pero aún sin definir, y el siguiente número libre. |
{# | Una etiqueta única para el encabezado, entorno o figura de la línea, como thm:tiempo-de-mezcla a partir de :::theorem[Tiempo de mezcla]. |
\ | Alrededor de mil comandos LaTeX (ver abajo). |
::: | Los tipos de bloque: theorem, lemma, proof, truth, graph, plot, commdiag, pseudocode, flowchart y el resto. |
--- al inicio | Las claves del frontmatter (title, author, date, abstract, tags, lang, comdtex.texclass, comdtex.citestyle, comdtex.domain) y sus valores. |
:::csv / :::data | Los nombres de tus archivos CSV y, dentro de los primeros paréntesis (datos.csv (), los encabezados de columna de ese archivo. |
val( | Los datasets declarados con :::data{#data:nombre} en la nota, con el archivo que lee cada uno. Sirven nombre, @nombre y data:nombre. |
Aceptar una sugerencia nunca deja un ]] o ] duplicado: al teclear [[ se escribe [[]], y elegir una nota consume los corchetes sobrantes.
La búsqueda es tolerante. Las tildes se ignoran en notas, citas y etiquetas (teoria encuentra Teoría; la ñ sigue siendo su propia letra), los nombres de nota aceptan las palabras en cualquier orden ([[gap spectral encuentra spectral-gap) y los nombres en español encuentran las entradas en inglés: teorema, lema y demostración después de :::, matriz, raíz y fracción para los shorthands. Después de @, una palabra de tipo se completa a su forma corta (@teorema a @thm:, @ecuacion a @eq:), y cualquier otra palabra lista las etiquetas cuyo nombre o título la contiene, así que @mixing ofrece @thm:mixing.
Referencias entre archivos
Solo los entornos (teoremas, lemas, corolarios, proposiciones, definiciones, ejemplos, ejercicios) se pueden citar desde otro archivo, así que solo ellos se ofrecen desde otros archivos. Elegir uno inserta la forma completa, @ruta@thm:nombre, o @[mi carpeta/nota]@thm:nombre cuando la ruta tiene espacios o caracteres especiales. Las ecuaciones, figuras, tablas y secciones de otros archivos no se pueden citar y no se ofrecen. Las etiquetas que escribiste hace un instante aparecen al momento.
Comandos LaTeX
La lista detrás de \ se genera a partir de los comandos que el propio KaTeX dibuja, así que el editor solo sugiere lo que la vista previa puede mostrar. Cada sugerencia muestra el glifo y los marcadores de argumentos (\frac{}{}, \begin{pmatrix}), y tus macros de macros.md van primero. Dentro de matemáticas ($...$, $$...$$) también aparecen sugerencias al teclear una palabra de dos o más letras, sin barra invertida: alpha, alfa o inf ofrecen el símbolo con su barra. También sirve una parte del nombre (\arrow lista \rightarrow, \leftarrow y el resto) y los nombres en español como \alfa, \raiz e \infinito.
Ayuda de firma de shorthands
Al teclear frac(a, aparece frac(num, den) con el argumento actual resaltado. El número de argumentos es el mismo que usa el editor para avisar de una cantidad incorrecta. Dentro de bloques especiales como :::plot se queda callado, porque sqrt(x) ahí es la sintaxis propia del bloque.
Dentro de bloques especiales
Dentro de :::pseudocode, :::flowchart, :::truth, :::graph, :::plot y :::commdiag, las sugerencias cambian a las palabras clave de ese bloque (IF, FOR, AND, edge, range:, etc.) y los shorthands globales se suprimen: sin seguido de Tab dentro de un :::plot se queda en sin(x) y nunca se convierte en \sin.
Enter en una línea de bloque
Pulsar Enter al final de una línea de apertura :::tipo[título] escribe el ::: de cierre por ti, salvo que un ::: posterior ya cierre el bloque. Dentro de un bloque de código el texto se deja exactamente como lo escribiste.
Resaltado de sintaxis
El editor tiene su propia coloración para ComdTeX:
- Las matemáticas (
$...$,$$...$$) tienen colores propios y discretos, sin énfasis ni encabezados sueltos dentro. - Las vallas
:::tipo[título]{#etiqueta}muestran el tipo, el título y la etiqueta en colores distintos. - Los bloques especiales (pseudocódigo, tablas de verdad, grafos, gráficas, diagramas conmutativos) colorean sus palabras clave.
- Las referencias, citas, wikilinks, huecos
{{?}}, marcas de Keep, notas al pie, tareas y el frontmatter se reconocen a simple vista. - El código entre vallas carga el resaltado de JavaScript, TypeScript, Python, shell, YAML y LaTeX a demanda, y los archivos
.textienen una gramática LaTeX.
Los bloques de código de la vista previa también se resaltan, para unos 18 lenguajes comunes, sin conexión.
Ir a la definición y buscar usos
| Haz esto | Sobre | Obtienes |
|---|---|---|
Ctrl+clic o F12 | [[nota]], [[nota#encabezado]], ![[nota]] | Se abre la nota, en el encabezado si lo hay |
Ctrl+clic o F12 | @thm:x, @doc@def:x, @[carpeta/doc]@def:x | Un salto a la etiqueta, en esta nota o en otra |
Ctrl+clic o F12 | [@clave] | references.bib se abre en la entrada |
Shift+F12 | Una etiqueta, una clave de cita o una nota | Todos los usos en el vault, en un vistazo; un resultado en otra nota abre esa nota en la línea |
Los saltos a otra nota entran en el historial de Alt+Left / Alt+Right, y los tramos navegables se subrayan mientras mantienes Ctrl. La misma navegación funciona en archivos .tex: F12 sobre \ref{x} va a la etiqueta, \cite{clave} abre la entrada en references.bib, y se entienden \eqref, \autoref, \cref y los comandos de cita de natbib y biblatex.
Tarjetas al pasar el cursor
Deja el cursor sobre algo y aparece una tarjeta:
- Una cita
[@a; @b, p. 3]muestra una tarjeta por clave. [[nota]]previsualiza la nota, esté abierta o no (solo la sección en[[nota#encabezado]]).@eq:xmuestra el mismo número de ecuación que la vista previa.- Una referencia a un teorema, lema o similar muestra su título, número y primeras líneas, también cuando está en otro archivo.
Avisos y correcciones rápidas
El editor comprueba el documento mientras escribes y marca los problemas en el margen y bajo el texto. Los mensajes siguen el idioma de la interfaz. Avisa de:
- Referencias de todo tipo (
@eq:,@thm:,@lem:,@cor:,@prop:,@def:,@ex:,@exc:,@fig:,@tbl:,@sec:) que no apuntan a nada, incluidas las referencias entre archivos@ruta@def:xcuya nota o etiqueta falta. [[wikilinks]]rotos,[@claves]desconocidas, bloques:::tipodesconocidos e imágenes que no existen (se buscan primero desde la carpeta de la nota, como la vista previa).- Un
$$o:::sin cerrar, un:::suelto, tablas desiguales, shorthands con un número de argumentos incorrecto. - Notas al pie usadas pero nunca definidas, o definidas y nunca usadas, y etiquetas duplicadas.
- LaTeX que KaTeX no puede interpretar en
$...$y$$...$$. Se entienden los shorthands y tus macros, así quefrac(a, b)no es una falsa alarma.
Pulsa Ctrl+. sobre un aviso (o haz clic en la bombilla) para ver una corrección:
- Cerrar un
$$o:::sin cerrar, o quitar un:::suelto. - Crear la nota detrás de un
[[enlace]]roto. Nunca sobrescribe una nota existente y te quedas en el documento que estabas escribiendo. - Añadir un esqueleto BibTeX para una
[@clave]desconocida enreferences.bib. - Normalizar una tabla desigual.
- Rellenar un hueco
{{?}}con la IA (solo cuando el asistente está activado; ver El asistente de IA). - Añadir o quitar los argumentos de un shorthand como
frac(a), añadir una definición de nota al pie que falta, renombrar una etiqueta duplicada. - Elegir una de hasta tres sugerencias de “¿quisiste decir?” para una referencia, clave de cita, nombre de nota, tipo de bloque o ruta entre archivos mal escritos, o reescribir una etiqueta que vive en otra nota a su forma
@ruta@tipo:nombre.
Cada corrección es una edición normal, así que un solo deshacer la revierte.
Ayudas al teclear
$y las comillas invertidas se cierran solas, pero no donde no son matemáticas ni código: “cuesta $5 cada uno” yecho $HOMEconservan un solo$.- Enter continúa listas, tareas, citas y filas de tabla; ver Documentos largos.
Tabexpande shorthands y salta entre los marcadores de los snippets; ver Atajos matemáticos.
Para las teclas en sí, ver Atajos de teclado. Para la caja que se abre con Ctrl+P y Ctrl+Shift+P, ver Paleta de comandos e ir a un archivo.
The editor
Since 1.30.0 the editor does not treat your note as generic Markdown. It knows what a wikilink, a citation, a label, a theorem fence and a shorthand are, so it can complete them, colour them, check them and jump between them. All of it runs on your machine, over your own vault, with no network.
Autocomplete
Suggestions do not pop up while you write prose. They open the moment you type a structural trigger, so the widget is there when it can help and out of the way when it cannot. You can also press Ctrl+Space for suggestions on demand.
| You type | You get |
|---|---|
[[ | Notes of the vault, with their folder shown. Two notes with the same name are inserted as the shortest unique path ([[physics/intro]]). [[note# lists that note’s headings. Notes in the current folder come first. |
[@ | Entries of references.bib, searchable by key, author, title and year. Each shows something like “Levin & Peres 2017”, the title and a card with the journal or publisher. Keeps working after ; and , @ in [@a; @b, p. 3]. |
@ | The reference kinds (eq:, thm:, and so on) and the notes that hold referenceable environments. |
@thm: @def: @eq: … | Labels of that kind: this file first, in document order, with number and title (“Theorem 2 · Mixing time”), then the environments of other files. Focus one and press Ctrl+Space to preview the equation drawn with KaTeX, or the environment’s first line. |
@path@ | The kinds available in that note; @path@def: lists only that note’s labels. |
[^ | The footnotes this document defines, footnotes used but not yet defined, and the next free number. |
{# | A unique label for the heading, environment or figure on the line, such as thm:mixing-time from :::theorem[Mixing time]. |
\ | About a thousand LaTeX commands (see below). |
::: | The block types: theorem, lemma, proof, truth, graph, plot, commdiag, pseudocode, flowchart and the rest. |
--- at the top | Frontmatter keys (title, author, date, abstract, tags, lang, comdtex.texclass, comdtex.citestyle, comdtex.domain) and their values. |
:::csv / :::data | Your CSV file names and, inside the first parentheses (data.csv (), the column headers of that file. |
val( | The datasets declared with :::data{#data:name} in the note, with the file each one reads. name, @name and data:name all work. |
Accepting a suggestion never leaves a doubled ]] or ]: typing [[ writes [[]], and picking a note consumes the extra brackets.
Matching is forgiving. Accents are ignored in notes, citations and labels (teoria finds Teoría; ñ still counts as its own letter), note names accept the words in any order ([[gap spectral finds spectral-gap), and Spanish names find the English entries: teorema, lema and demostración after :::, matriz, raíz and fracción for shorthands. After @, a kind word completes to its short form (@teorema to @thm:, @ecuacion to @eq:), and any other word lists the labels whose name or title contains it, so @mixing offers @thm:mixing.
Cross-file references
Only environments (theorems, lemmas, corollaries, propositions, definitions, examples, exercises) can be cited from another file, so only they are offered from other files. Picking one inserts the full form, @path@thm:name, or @[my folder/note]@thm:name when the path has spaces or special characters. Equations, figures, tables and sections of other files cannot be cited and are not offered. Labels you typed a moment ago appear at once.
LaTeX commands
The list behind \ is generated from the commands KaTeX itself renders, so the editor only suggests what the preview can draw. Each suggestion shows the glyph and the argument placeholders (\frac{}{}, \begin{pmatrix}), and your macros from macros.md come first. Inside math ($...$, $$...$$) suggestions also appear as you type a word of two or more letters, without a backslash: alpha, alfa or inf offer the symbol with its backslash. A part of the name also works (\arrow lists \rightarrow, \leftarrow and the rest), and so do Spanish names such as \alfa, \raiz and \infinito.
Shorthand signature help
Typing frac(a, shows frac(num, den) with the current argument highlighted. The argument counts are the same ones the editor uses to warn about a wrong count. Inside special blocks such as :::plot it stays quiet, because sqrt(x) there is the block’s own syntax.
Inside special blocks
Inside :::pseudocode, :::flowchart, :::truth, :::graph, :::plot and :::commdiag, suggestions switch to that block’s own keywords (IF, FOR, AND, edge, range:, and so on), and global shorthands are suppressed: sin followed by Tab inside a :::plot stays sin(x) and never becomes \sin.
Enter on a block line
Pressing Enter at the end of an opening :::type[title] line writes the closing ::: for you, unless a later ::: already closes the block. Inside a code fence the text is left exactly as typed.
Syntax highlighting
The editor has its own colouring for ComdTeX:
- Math (
$...$,$$...$$) gets quiet colours of its own, with no stray emphasis or headings inside it. :::type[title]{#label}fences show the type, the title and the label in different colours.- Special blocks (pseudocode, truth tables, graphs, plots, commutative diagrams) colour their keywords.
- References, citations, wikilinks,
{{?}}gaps, keep marks, footnotes, tasks and frontmatter are all recognisable. - Fenced code loads JavaScript, TypeScript, Python, shell, YAML and LaTeX highlighting on demand, and
.texfiles have a LaTeX grammar.
Code blocks in the preview are highlighted too, for about 18 common languages, offline.
Go to definition and find usages
| Do this | On | You get |
|---|---|---|
Ctrl+click or F12 | [[note]], [[note#heading]], ![[note]] | The note opens, at the heading when there is one |
Ctrl+click or F12 | @thm:x, @doc@def:x, @[folder/doc]@def:x | A jump to the label, in this note or another |
Ctrl+click or F12 | [@key] | references.bib opens at the entry |
Shift+F12 | A label, a citation key or a note | Every usage across the vault, in a peek; a result in another note opens that note at the line |
Jumps to another note join the Alt+Left / Alt+Right history, and clickable spans are underlined while you hold Ctrl. The same navigation works in .tex files: F12 on \ref{x} goes to the label, \cite{key} opens the entry in references.bib, and \eqref, \autoref, \cref and the natbib and biblatex citation commands are understood.
Hover cards
Rest the cursor on something and a card appears:
- A citation
[@a; @b, p. 3]shows one card per key. [[note]]previews the note, whether or not it is open (just the section for[[note#heading]]).@eq:xshows the same equation number as the preview.- A reference to a theorem, lemma or similar shows its title, number and first lines, also when it lives in another file.
Warnings and quick fixes
The editor checks the document as you write and marks problems in the margin and under the text. The messages follow the interface language. It warns about:
- References of every kind (
@eq:,@thm:,@lem:,@cor:,@prop:,@def:,@ex:,@exc:,@fig:,@tbl:,@sec:) that point at nothing, including cross-file@path@def:xreferences whose note or label is missing. - Broken
[[wikilinks]], unknown[@keys], unknown:::typeblocks, and images that do not exist (looked up from the note’s folder first, like the preview). - Unclosed
$$or:::, a stray:::, ragged tables, shorthands with the wrong number of arguments. - Footnotes that are used but never defined, or defined and never used, and duplicate labels.
- LaTeX that KaTeX cannot parse in
$...$and$$...$$. Shorthands and your macros are understood, sofrac(a, b)is not a false alarm.
Press Ctrl+. on a warning (or click the lightbulb) for a fix:
- Close an unclosed
$$or:::, or remove a stray:::. - Create the note behind a missing
[[link]]. It never overwrites an existing note, and you stay on the document you were writing. - Add a BibTeX stub for an unknown
[@key]toreferences.bib. - Normalize a ragged table.
- Fill a
{{?}}gap with the AI (only when the assistant is on; see The AI assistant). - Add or drop the arguments of a shorthand such as
frac(a), add a missing footnote definition, rename a duplicate label. - Pick one of up to three “did you mean” suggestions for a mistyped reference, citation key, note name, block type or cross-file path, or rewrite a label that lives in another note to its
@path@kind:nameform.
Every fix is an ordinary edit, so one undo reverts it.
Typing helpers
$and backticks close themselves, but not where they are not math or code: “costs $5 each” andecho $HOMEkeep a single$.- Enter continues lists, task items, quotes and table rows; see Long documents.
Tabexpands shorthands and moves between snippet placeholders; see Math shorthands.
For the keys themselves, see Keyboard shortcuts. For the box that opens with Ctrl+P and Ctrl+Shift+P, see Command palette and go to file.