Diagramas y dibujos
ComdTeX trae los diagramas adentro del editor: bloques ::: que se escriben como texto, se numeran solos y se renderizan en la vista previa. Desde la versión 1.21 también llegan renderizados a tus exportes: el PDF muestra el diagrama, no su código.
Los bloques visuales
| Bloque | Sintaxis | Qué renderiza |
|---|---|---|
| Flujo | :::flowchart | Diagramas Mermaid (flujos, secuencias) |
| Grafo | :::graph | Graphviz/DOT |
| Gráfica | :::plot | Funciones matemáticas en SVG |
| Diagrama conmutativo | :::commdiag | Estilo tikz-cd |
| Tabla de verdad | :::truth | Evaluada y tabulada automáticamente |
| Dibujo | :::excalidraw | Un editor de dibujo a mano alzada, local, incluido |
| Pseudocódigo | :::pseudocode | Algoritmo numerado |
Cada bloque acepta un nombre opcional y se numera por tipo, como los teoremas:
:::graph[Dependencias]
a -> b
b -> c
:::
:::truth[Contrapositiva]
p implies q
(not q) implies (not p)
:::
Excalidraw, local
El bloque :::excalidraw abre un editor de dibujo a mano alzada completo dentro de ComdTeX. El dibujo se guarda como parte de tu archivo (la escena viaja con la nota, sin servicios externos) y se renderiza en la vista previa. Como todo en ComdTeX, funciona sin internet.
Tablas de verdad evaluadas
Escribe expresiones booleanas, una por línea, y ComdTeX genera la tabla completa: variables detectadas, todas las combinaciones, resultado por columna. Operadores: and, or, not, implies, iff.
En los exportes
Desde la versión 1.21, los bloques visuales se rasterizan a imágenes reales en cada camino de exporte:
- Compilar PDF y la reconstrucción automática al guardar: el PDF muestra los diagramas.
- Exportar PDF (vía pandoc): igual.
- Exportar como .tex: las imágenes se guardan junto al archivo (
nombre-diag-1.png); si subes a Overleaf, sube el.texy los PNG juntos. - Las tablas de verdad se exportan como tablas reales, no como imágenes.
- El pseudocódigo y los bloques de código se exportan como código, a propósito.
Un límite honesto: el motor LaTeX incluido (WASM) no puede leer archivos de imagen del disco. Un documento con diagramas se compila primero con un motor local (tectonic, xelatex o pdflatex, si alguno está instalado); si no hay ninguno, el motor WASM compila con los diagramas degradados a código con su título, legibles aunque no visuales.
Guardado seguro
Los bloques visuales se almacenan textualmente en tu .md o .tex: guardar y reabrir nunca los aplana ni los pierde, y el archivo sigue siendo legible en cualquier otro editor.
Diagrams and drawings
ComdTeX brings diagrams inside the editor: ::: blocks written as text, auto-numbered, rendered in the preview. Since version 1.21 they also reach your exports rendered: the PDF shows the diagram, not its source.
The visual blocks
| Block | Syntax | What it renders |
|---|---|---|
| Flowchart | :::flowchart | Mermaid diagrams (flows, sequences) |
| Graph | :::graph | Graphviz/DOT |
| Plot | :::plot | Mathematical functions as SVG |
| Commutative diagram | :::commdiag | tikz-cd style |
| Truth table | :::truth | Evaluated and tabulated automatically |
| Drawing | :::excalidraw | A full freehand drawing editor, local, built in |
| Pseudocode | :::pseudocode | Numbered algorithm |
Every block takes an optional name and numbers itself per type, like theorems:
:::graph[Dependencies]
a -> b
b -> c
:::
:::truth[Contrapositive]
p implies q
(not q) implies (not p)
:::
Excalidraw, local
The :::excalidraw block opens a full freehand drawing editor inside ComdTeX. The drawing is stored as part of your file (the scene travels with the note, no external services) and renders in the preview. Like everything in ComdTeX, it works offline.
Evaluated truth tables
Write boolean expressions, one per line, and ComdTeX generates the whole table: detected variables, every combination, one result column each. Operators: and, or, not, implies, iff.
In exports
Since version 1.21, visual blocks rasterize to real images on every export path:
- Compile PDF and the automatic rebuild on save: the PDF shows the diagrams.
- Export PDF (via pandoc): same.
- Export as .tex: images are saved beside the file (
name-diag-1.png); when uploading to Overleaf, upload the.texand the PNGs together. - Truth tables export as real tables, not images.
- Pseudocode and code blocks export as code, on purpose.
One honest limit: the bundled LaTeX engine (WASM) cannot read image files from disk. A document with diagrams compiles first through a local engine (tectonic, xelatex or pdflatex, if any is installed); with none available, the WASM engine compiles with the diagrams degraded to captioned code, readable even if not visual.
Safe storage
Visual blocks are stored verbatim in your .md or .tex: saving and reopening never flattens or loses them, and the file stays readable in any other editor.