Atajos matemáticos
ComdTeX incluye un catálogo de unas 76 abreviaturas de texto que se expanden a LaTeX cuando presionas Tab. Funcionan tanto dentro de $...$ como en texto normal, donde se envuelven automáticamente al renderizar. También admiten anidamiento: frac(sqrt(x), abs(y-1)) se expande a \frac{\sqrt{x}}{\left|y-1\right|}.
Cómo funcionan
Escribe el nombre del atajo con sus argumentos entre paréntesis y presiona Tab. El editor lo convierte en un snippet de Monaco con marcadores de posición: Tab de nuevo te mueve al siguiente argumento. Al renderizar, el mismo texto se convierte en LaTeX real antes de pasar por KaTeX.
Operaciones
| Atajo | Resultado |
|---|---|
frac(1, n+1) | \frac{1}{n+1} |
sqrt(x) | \sqrt{x} |
root(n, x) | \sqrt[n]{x} |
abs(x) | \left|x\right| |
norm(v) | \left||v\right|| |
ceil(x) | \lceil x\rceil |
floor(x) | \lfloor x\rfloor |
Sumas, integrales, límites
| Atajo | Resultado |
|---|---|
sum(i=0, n) | \sum_{i=0}^{n} |
int(a, b) | \int_{a}^{b} |
lim(x, 0) | \lim_{x \to 0} |
der(f, x) | \frac{df}{dx} |
pder(f, x) | \frac{\partial f}{\partial x} |
Álgebra y decoradores
| Atajo | Resultado |
|---|---|
vec(v) | \vec{v} |
hat(x) | \hat{x} |
bar(x) | \overline{x} |
tilde(x) | \tilde{x} |
dot(x) | \dot{x} |
ddot(x) | \ddot{x} |
inv(A) | A^{-1} |
trans(A) | A^{\top} |
sup(x, n) | x^{n} |
sub(x, n) | x_{n} |
Fuentes
| Atajo | Resultado |
|---|---|
bb(R) | \mathbb{R} |
cal(A) | \mathcal{A} |
bf(x) | \mathbf{x} |
Matrices
| Atajo | Resultado |
|---|---|
mat(1,0,0,1) | matriz con corchetes ([ ]), forma automática |
matf(2,3, a,b,c, d,e,f) | matriz fija de 2×3 con corchetes |
pmat(1,0,0,1) | matriz con paréntesis (( )) |
table(Col1, Col2) | fila de encabezado para una tabla Markdown |
Anidamiento
Los atajos se pueden combinar entre sí. Por ejemplo:
frac(sqrt(x), abs(y-1))
se expande a:
\frac{\sqrt{x}}{\left|y-1\right|}
Dentro y fuera de $...$
Si escribes un atajo dentro de una fórmula entre $...$, se expande a LaTeX puro sin envoltura adicional. Si lo escribes como texto normal, fuera de cualquier delimitador matemático, ComdTeX lo envuelve automáticamente en $...$ al renderizar, así que no necesitas abrir la fórmula tú mismo para usarlos.
Añadir un atajo nuevo
Si contribuyes al proyecto, un atajo nuevo toca cinco archivos a la vez: el manejador de renderizado, la entrada de autocompletado de Monaco, la entrada en la barra de menú, la fila correspondiente en el panel de ayuda y las etiquetas en ambos idiomas de la interfaz. Omitir alguno deja el editor y el renderizador desincronizados.
Math shorthands
ComdTeX ships a catalog of about 76 text shorthands that expand to LaTeX when you press Tab. They work both inside $...$ and in plain text, where they are auto-wrapped on render. They also support nesting: frac(sqrt(x), abs(y-1)) expands to \frac{\sqrt{x}}{\left|y-1\right|}.
How they work
Type the shorthand name with its arguments in parentheses and press Tab. The editor turns it into a Monaco snippet with placeholders: pressing Tab again moves you to the next argument. On render, the same text is converted to real LaTeX before it reaches KaTeX.
Operations
| Shorthand | Result |
|---|---|
frac(1, n+1) | \frac{1}{n+1} |
sqrt(x) | \sqrt{x} |
root(n, x) | \sqrt[n]{x} |
abs(x) | \left|x\right| |
norm(v) | \left||v\right|| |
ceil(x) | \lceil x\rceil |
floor(x) | \lfloor x\rfloor |
Sums, integrals, limits
| Shorthand | Result |
|---|---|
sum(i=0, n) | \sum_{i=0}^{n} |
int(a, b) | \int_{a}^{b} |
lim(x, 0) | \lim_{x \to 0} |
der(f, x) | \frac{df}{dx} |
pder(f, x) | \frac{\partial f}{\partial x} |
Algebra and decorators
| Shorthand | Result |
|---|---|
vec(v) | \vec{v} |
hat(x) | \hat{x} |
bar(x) | \overline{x} |
tilde(x) | \tilde{x} |
dot(x) | \dot{x} |
ddot(x) | \ddot{x} |
inv(A) | A^{-1} |
trans(A) | A^{\top} |
sup(x, n) | x^{n} |
sub(x, n) | x_{n} |
Fonts
| Shorthand | Result |
|---|---|
bb(R) | \mathbb{R} |
cal(A) | \mathcal{A} |
bf(x) | \mathbf{x} |
Matrices
| Shorthand | Result |
|---|---|
mat(1,0,0,1) | auto-shaped bracket matrix ([ ]) |
matf(2,3, a,b,c, d,e,f) | fixed 2×3 bracket matrix |
pmat(1,0,0,1) | parenthesis matrix (( )) |
table(Col1, Col2) | Markdown table header row |
Nesting
Shorthands can be combined with each other. For example:
frac(sqrt(x), abs(y-1))
expands to:
\frac{\sqrt{x}}{\left|y-1\right|}
Inside and outside $...$
If you type a shorthand inside a formula between $...$, it expands to plain LaTeX with no extra wrapping. If you type it as regular text, outside any math delimiter, ComdTeX automatically wraps it in $...$ when rendering, so you do not need to open the formula yourself to use them.
Adding a new shorthand
If you contribute to the project, a new shorthand touches five files at once: the render-side handler, the Monaco completion entry, the entry in the menu bar, the corresponding row in the help panel, and the labels in both UI languages. Skipping any of them leaves the editor and the renderer out of sync.