Emacs,org,beamer - 没有类“beamer”的定义;在“org-export-latex-classes”中

发布于 2024-11-23 21:57:03 字数 545 浏览 1 评论 0原文

我正在遵循这个 教程,并且收到此错误,当我尝试将演示文稿导出到乳胶时:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

別甾虛僞 2024-11-30 21:57:03

我发现我必须运行 Mx org-beamer-export-to-pdf 才能使其正常工作。

I found I had to run M-x org-beamer-export-to-pdf to get it to work.

不甘平庸 2024-11-30 21:57:03

是的,您应该在 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

零度℉ 2024-11-30 21:57:03

编辑:更新 2022 年并使可重复性更加简单

原始答案如下,自 2011 年以来未曾更改。我仍然认为在 2022 年没有必要获得最高支持的答案和接受的答案,并且 org-mode 在不了解基础知识的情况下很难进行故障排除:

  • .emacs 和其他配置文件
  • exact< /em> .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 lP,而不是p(常规乳胶pdf)。我不记得很久以前的 org-mode 就知道 p 是否在给定 #+latex_class: beamer 设置的情况下工作过。

编辑 2 正如 ceochronos 在评论中指出的那样,我的答案可能总是错误的,因为我在导出选项中遗漏了小写 L Cc Ce pCc Ce l p。再说一遍,Cc Ce 是一个交互式菜单,没有 p 选项,所以希望它不会扰乱太多人的头脑。这些年!


已接受的答案不再是必要的。有一个用于 Beamer 导出的内置功能。有关详细信息,请参阅本教程。本质上,只需将以下内容放在组织文件的顶部(在任何标题之前):

#+startup: beamer
#+LaTeX_CLASS: beamer
#+BEAMER_FRAME_LEVEL: 2

第一个选项引入一些特定于 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
  • the exact .org file used

In 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:

  • a min-config (with no custom org-latex-classes definition for beamer as the accepted answer suggests
  • a modified beamer_test.org that exports for me using the min-config; some minor tweaks were necessary
  • the pdf and org file with _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 issues

Hopefully 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 and P for the final option (beamer pdf), not p (regular latex pdf). I don't remember org-mode that far back to know if p 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 options C-c C-e p vs. C-c C-e l p. Then again, C-c C-e is an interactive menu with no p 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):

#+startup: beamer
#+LaTeX_CLASS: beamer
#+BEAMER_FRAME_LEVEL: 2

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.

美人骨 2024-11-30 21:57:03

在我首先使用 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文