Emacs,org,beamer - 没有类“beamer”的定义;在“org-export-latex-classes”中
我正在遵循这个 教程,并且收到此错误,当我尝试将演示文稿导出到乳胶时:
No definition for class `beamer' in `org-export-latex-classes'
注意:
我从 Ubuntu 中的存储库安装了 emacs。以下是我的系统中可用的相关软件包:
emacs-snapshot
emacs-snapshot-bin-common
emacs-snapshot-common
emacsen-common
latex-beamer
latex-xcolor
preview-latex-style
texlive-latex-base
texlive-latex-extra
texlive-latex-recommended
我缺少什么吗?我还需要配置其他东西吗?
I am following this tutorial, and I am getting this error, when I try to export the presentation to latex:
No definition for class `beamer' in `org-export-latex-classes'
Note:
I installed emacs from the repository in Ubuntu. And following are the related packages that are available in my system:
emacs-snapshot
emacs-snapshot-bin-common
emacs-snapshot-common
emacsen-common
latex-beamer
latex-xcolor
preview-latex-style
texlive-latex-base
texlive-latex-extra
texlive-latex-recommended
Am I missing anything? Do I have to configure other things?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我发现我必须运行 Mx org-beamer-export-to-pdf 才能使其正常工作。
I found I had to run
M-x org-beamer-export-to-pdf
to get it to work.是的,您应该在 org-latex-export-classes 中定义 beamer 类。如何定义的示例在此 博客中帖子
Yes., you should define beamer class in org-latex-export-classes. an example how to define is in this blog post
编辑:更新 2022 年并使可重复性更加简单
原始答案如下,自 2011 年以来未曾更改。我仍然认为在 2022 年没有必要获得最高支持的答案和接受的答案,并且 org-mode 在不了解基础知识的情况下很难进行故障排除:
.emacs
和其他配置文件.org
文件用于尝试重新创建 引用了 worg 教程,我认为它不再按原样工作。请注意,该手册现在引用了一个不同的示例。
无论如何,这里是我使用以下内容创建的 一个 github 存储库,以帮助任何其他人找到this:
min-config
(没有针对beamer的自定义org-latex-classes
定义,因为接受的答案建议beamer_test.org
使用以下方式为我导出min-config
;需要_ref
的 pdf 和 org 文件进行一些小的调整,当用户导出时,他们可以比较生成的 pdf 和 tex 文件(下载的存储库中的内容将被覆盖)到这些参考文献以研究差异并更好地识别问题希望这可以更好地消除在这个问题上遇到的任何困惑。
最后一点:我相信我下面的答案可能总是错误的,或者在某些时候变得错误。过去10年,因为最终选项(beamer pdf)应该是
Cc Ce l
和P
,而不是p
(常规乳胶pdf)。我不记得很久以前的 org-mode 就知道p
是否在给定#+latex_class: beamer
设置的情况下工作过。编辑 2 正如 ceochronos 在评论中指出的那样,我的答案可能总是错误的,因为我在导出选项中遗漏了小写
L
Cc Ce p
与Cc Ce l p
。再说一遍,Cc Ce
是一个交互式菜单,没有p
选项,所以希望它不会扰乱太多人的头脑。这些年!已接受的答案不再是必要的。有一个用于 Beamer 导出的内置功能。有关详细信息,请参阅本教程。本质上,只需将以下内容放在组织文件的顶部(在任何标题之前):
第一个选项引入一些特定于 Beamer 的选项,第二个选项确保导出到 LaTeX 使用 Beamer 类,第三个选项意味着顶级标题是部分,第二个选项级别是幻灯片。对于每个顶级标题都是幻灯片,将值更改为 1。
然后使用
Cc Ce p
导出。Edit: updating for 2022 and to make reproducibility more straightforward
The original answer is below, untouched since ~2011. I still think the top upvoted answer and accepted answer aren't necessary in 2022, and org-mode is notoriously hard to troubleshoot without walking through fundamentals:
.emacs
and other config files.org
file usedIn trying to recreate the worg tutorial cited, I think it no longer works as-is. Note that the manual cites a different example now.
In any case, here is a github repo I created with the following to help any others who find this:
min-config
(with no customorg-latex-classes
definition for beamer as the accepted answer suggestsbeamer_test.org
that exports for me using themin-config
; some minor tweaks were necessary_ref
in the name; when users export, they can compare their generated pdf and tex files (the ones in the downloaded repo will be overwritten) to these references to study differences and better identify issuesHopefully this better removes confusion for any stumbling on this question.
Final note: I believe my answer below was potentially wrong always, or became wrong at some point in the past 10yrs, as it should be
C-c C-e l
andP
for the final option (beamer pdf), notp
(regular latex pdf). I don't remember org-mode that far back to know ifp
ever worked given the#+latex_class: beamer
setting or not.Edit 2 as ceochronos points out in the comments, my answer was probably always wrong anyway, as I left out the lower case
L
in the export optionsC-c C-e p
vs.C-c C-e l p
. Then again,C-c C-e
is an interactive menu with nop
option, so hopefully it didn't mess with the minds of too many folks over the years!The accepted answer shouldn't be necessary anymore. There is a built in function for Beamer export. See this tutorial for details. In essence, just put the following at the top of an org file (before any headlines):
First option brings in some beamer specific options, second makes sure export to LaTeX uses the beamer class, third option means top level headlines are sections, second levels are slides. Change value to 1 for just every top headline being a slide.
Then export with
C-c C-e p
.在我首先使用 org-beamer-export-to-latex 导出到 TeX 文件后,仅导出到 PDF 才有效
Only exporting to PDF worked after I've exported to a TeX file first with
org-beamer-export-to-latex