我有以下文件,其中我使用preview
包和beamer
类
\documentclass[]{beamer}
\usepackage{preview}
\PreviewEnvironment{align*}
\PreviewEnvironment*{frame}
\begin{document}
\begin{frame}
Some text and
\begin{align*}
x &= y\\
\beta &= \gamma
\end{align*}
a displayed equation.
\end{frame}
\end{document}
如果我要求生成预览,XEmacs
一切都很好,
但是当生成 PDF 时...
$ pdflatex beamer+previev.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.15 ...
LaTeX2e <2014/05/01> ...
Document Class: beamer 2013/12/02 3.33 ...
(./beamer+previev.aux) ...
(/usr/local/share/texmf/tex/latex/preview/preview.sty) ...
...
! Undefined control sequence.
\@EveryShipout@Output ...EveryShipout@Org@Shipout
\box \@cclv
l.16 \end{frame}
Overfull \vbox (200.87663pt too high) has occurred while \output is active
! Undefined control sequence.
\@EveryShipout@Output ...EveryShipout@Org@Shipout
\box \@cclv
l.17 \end{document}
Overfull \vbox (200.87663pt too high) has occurred while \output is active
! Undefined control sequence.
\@EveryShipout@Output ...EveryShipout@Org@Shipout
\box \@cclv
l.17 \end{document}
! Undefined control sequence.
\@EveryShipout@Output ...EveryShipout@Org@Shipout
\box \@cclv
l.17 \end{document}
Overfull \vbox (200.87663pt too high) has occurred while \output is active
LaTeX Font Warning: Size substitutions with differences
(Font) up to 1.0pt have occurred.
)
(see the transcript file for additional information)
...
$
顺便说一句,如果我删除这些行
\usepackage{preview}
\PreviewEnvironment{align*}
\PreviewEnvironment*{frame}
我可以毫无问题地编译 PDF,但当我要求在缓冲区中生成内联预览时,XEmacs
我只收到警告
LaTeX found no preview images
在迷你缓冲区中,没有插入图像。
有什么咒语可以帮助我和解beamer
并preview
改善生活方式?
事实上,我今天早上刚刚安装了preview.sty
所有相关的东西auctex
,版本是auctex-11.88
,虽然beamer
有点旧,但我在两年(或三年?)前使用 11.87 时也遇到了同样的错误行为,一切都很好,所以这可能是一种倒退,我不知道在路障的哪一边......
答案1
当我试图回答的时候一条评论经过乔达诺我想我在我在 AUCTeX 邮件列表中发起的一个主题几乎正好是一年前,所以我搜索了那个旧帖子并引用了其中的一些部分,结果,惊喜!我注意到这个帖子在 7 个月后的 11 月由 Nicolas Richard 重新发布,他对问题的原因提出了假设,后来诊断出导致pgf
问题的确切补丁,还找到了另一个修复该问题的补丁……
忠于 SX 的口头禅,链接不是好的答案,我会在这里报告链接内容(正确的补丁是由于Esseger
)
与上一个错误 (315) 一样,这是由于预览补丁错误造成的。为了使预览与 everyshi 兼容,pfgutil-latex.def 中的 hack 是:
% Preview hack: preview.sty hacks into \shipout (which is ok), but
% does not honour everyshi.sty (which is not ok). This causes
% everyshi material to get lost.
\AtBeginDocument{
\@ifpackageloaded{preview}{%
% Ok, package loaded. Swap definitions of everyshi.sty's shipout
% and preview.sty's shipout:
\let\pgf@temp\pr@shipout% This is the original shipout
\let\pr@shipout\@EveryShipout@Shipout%
\let\@EveryShipout@Org@Shipout\pgf@temp%
}{}%
}
此补丁有两个问题:
- 如果预览已加载但未处于活动状态,则无法工作(请参阅错误 315)
- 它没有正确设置 \shipout。事实上,预览必须取消常规页面的发货,因此它将 \shipout 设置为“不执行任何操作”的花哨版本。但everyshi 再次将 \shipout 设置为一些不平凡的东西,因此常规页面再次输出,导致页面过多。因此,补丁应该再次清空 \shipout。
这是一个正确的补丁:
\AtBeginDocument{
\@ifpackageloaded{preview}{%
% Ok, package loaded. Swap definitions of everyshi.sty's shipout
% and preview.sty's shipout:
\ifPreview
\let\shipout\@EveryShipout@Org@Shipout%This is the null version of \shipout, created by preview and saved by everyshi
\let\@EveryShipout@Org@Shipout\pr@shipout% This is the original shipout
\let\pr@shipout\@EveryShipout@Shipout%
\fi
}{}%
}
还有什么?我应用了补丁pgfutil-latex.def
,至少对于我的示例来说,一切正常...