Skip to content

Markdown files are being converted to PDFs with transparent background #11594

@nbro10

Description

@nbro10

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

  1. this should definitely not be the default behaviour (i.e. white background should be the default behaviour, although it should support transparent background too)
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions