在org文件中,文件内容如下:
使用org-latex-preview
预览latex代码 $a=1$,但报错:
Creating LaTeX preview… org-compile-file: File “c:/Users/ADMINI~1/AppData/Local/Temp/orgtexLY8mon.dvi” wasn’t produced. Please adjust ‘dvipng’ part of ‘org-preview-latex-process-alist’.
org-preview-latex-process-alist
的值如下:
((dvipng :programs
("latex" "dvipng")
:description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" :image-size-adjust
(1.0 . 1.0)
:latex-compiler
("latex -interaction nonstopmode -output-directory %o %f")
:image-converter
("dvipng -D %D -T tight -o %O %f"))
(dvisvgm :programs
("latex" "dvisvgm")
:description "dvi > svg" :message "you need to install the programs: latex and dvisvgm." :image-input-type "dvi" :image-output-type "svg" :image-size-adjust
(1.7 . 1.5)
:latex-compiler
("latex -interaction nonstopmode -output-directory %o %f")
:image-converter
("dvisvgm %f -n -b min -c %S -o %O"))
(imagemagick :programs
("latex" "convert")
:description "pdf > png" :message "you need to install the programs: latex and imagemagick." :image-input-type "pdf" :image-output-type "png" :image-size-adjust
(1.0 . 1.0)
:latex-compiler
("pdflatex -interaction nonstopmode -output-directory %o %f")
:image-converter
("convert -density %D -trim -antialias %f -quality 100 %O")))
在C:\Users\Administrator\AppData\Local\Temp
中能找到它自行创建的文件orgtexLY8mon.tex
。没有orgtexLY8mon.dvi
文件。但是我可以在终端用latex orgtexLY8mon.tex
编译出orgtexLY8mon.dvi
,再通过dvipng -o orgtexLY8mon.png orgtexLY8mon.dvi
得到png
文件。说明orgtexLY8mon.tex
文件和latex
和dvipng
都是正常的。而且在emacs中,(executable-find "latex")
和(executable-find "dvipng")
都能正确返回值
"c:/texlive/2021/bin/win32/latex.exe"
"c:/texlive/2021/bin/win32/dvipng.exe"
预览时自动创建的orgtexLY8mon.tex
的内容如下:
\documentclass{article}
\usepackage[usenames]{color}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
% Package longtable omitted
% Package wrapfig omitted
% Package rotating omitted
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
% Package capt-of omitted
% Package hyperref omitted
\pagestyle{empty} % do not remove
% The settings below are copied from fullpage.sty
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-3cm}
\setlength{\oddsidemargin}{1.5cm}
\addtolength{\oddsidemargin}{-2.54cm}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-\headheight}
\addtolength{\textheight}{-\headsep}
\addtolength{\textheight}{-\footskip}
\addtolength{\textheight}{-3cm}
\setlength{\topmargin}{1.5cm}
\addtolength{\topmargin}{-2.54cm}
texput.log
的内容:
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/W32TeX) (preloaded format=latex 2021.12.30) 4 JAN 2022 13:08
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**c:/Users/ADMINI~1/AppData/Local/Temp/orgtexLY8mon.tex
! Emergency stop.
<to be read again>
\protect
<*> c:/Users/ADMINI~
1/AppData/Local/Temp/orgtexLY8mon.tex
*** (job aborted, file error in nonstop mode)
Here is how much of TeX's memory you used:
5 strings out of 478995
194 string characters out of 5862232
283032 words of memory out of 5000000
17591 multiletter control sequences out of 15000+600000
403430 words of font info for 27 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
3i,0n,0p,1b,6s stack positions out of 5000i,500n,10000p,200000b,80000s
No pages of output.
有没有哪位大神知道怎么解决?