StepUp has built-in conversion from Markdown to PDF (and html) with KaTeX support.
This is simple example.

PDF files created with libreoffice are not reproducible yet. See:
See https://bugs.documentfoundation.org/show_bug.cgi?id=160033
