今天发现一个包 org-tree-slide,可以用 org-mode 做幻灯片……于是折腾了一番🤣
感觉还不错,下面是我的配置
(use-package org-tree-slide
:straight t
:after org
:commands (+org-slide-start +org-slides-stop)
:config
(defun +org-slide-start ()
(interactive)
(when (eq major-mode 'org-mode)
;; hide emephasis marks
(setq org-hide-emphasis-markers t)
;; restart emacs to apply new settings above
(org-mode-restart)
;; set faces for better presentation
(set-face-attribute 'org-meta-line nil :foreground (face-attribute 'default :background))
(set-face-attribute 'org-tree-slide-header-overlay-face nil :foreground (face-attribute 'default :background))
(set-face-attribute 'org-block-begin-line nil :background (face-attribute 'default :background))
(set-face-attribute 'org-block-end-line nil :background (face-attribute 'default :background))
(set-face-attribute 'org-block-begin-line nil :foreground (face-attribute 'default :background))
(set-face-attribute 'org-block-end-line nil :foreground (face-attribute 'default :background))
(set-face-attribute 'org-quote nil :foreground (face-attribute 'default :foreground))
;; render biiiiiig latex fomulars
;; (make-variable-buffer-local 'org-format-latex-options)
(setq-local org-format-latex-options (copy-sequence org-format-latex-options))
(plist-put org-format-latex-options :scale 3.0)
(org-latex-preview '(16))
;; the following settings must be set after restarting org-mode
(setq-local header-line-format nil
mode-line-format nil
line-spacing 10)
(+hide-tab-bar)
(text-scale-increase 3)
(visual-line-mode)
(show-paren-local-mode -1)
(hl-line-mode -1)
(org-tree-slide-mode)
))
(defun +org-slide-stop ()
(interactive)
(when (eq major-mode 'org-mode)
;; reset
(setq org-hide-emphasis-markers nil)
(set-face-attribute 'org-meta-line nil :foreground nil)
(set-face-attribute 'org-tree-slide-header-overlay-face nil :foreground nil)
(set-face-attribute 'org-block-begin-line nil :background nil)
(set-face-attribute 'org-block-end-line nil :background nil)
(set-face-attribute 'org-block-begin-line nil :foreground nil)
(set-face-attribute 'org-block-end-line nil :foreground nil)
(set-face-attribute 'org-quote nil :foreground nil)
(+show-tab-bar)
;; remove local settings
(kill-local-variable 'org-format-latex-options)
(org-tree-slide-mode -1)
;; `org-mode-restart' will clear all local variables,
;; so there is no need to reset them manually
(org-mode-restart)
;; remove biiiiiig latex formulars
(org-latex-preview '(64))
)
)
(setq org-tree-slide-heading-emphasis t
org-tree-slide-content-margin-top 1
org-tree-slide-slide-in-effect nil)
)
(defun +hide-tab-bar ()
(interactive)
(setq tab-bar-format nil))
(defun +show-tab-bar ()
(interactive)
(setq tab-bar-format <<填入你原来的tab-bar内容>>)
(tab-bar--update-tab-bar-lines))
然后就可以用 +org-slide-start
和 +org-slide-stop
开始和停止演示了……
上面的 org-tree-slide-slide-in-effect
这个变量可以选择演示的时候是否需要动画,开了的话会有一个飞入的动画……
默认用 C-<
和 C->
切换。
因为我希望演示的时候也能进行简单编辑,所以我没有隐藏光标,你也可以设置 face 让它隐藏,并且打开 read-only-mode
,这样会更好看?
下面是用这个包的 README.org
作例子:
感觉没啥用,为什么要折腾这个?
在一些不是很正式的场合可以用这个,比如日常的组会,和组员的小会 etc.