The thing with Markdown is that it does most of what you need to do with it, until it doesn't, when you can bring Pandoc to bear and put full-on LaTeX in your Markdown and it will render it however you want. I wrote a dissertation this way with inlined Rmarkdown code. It was great.