You could look at Org Mode.
You can write your document in a similar fashion you would with Markdown, but then you can export in many other formats (including exporting to LaTeX and PdfTeX).
https://github.com/bdewey/org-ruby
Perhaps we need more complete implementations but there's nothing preventing anyone from finishing the job.