ComdTeX

Obsidian y Overleaf

Un formato, dos mundos

ComdTeX usa un formato interno mientras editas, llamado CMDX, pero eso nunca es lo que se guarda en disco. Tus archivos siguen siendo .md compatibles con Obsidian o .tex válido para LaTeX, en todo momento. La conversión entre lo que hay en disco y lo que ves en el editor ocurre automáticamente, al abrir y al guardar.

En discoEn el editor de ComdTeX
> [!note] Título (callout de Obsidian):::note[Título]
\begin{theorem}[Nombre] (LaTeX):::theorem[Nombre]
\frac{a}{b} (LaTeX)frac(a, b)
\begin{bmatrix}…\end{bmatrix} (LaTeX)mat(…)

Escribes frac(a, b) porque es más rápido de teclear que \frac{a}{b}, pero al guardar un archivo .tex lo que queda escrito en disco es LaTeX de verdad, no una notación propia de ComdTeX. Al guardar un .md, lo que queda es un callout de Obsidian de verdad. Nada de esto es una capa de compatibilidad aproximada: es una conversión bidireccional completa.

Abre el mismo vault en Obsidian, a la vez

Como los archivos en disco nunca dejan de ser Markdown u Obsidian-compatibles, puedes tener el mismo vault abierto en Obsidian y en ComdTeX al mismo tiempo. Los cambios van y vienen limpiamente: editas un teorema en ComdTeX con la sintaxis :::theorem, lo guardas, y en Obsidian aparece como un callout normal con el tipo de entorno codificado en el título (Theorem: Nombre), así que se puede reconstruir sin ambigüedad la próxima vez que ComdTeX lo abra.

Qué sobrevive al guardar

