Etiquetas y referencias
ComdTeX numera automáticamente ecuaciones, figuras, tablas, secciones y entornos, y permite referenciarlos desde cualquier parte del documento con la sintaxis @prefijo:nombre. Estas etiquetas también exportan de forma limpia a LaTeX/Overleaf, así que el mismo documento sirve para trabajar en ComdTeX y para compilar en Overleaf sin retocar nada.
Ecuaciones numeradas
Cada bloque $$...$$ se numera secuencialmente; la etiqueta es opcional:
$$
\hat{f}(\xi) = \int_{-\infty}^{\infty} f(x)\, e^{-2\pi i x \xi}\, dx
$$ {#eq:fourier}
Equation @eq:fourier shows that $\hat{f}$ depends linearly on $f$.
@eq:fourier se resuelve como un enlace clicable (1) en la vista previa.
Figuras
Las figuras se numeran igual, con la etiqueta entre llaves después de la imagen:
{#fig:label}
La referencia @fig:label se resuelve como un enlace “Figura N”.
Tablas
Las tablas Markdown también se pueden etiquetar, con la etiqueta en su propia línea justo después de la tabla:
# Introduction {#sec:intro}
See @sec:intro and @tbl:constants for notation.
| Symbol | Meaning |
|---|---|
| $G$ | Group |
| $e$ | Identity |
{#tbl:constants}
Encabezados
Cualquier encabezado se puede etiquetar de la misma forma, colocando {#sec:nombre} al final de la línea del título, como se ve arriba con # Introduction {#sec:intro}.
Tabla de prefijos
| Prefijo | Uso |
|---|---|
sec: | Encabezados |
eq: | Ecuaciones en bloque |
fig: | Figuras |
tbl: | Tablas Markdown |
thm:, lem:, cor:, prop:, def:, ex:, exer: | Entornos tipo teorema |
El panel de Etiquetas
Abre el panel Etiquetas para auditar todo el sistema de referencias del vault de un vistazo: referencias rotas (apuntan a una etiqueta que no existe), etiquetas duplicadas (dos bloques con el mismo nombre) y etiquetas sin usar (definidas pero nunca referenciadas). Es el lugar donde detectar antes de exportar que un @thm:bolzano quedó mal escrito o que una etiqueta se repitió sin querer.
Referencias entre archivos
Los entornos matemáticos (teoremas, lemas, definiciones, etc.) admiten además referencias cruzadas entre archivos distintos del vault, con la forma @documento@prefijo:nombre, usando la ruta relativa al vault sin extensión. Por ejemplo, @gp/calendario@def:valor referencia la definición valor en el archivo gp/calendario.md. Si el archivo o la etiqueta contienen espacios, existe una forma alternativa entre corchetes: @[mi carpeta/mi nota]@def:valor.
Al exportar a LaTeX, una referencia cruzada entre archivos no puede convertirse en un \ref{} real (el entorno de destino vive en otro documento y está ausente de una exportación de un solo archivo), así que ComdTeX la reemplaza por texto plano que nombra el documento de origen, en vez de dejar un \ref que compilaría como ??.
Labels and references
ComdTeX automatically numbers equations, figures, tables, sections, and environments, and lets you reference them from anywhere in the document with the @prefix:name syntax. These labels also export cleanly to LaTeX/Overleaf, so the same document works for editing in ComdTeX and for compiling on Overleaf without touching anything.
Numbered equations
Every $$...$$ block is numbered sequentially; the label is optional:
$$
\hat{f}(\xi) = \int_{-\infty}^{\infty} f(x)\, e^{-2\pi i x \xi}\, dx
$$ {#eq:fourier}
Equation @eq:fourier shows that $\hat{f}$ depends linearly on $f$.
@eq:fourier resolves to a clickable (1) link in the preview.
Figures
Figures are numbered the same way, with the label in braces after the image:
{#fig:label}
The reference @fig:label resolves to a “Figura N” link.
Tables
Markdown tables can be labeled too, with the label on its own line right after the table:
# Introduction {#sec:intro}
See @sec:intro and @tbl:constants for notation.
| Symbol | Meaning |
|---|---|
| $G$ | Group |
| $e$ | Identity |
{#tbl:constants}
Headings
Any heading can be labeled the same way, placing {#sec:name} at the end of the title line, as shown above with # Introduction {#sec:intro}.
Prefix table
| Prefix | Use |
|---|---|
sec: | Headings |
eq: | Display equations |
fig: | Figures |
tbl: | Markdown tables |
thm:, lem:, cor:, prop:, def:, ex:, exer: | Theorem-like environments |
The Labels panel
Open the Labels panel to audit the whole vault’s reference system at a glance: broken references (pointing at a label that does not exist), duplicate labels (two blocks with the same name), and unused labels (defined but never referenced). It is the place to catch a misspelled @thm:bolzano or an accidentally repeated label before you export.
Cross-file references
Math environments (theorems, lemmas, definitions, etc.) also support cross-references between different files in the vault, in the form @document@prefix:name, using the vault-relative path with no extension. For example, @gp/calendario@def:valor references the definition valor in the file gp/calendario.md. If the file or label contains spaces, there is an alternative bracketed form: @[mi carpeta/mi nota]@def:valor.
When exporting to LaTeX, a cross-file reference cannot become a real \ref{}: the target environment lives in another document and is absent from a single-file export, so ComdTeX replaces it with plain text naming the source document, instead of leaving a \ref that would compile as ??.