Explain the problem.
In most cases, when people want a PDF, they don't want it with a transparent background. By default, it seems that pandoc converts Markdown files to PDFs with a transparent background, which is very annoying because
- this should definitely not be the default behaviour (i.e. white background should be the default behaviour, although it should support transparent background too)
- there doesn't seem to be a flag to change this (but maybe I am wrong)
The workaround seems to be this ugly code
cat > /tmp/white-bg.tex <<'EOF'
\usepackage{xcolor}
\pagecolor{white}
EOF
pandoc x.md -o x.pdf -H /tmp/white-bg.tex
Pandoc version?
pandoc 3.9.0.2
OS: Sequoia (Version 15.7.4)
pdfTeX 3.141592653-2.6-1.40.29 (TeX Live 2026) [kpathsea version 6.4.2]
pandoc and basictex were installed with brew
Explain the problem.
In most cases, when people want a PDF, they don't want it with a transparent background. By default, it seems that pandoc converts Markdown files to PDFs with a transparent background, which is very annoying because
The workaround seems to be this ugly code
Pandoc version?
pandoc 3.9.0.2
OS: Sequoia (Version 15.7.4)
pdfTeX 3.141592653-2.6-1.40.29 (TeX Live 2026) [kpathsea version 6.4.2]
pandoc and basictex were installed with brew