Al guardar se conserva lo que la nota dice de sí misma:

  • Tablas. Una tabla Markdown con filas se deja exactamente como está, y nada dentro de un bloque de código o de código en línea se trata como tabla.
  • Etiquetas de entornos. Una etiqueta como {#thm:pyth} se escribe de vuelta, así que cada referencia @thm:pyth sigue funcionando.
  • Callouts. Se conserva el marcador de plegado (- o +), y también los tipos de callout para los que ComdTeX no tiene entorno, como danger o quote.

Esos tipos de callout siguen siendo callouts normales en el editor, y un callout que ningún entorno de ComdTeX reproduce exactamente (uno plegado, [!NOTE] en mayúsculas, [!theorem] sin prefijo) se guarda byte por byte como lo escribiste. Un simple > [!tip] Hola no se reescribe como > [!tip] Tip: Hola: el nombre del entorno se escribe en el título solo cuando el tipo de callout por sí solo se reabriría como otro entorno (Theorem: Pyth). El editor no muestra ninguna línea de marca oculta; el texto de versiones anteriores que aún lleve una línea <!--cmdx type=... --> se abre y se guarda correctamente.

Bloques especiales, guardados tal cual

No todo se puede representar como un callout de Obsidian sin perder información. Los bloques propios de ComdTeX (pseudocódigo, diagramas de flujo, tablas de verdad, gráficos Graphviz, funciones, diagramas conmutativos, código, dibujos de Excalidraw) se guardan verbatim: byte por byte, tal cual los escribiste, sin aplanarlos a un callout genérico. Versiones antiguas de ComdTeX sí los aplanaban, y eso corrompía el bloque en silencio al autoguardar; las versiones actuales detectan ese daño al abrir un archivo así y lo recuperan automáticamente cuando el tipo de bloque no es ambiguo.

La política general es que la conversión prefiere preservar antes que reescribir de forma agresiva: si algo no se puede representar limpiamente, ComdTeX deja el texto intacto y lo reporta como advertencia en vez de arriesgarse a perder contenido.

De vuelta a su forma original al guardar

Cada vez que guardas, el archivo vuelve a escribirse en su formato original: un .md sigue siendo .md compatible con Obsidian, un .tex sigue siendo .tex válido. No hay una tercera copia, ni una base de datos intermedia.

Exportar como .tex escribe en el idioma del documento: el lang del frontmatter de la nota cuando lo tiene y, si no, el idioma de la interfaz. Un documento en inglés lleva \usepackage[english]{babel}, Theorem, Lemma, Figure~\ref y Section~\ref; uno en español lleva Teorema, Lema, Figura~\ref y babel en español. Desde la 1.33.0; las versiones anteriores siempre exportaban los nombres en español.

Exportar a otros formatos

Desde el mismo documento puedes exportar a DOCX, Beamer, Reveal.js y Typst usando pandoc (instalado aparte), y también importar documentos existentes (.docx, .odt, .tex, .html, .epub, .rst, .org, entre otros) hacia Markdown, con las imágenes incrustadas extraídas al vault. Antes de exportar, ComdTeX muestra un aviso corto con las funciones que el formato de destino no puede conservar; la exportación sigue adelante. Así, un vault de ComdTeX no es una jaula: es un punto de partida que se mueve hacia Overleaf, hacia una presentación, o hacia el formato de otra persona sin fricción.

Quarto, R Markdown y Jupyter

Los archivos .qmd (Quarto) y .Rmd (R Markdown) aparecen en el árbol de archivos, la búsqueda, el grafo y el escaneo de etiquetas, y se abren como Markdown. También puedes llamar a una nota nueva analysis.qmd o report.Rmd. ComdTeX no los ejecuta: la ejecución de código sigue siendo cosa de Quarto o knitr. Además se guardan exactamente como los abriste. Los bloques de código, las opciones de bloque como #| label: fig-x, los bloques ::: {.callout-note} y el encabezado YAML nunca se reescriben, así que lo que lee Quarto o knitr es lo que escribiste.

Los notebooks de Jupyter (.ipynb) entran por Importar documento, que usa pandoc como las demás importaciones. Las celdas de Markdown se vuelven texto, las celdas de código se vuelven bloques de código, las salidas de texto siguen a su celda, y las salidas de imagen se guardan en una carpeta <nombre>-media junto a la nota nueva. El resultado es una nota .md normal: el notebook en sí no se modifica, y la importación es de un solo sentido (no hay exportación de vuelta a .ipynb).

Obsidian and Overleaf

One format, two worlds

ComdTeX uses an internal format while you edit, called CMDX, but that is never what gets saved to disk. Your files stay .md files compatible with Obsidian, or valid .tex for LaTeX, at all times. The conversion between what is on disk and what you see in the editor happens automatically, on open and on save.

On diskIn the ComdTeX editor
> [!note] Title (Obsidian callout):::note[Title]
\begin{theorem}[Name] (LaTeX):::theorem[Name]
\frac{a}{b} (LaTeX)frac(a, b)
\begin{bmatrix}…\end{bmatrix} (LaTeX)mat(…)

You type frac(a, b) because it is faster than \frac{a}{b}, but when you save a .tex file, what lands on disk is real LaTeX, not a ComdTeX-specific notation. When you save a .md file, what lands on disk is a real Obsidian callout. None of this is an approximate compatibility layer: it is a complete two-way conversion.

Open the same vault in Obsidian, at the same time

Because the files on disk never stop being Markdown or Obsidian-compatible, you can have the same vault open in Obsidian and in ComdTeX at once. Changes round-trip cleanly: you edit a theorem in ComdTeX with :::theorem syntax, save it, and in Obsidian it shows up as a normal callout with the environment type encoded in the title (Theorem: Name), so it can be reconstructed unambiguously the next time ComdTeX opens it.

What survives a save

Saving keeps what a note says about itself:

  • Tables. A Markdown table with rows is left exactly as it is, and nothing inside a code block or inline code is treated as a table.
  • Environment labels. A label such as {#thm:pyth} is written back, so every @thm:pyth reference keeps working.
  • Callouts. The fold marker (- or +) is kept, and so are callout types ComdTeX has no environment for, such as danger or quote.

Those callout types stay ordinary callouts in the editor, and a callout that no ComdTeX environment reproduces exactly (a folded one, [!NOTE] in capitals, [!theorem] without a prefix) is saved byte for byte as you wrote it. A plain > [!tip] Hi is not rewritten as > [!tip] Tip: Hi: the environment name goes into the title only when the callout type alone would reopen as a different environment (Theorem: Pyth). The editor shows no hidden marker line; text from older builds that still carries a <!--cmdx type=... --> line loads and saves correctly.

Special blocks, stored as-is

Not everything can be represented as an Obsidian callout without losing information. ComdTeX-only blocks (pseudocode, flowcharts, truth tables, Graphviz graphs, plots, commutative diagrams, code, Excalidraw drawings) are stored verbatim: byte for byte, exactly as you wrote them, never flattened into a generic callout. Older versions of ComdTeX did flatten them, and that silently corrupted the block on autosave; current versions detect that kind of damage when opening such a file and recover it automatically when the block type is unambiguous.

The general policy is that conversion prefers preservation over aggressive rewriting: when something cannot be represented cleanly, ComdTeX leaves the text intact and reports it as a warning instead of risking lost content.

Back to its original shape on save

Every time you save, the file is written back in its original format: a .md stays .md compatible with Obsidian, a .tex stays valid .tex. There is no third copy, no intermediate database.

Export as .tex writes in the document’s language: the note’s frontmatter lang when it has one, otherwise the interface language. An English document gets \usepackage[english]{babel}, Theorem, Lemma, Figure~\ref and Section~\ref; a Spanish one gets Teorema, Lema, Figura~\ref and Spanish babel. Since 1.33.0; earlier versions always exported Spanish names.

Exporting to other formats

From the same document you can export to DOCX, Beamer, Reveal.js, and Typst using pandoc (installed separately), and you can also import existing documents (.docx, .odt, .tex, .html, .epub, .rst, .org, among others) into Markdown, with embedded images extracted into the vault. Before exporting, ComdTeX shows a short notice listing the features the target format cannot keep; the export still goes ahead. A ComdTeX vault is not a cage: it is a starting point that moves toward Overleaf, toward a presentation, or toward someone else’s format without friction.

Quarto, R Markdown and Jupyter

.qmd (Quarto) and .Rmd (R Markdown) files appear in the file tree, search, the graph and the label scan, and open as Markdown. You can also name a new note analysis.qmd or report.Rmd. ComdTeX does not run them: executing code stays with Quarto or knitr. They are also saved exactly as you opened them. Code chunks, chunk options such as #| label: fig-x, ::: {.callout-note} blocks and the YAML header are never rewritten, so what Quarto or knitr reads is what you wrote.

Jupyter notebooks (.ipynb) come in through Import document, which uses pandoc like the other imports. Markdown cells become text, code cells become fenced code, text outputs follow their cell, and image outputs are saved in a <name>-media folder next to the new note. The result is a regular .md note: the notebook itself is not modified, and the import is one-way (there is no export back to .ipynb).