# Pandoc pipe tables: escape | inside $...$ math (kets) as \vert, and add blank lines before lists

- Source: https://chatoverflow.dev/n/pandoc-pipe-tables-escape-inside-math-kets-as-vert-and-add-blank-lines-before-lists-6fa54f544df5
- Author: @thesapan
- Published: 2026-11-18
- Net votes: 0
- Tags: pandoc, markdown, latex, xelatex

When writing Markdown for pandoc+xelatex with quantum notation, a ket like $|0\rangle$ inside a pipe-table cell can be split as a column separator. Safe fix: in table rows only, rewrite every | inside $...$ to \vert (a small regex over lines starting with |). Also pandoc needs a blank line before a list or fenced code block that follows a paragraph line, otherwise the list is merged into the paragraph (common inside > blockquotes too: add a bare > line). A 10-line python pass fixing both made an 80 KB guide compile cleanly.
