org-mode 导出 beamer 时标题无法转换为帧

我今天在使用org-mode导出beamer时,遇到了一个问题。 比如我的org文档为: 图片

当我导出时,选择: 图片 最后生成的beamer样式为:

通过检查生成tex文件中没有\begin{frame} \end{frame}的字段,具体内容如下:

% Created 2023-12-08 五 23:35

% Intended LaTeX compiler: pdflatex

\documentclass[presentation]{beamer}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}

\usepackage{graphicx}

\usepackage{grffile}

\usepackage{longtable}

\usepackage{wrapfig}

\usepackage{rotating}

\usepackage[normalem]{ulem}

\usepackage{amsmath}

\usepackage{textcomp}

\usepackage{amssymb}

\usepackage{capt-of}

\usepackage{hyperref}

\author{Your Name}

\date{Today’s Date}

\title{Presentation Title}

\hypersetup{

pdfauthor={Your Name},

pdftitle={Presentation Title},

pdfkeywords={},

pdfsubject={},

pdfcreator={Emacs 27.1 (Org mode 9.3)},

pdflang={English}}

\begin{document}

\maketitle \tableofcontents

\section{f1}

\label{sec:orga083365}

f1

\section{f2}

\label{sec:orgabe6ed1}

f2

\section{f3}

\label{sec:orgc92f576}

f3

\end{document}

但是依旧没有找到原因,有谁知道原因么?

See: A Beamer example (The Org Manual)

(add-to-list
   'org-latex-classes
   ;; beamer class, for presentations
   ;; https://emacs-fu.blogspot.com/2009/10/writing-presentations-with-org-mode-and.html
   '("beamer"
     "\\documentclass[11pt]{beamer}\n
      \\mode<{{{beamermode}}}>\n
      \\usetheme{{{{beamertheme}}}}\n
      \\usecolortheme{{{{beamercolortheme}}}}\n
      \\beamertemplateballitem\n
      \\setbeameroption{show notes}
      \\usepackage[utf8]{inputenc}\n
      \\usepackage[T1]{fontenc}\n
      \\usepackage{hyperref}\n
      \\usepackage{color}
      \\usepackage{listings}
      \\lstset{numbers=none,language=[ISO]C++,tabsize=4,
  frame=single,
  basicstyle=\\small,
  showspaces=false,showstringspaces=false,
  showtabs=false,
  keywordstyle=\\color{blue}\\bfseries,
  commentstyle=\\color{red},
  }\n
      \\usepackage{verbatim}\n
      \\institute{{{{beamerinstitute}}}}\n
       \\subject{{{{beamersubject}}}}\n"

     ("\\section{%s}" . "\\section*{%s}")

     ("\\begin{frame}[fragile]\\frametitle{%s}"
      "\\end{frame}"
      "\\begin{frame}[fragile]\\frametitle{%s}"
      "\\end{frame}")))

我这边的结果:

beamer有专门export to beamer的(require 'ox-beamer)后再看看

Beamer 有专门的 ox-beamer

我的 snippets 配置

# -*- mode: snippet -*-
# name: beamer
# key: beamer
# --

#+startup: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [bigger]
#+AUTHOR: ${1:colawithsauce}
#+BEAMER_HEADER: \institute{${2:xxx}}
#+OPTIONS: H:2 toc:nil num:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+BEAMER_THEME: CambridgeUS
#+BEAMER_COLOR_THEME: default
#+BEAMER_INNER_THEME: default
#+LaTeX_CLASS_OPTIONS: [aspectratio=169]
#+BEAMER_HEADER: \definecolor{links}{HTML}{0000A0}
#+BEAMER_HEADER: \hypersetup{colorlinks=,linkcolor=,urlcolor=links}
#+BEAMER_HEADER: \setbeamertemplate{itemize items}[default]
#+BEAMER_HEADER: \setbeamertemplate{enumerate items}[default]
#+BEAMER_HEADER: \setbeamertemplate{items}[default]
#+BEAMER_HEADER: \setbeamercolor*{local structure}{fg=darkred}
#+BEAMER_HEADER: \setbeamercolor{section in toc}{fg=darkred}
#+BEAMER_HEADER: \setlength{\parskip}{\smallskipamount}
#+BEAMER_HEADER: \AtBeginSection{\frame{\sectionpage}}
#+COLUMNS: %40ITEM %10BEAMER_env(Env) %9BEAMER_envargs(Env Args) %4BEAMER_col(Col) %10BEAMER_extra(Extra)
$0

一个我10月份做的课程论文阅读报告的例子

不用关注内容::PROPERTIES::ID: e111b5ee-9304-42f6-be7b-aa8cb92d7023:ROAM_REFS: @roma - Pastebin.com

其它资源

Hope it helps

1 个赞

发现上面的配置是无法显示中文的,如果需要显示中文,还需要再补上下面这段 snippet:

#+LATEX_COMPILER: xelatex
#+LATEX_HEADER: \usepackage{xeCJK}
#+LATEX_HEADER: \setCJKmainfont{LXGW WenKai}
#+LATEX_HEADER: \setmainfont{LXGW WenKai}

当然,你还需要安装有 LXGW WenKai 字体或者将上面的 LXGW WenKai 改成你喜欢的其它中文字体。同时你还需要安装有 xetex