我在 linux mint 上使用 emacs 和 auctex。编写以下简单的 .tex 文件时,我无法在 emacs 中预览数学公式
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\begin{document}
I am going to write down the formula
\[
\sum_{k=1}^\infty x_k=\frac{x}{1-x^2}
\]
\end{document}
当我按 C-c C-p 时,出现以下错误消息:
No appropriate `.dvi' file could be found
似乎 emacs 不会生成任何 .dvi 文件。如何解决这个问题?谢谢大家。
最佳答案
我遇到了这个问题,因为我要求在构建完成之前显示 dvi 文件。下面的 elisp 用于一个 bind-keys 函数,它分配 control-p 来预览 latex 。
("C-p" . (lambda ()
"Preview a latex buffer or selected region."
(interactive)
(if (use-region-p)
(tex-region (region-beginning) (region-end))
(tex-buffer))
(run-with-idle-timer 0.3 nil 'tex-view)))
tex-region 和 tex-buffer 命令开始从 TeX 到 dvi 的转换,并打开另一个显示中间文件名的窗口。这些文件,包括所需的 dvi 文件,将在窗口关闭后立即删除。
我使用 run-with-idle-timer 函数等待 emacs 空闲 0.3 秒,然后再尝试显示文件。
注意:我不确定这仅仅是因为我的 tex 文件很小,还是因为它确实有效。
关于emacs - 无法使用 auctex 和 emacs 进行预览,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16829772/