You should look at pandoc (at least if I understood your question correctly). It can convert several formats (tex, pdf, word, reStructuredText), and also supports extended versions of the markdown syntax to handle more complex problems (for example, inserting header information in html).
With it, you can mix markdown and LaTeX, and then compile html, tex and pdf. You can also include bibtex links from an external file.
Some examples (from markdowns to latex and html):
pandoc -f markdown -t latex infile.txt -o outfile.tex pandoc -f markdown -t html infile.txt -o outfile.html
To add your own LaTex template, going from markdown to PDF, and a bibliography:
pandoc input.text --template=FILE --bibliography refs.bib -o outfile.pdf
This is a truly flexible and amazing program, and I use it a lot.
fileunderwater
source share