Skip to content

Instantly share code, notes, and snippets.

@adamcrosby
Created January 27, 2023 21:05
Show Gist options
  • Save adamcrosby/9fd610f1af4fcbd08819a914b07084f9 to your computer and use it in GitHub Desktop.
Save adamcrosby/9fd610f1af4fcbd08819a914b07084f9 to your computer and use it in GitHub Desktop.
Pandoc MD to PDF/DOCX docker oneliner

podman run --rm --volume "$(pwd):/data" --userns keep-id --user $(id -u):$(id -g) pandoc/latex readme.md -o outfile.pdf

--volume "$(pwd):/data" maps the current directory $(pwd) to the /data volume in the running container.

--userns keep-id --user $(id -u):$(id -g)is a rootless Podman specific user namespace mapping fix, so the output file can be written to the primary filesystem.

pandoc/latex is the dockerhub image of pandoc with the pdf2latex toolset installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment