DEV Community

zuka3
zuka3

Posted on

What You Can't Write on Dev.to — Math Notation Limits and Alternatives

Dev.to's KaTeX support handles most mathematical notation well. But if you're writing about certain topics, you'll hit walls that no workaround can fully solve.

This article documents the specific limitations, who they affect, and what your options are.

Limitation 1: Commutative Diagrams

What you want to write

In algebra and category theory, commutative diagrams are essential. In LaTeX:

\begin{tikzcd}
A \arrow[r, "f"] \arrow[d, "g"'] & B \arrow[d, "\phi"] \\
C \arrow[r, "\psi"'] & D
\end{tikzcd}
Enter fullscreen mode Exit fullscreen mode

This produces a diagram with labeled arrows showing that different paths between the same endpoints yield the same result.

On Dev.to

Not supported. Neither tikz-cd nor the simpler amscd environment works.

Workarounds

  1. ASCII art — works for simple diagrams:
A ---f--→ B
|         |
g         φ
↓         ↓
C ---ψ--→ D
Enter fullscreen mode Exit fullscreen mode
  1. External tools — generate an image and embed it:

    • quiver — interactive commutative diagram editor
    • Export as SVG/PNG → upload to Dev.to
  2. Describe in words — "The diagram commutes, meaning ψg=ϕf\psi \circ g = \phi \circ f "

None of these are great. ASCII breaks with complex diagrams. Images can't be edited inline. Words are imprecise.

Limitation 2: Theorem/Proof Environments

What you want

\begin{theorem}[Cantor's Diagonal Argument]
The set $\mathbb{R}$ is uncountable.
\end{theorem}

\begin{proof}
...
\end{proof}
Enter fullscreen mode Exit fullscreen mode

LaTeX auto-formats this with numbering, consistent styling, and QED marks.

On Dev.to

Not supported. As covered in the previous article, you can approximate with blockquotes and <details>, but you lose:

  • Automatic numbering
  • Cross-references ("by Theorem 2.3")
  • Consistent styling
  • Auto QED marks

For a single article, manual numbering is manageable. For a series of 10+ articles with dozens of theorems referencing each other, it becomes a maintenance burden.

Limitation 3: Custom Macros

What you want

\newcommand{\R}{\mathbb{R}}
\newcommand{\norm}[1]{\left\| #1 \right\|}
\newcommand{\inner}[2]{\left\langle #1, #2 \right\rangle}

% Then use: $\norm{x} \in \R$
Enter fullscreen mode Exit fullscreen mode

On Dev.to

Not supported. Every occurrence must be written in full:

{% katex inline %} \left\| x \right\| \in \mathbb{R} {% endkatex %}
Enter fullscreen mode Exit fullscreen mode

This is especially painful for articles with heavy notation. An article about functional analysis might use R\mathbb{R} fifty times.

Limitation 4: Algorithm Pseudocode with Math

What you want

\begin{algorithmic}[1]
\Require $a, b \in \mathbb{Z}_{>0}$
\While{$b \neq 0$}
    \State $r \gets a \bmod b$
    \State $a \gets b$, $b \gets r$
\EndWhile
\State \Return $a$
\end{algorithmic}
Enter fullscreen mode Exit fullscreen mode

On Dev.to

Code blocks don't render math. You have to choose:

  • Code block — no math rendering:
Input: a, b ∈ Z (positive integers)
while b ≠ 0 do
    r ← a mod b
    a ← b, b ← r
return a
Enter fullscreen mode Exit fullscreen mode
  • Math block — no code formatting, no line numbers

You can't mix both naturally.

Limitation 5: tikz Drawings

What you want

Graph theory graphs, automata, neural network diagrams, geometric figures — anything drawn with tikz.

On Dev.to

Not supported. Mermaid diagrams cover flowcharts and sequence diagrams, but not mathematical graphs where vertex positioning matters.

Who Is Affected?

For most technical articles, these limitations don't matter:

Content type Affected?
Algorithm analysis (Big-O, recurrences) ❌ No — KaTeX is fine
ML/statistics formulas ❌ No — KaTeX is fine
Basic proofs ❌ No — blockquotes work
Category theory ✅ Yes — needs commutative diagrams
Algebraic topology ✅ Yes — exact sequences, spectral sequences
Textbook-style content ✅ Yes — needs theorem numbering and cross-references
Graph theory ✅ Yes — needs graph drawings

Alternatives

If you're hitting these limitations regularly, here are your options:

1. Embed images

Generate diagrams locally (LaTeX → PDF → PNG) and embed them. High friction — every edit requires regenerating images.

2. Use a LaTeX-native platform

I ran into these exact limitations writing a series on group theory. After fighting with ASCII diagrams and manual numbering for too long, I moved my math-heavy articles to Folio, which renders full LaTeX including tikz-cd, theorem environments, and \newcommand.

I still write general programming articles on Dev.to — it's great for that. But for content where the math is the point, a LaTeX-native platform saves significant time.

3. Overleaf + PDF

Write in Overleaf, export PDF, and link to it. You lose the web-native reading experience, but get full LaTeX power.

Summary

Feature Dev.to Full LaTeX
Basic equations ✅ KaTeX
Aligned equations aligned align
Matrices
Commutative diagrams ✅ tikz-cd
Theorem environments
Custom macros
tikz drawings
Auto-numbering

Dev.to is excellent for technical articles with some math. For articles where advanced math notation is central, you'll need to decide between workarounds and alternative platforms.

Top comments (0)