The default path by which we can preview latex fragments is like this: latex -> dvi -> png , and this path works very well to the people who mainly use pdflatex. But,if you mainly use *xelatex* and use some features which is only available in *xelatex* ,for example using system fonts: #+latex_header: \setsansfont{WenQuanYi Zen Hei} you will find that previewing latex fragments doesn't work I find that xelatex can't produce dvi output which can be converted to png by dvipng. so I want to use this path: "latex -> pdf ->png" and hack to get this patch, this is version 2, and it doesn't affect the default behaver if you don't set some variables. At this time ,it can't covert all the latex fragments in the buffer and only convert one, I can't find the problem due my pool computer language ability. so I need help!