I'm trying to write python code that can convert an rmd file to html. Rmd was not listed as one of the built in formats for pypandoc, so I tried to use regular markdown for the format parameter.
output = pypandoc.convert_file(
f"{file_path}/{file}", 'html', format = 'markdown', outputfile= f"{file_path}/{file}.html", encoding = 'utf-8')
But I get the error that it could not be converted "[WARNING] Could not convert TeX math site."
Is there another way to convert the file without changing the TeX math?
It depends on the style of TeX math content used in the Rmd file, but if you used dollar signs, something like this should work
You can find examples for other styles (e.g. single backslash) here: https://pandoc.org/MANUAL.html#extension-tex_math_single_backslash
Also, you can take a look at https://pypi.org/project/knitpy/ which is a port of
knitrfor Python, as there are elements of RMarkdown which won't be recognized by pandoc.