所含文档的 Auctex 预览

所含文档的 Auctex 预览

我有两个*.tex文档,一个是主要文档,另一个是包含在主要文档中的文档。

主要.tex:

\documentclass{article}
\begin{document}
\section{Hello}
\begin{equation}
  \label{eq:1}
  \frac{1}{9000}
\end{equation}
\include{./stuff}
\end{document}

stuff.tex:

Hallo

\begin{equation}
  \label{eq:2}
  \frac{1}{2}
\end{equation}

This is the second equation \ref{eq:2}

在 Emacs 中打开时如何仅预览第二个?当我尝试生成缓冲区预览 (Cc Cp Cb) 时,出现以下错误:

Running `Preview-LaTeX' on `_region_' with ``pdflatex   "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" "\input" _region_.tex''
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo
aded.

No auxiliary output files.

(./_region_.tex  !name(stuff.tex)  !name(stuff.tex) !offset(-2) 

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.3 H
     allo

Overfull \hbox (20.0pt too wide) in paragraph at lines 3--4
[] 

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.5 \begin{equation}


Overfull \hbox (20.0pt too wide) in paragraph at lines 5--5
[] 

Overfull \hbox (7.40001pt too wide) detected at line 8
[][]

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.10 T
      his is an equation \ref{eq:2}
! Undefined control sequence.
<write> ...ing: Reference `eq:2' on page \thepage 
                                                  \space undefined\on@line .
l.10 This is an equation \ref{eq:2}


LaTeX Warning: Reference `eq:2' on page  undefined on input line 10.


Overfull \hbox (20.0pt too wide) in paragraph at lines 10--11
[]

Overfull \hbox (10.86105pt too wide) in paragraph at lines 10--11
[] 

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.12 $
      \frac{2}{5}$

Overfull \hbox (26.38612pt too wide) in paragraph at lines 12--14
[]$[]$
 !name(stuff.tex) !offset(-15) )
! Emergency stop.
<*> ...review}[2004/11/05]\fi} \input _region_.tex

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on _region_.log.

TeX Output exited as expected with code 1 at Mon Mar  9 21:44:23
LaTeX: LaTeX found no preview images

从主界面生成预览并从终端创建 pdf 效果pdflatex main.tex很好。我已经在 Google 上搜索了一下,可能只是一些非常基本的东西,但找不到缺少的东西。谢谢!

更新 1:

正如 giordano 指出的那样,我必须设置主文件。http://www.gnu.org/software/auctex/manual/auctex/Multifile.html#Multifile

现在,除了引用之外,2 个文件的小示例都可以正常工作,但我正在处理的实际文档尽管具有相同的结构,但却存在其他问题。

主要问题似乎是它无法识别 \end{figure} 命令(Cc Cc 和从终端编译都可以正常工作)。

! LaTeX Error: \begin{figure} on input line 448 ended by \end{document}.
...
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on _region_.log.
...
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 1935
GPL Ghostscript 9.05: Unrecoverable error, exit code 1

Preview-PDF2DSC exited abnormally with code 1 at Tue Mar 10 13:08:59

作为解决方法,我找到了带有 displaymath 选项的预览包来查看方程式。 http://www.gnu.org/software/auctex/manual/preview-latex.pdf

我会把这个问题留到 2-3 天内回答,如果没有其他答案Auctex 越来越疯狂那我就关闭它了。

相关内容