【问题标题】:fail to preview using auctex and emacs无法使用 auctex 和 emacs 进行预览
【发布时间】:2013-05-30 06:53:53
【问题描述】:

我在 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 文件。如何解决这个问题?谢谢大家。

【问题讨论】:

  • 你需要查看latex的输出。 C-c C-lIIRC。
  • 谢谢,但是当我使用C-c C-l 时,它会提示“没有 TeX 输出缓冲区”。仍然无法预览公式。

标签: emacs latex auctex


【解决方案1】:

我遇到了这个问题,因为我要求在构建完成之前显示 dvi 文件。下面的 elisp 用在一个 bind-keys 函数中,它分配 control-p 来预览乳胶。

("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 文件很小,还是因为它确实有效。

【讨论】:

    【解决方案2】:

    C-c C-p C-p 在 Windows 10 上为我工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多