tctcab https://github.com/rstudio/rmarkdown/issues/646 找到个相关的issue里的两个解决方案,一个是代码块里的tidy 选项,另一个是用latex黑魔法