Skip to content
Snippets Groups Projects
Commit 8de5b498 authored by Michael Hauspie's avatar Michael Hauspie
Browse files

Add configuration for org-present

parent c371bfe0
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,8 @@ Then add package repositories ...@@ -66,7 +66,8 @@ Then add package repositories
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'package) (require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) ; (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/") t)
(unless (fboundp 'package-activate-all) (package-initialize)) (unless (fboundp 'package-activate-all) (package-initialize))
#+END_SRC #+END_SRC
...@@ -314,12 +315,20 @@ Select the font I will use depending on the system ...@@ -314,12 +315,20 @@ Select the font I will use depending on the system
#+begin_src emacs-lisp #+begin_src emacs-lisp
(if (eq system-type 'darwin) (if (eq system-type 'darwin)
; Font on MacOS ; Font on MacOS
(setq mh-font "Fira Code-13") (progn
(setq mh-font-fixed "Fira Code")
(setq mh-font-variable "Marianne")
)
; Font on Other Systems (Linux actually, I do not use emacs on windows) ; Font on Other Systems (Linux actually, I do not use emacs on windows)
(setq mh-font "DejaVu Sans Mono-12") (progn
(setq mh-font-fixed "DejaVu Sans Mono")
(setq mh-font-variable "DejaVu Sans")
)
) )
(set-face-attribute 'default t :font mh-font ) (set-face-attribute 'default nil :font mh-font-fixed :weight 'light :height 160)
(set-frame-font mh-font nil t) (set-face-attribute 'fixed-pitch nil :font mh-font-fixed :weight 'light :height 160)
(set-face-attribute 'variable-pitch nil :font mh-font-variable :weight 'light :height 1.3)
(set-frame-font mh-font-fixed nil t)
#+end_src #+end_src
** Modeline ** Modeline
...@@ -570,19 +579,103 @@ Use bullets instead of asterisks ...@@ -570,19 +579,103 @@ Use bullets instead of asterisks
#+end_src #+end_src
** Tree slide ** Presentation using org mode
Tree slide displays an org file as /slides/ Following [[https://www.youtube.com/watch?v=SCPoF1PTZpI][this]] presentation, I start using =org-present= to make slides using =org-mode= and combine
it with =visual-fill-column= to enhance the visual look of the presentation.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package org-tree-slide
:bind (:map org-mode-map ;; so that org-* face attributes are available
("<f8>" . 'org-tree-slide-mode) (require 'org-faces)
;; What to do when starting/ending a presentation
(defun my/org-present-start ()
(visual-fill-column-mode 1)
(visual-line-mode 1)
(display-line-numbers-mode 0)
;; Hide emphasis markers on formatted text
(setq org-hide-emphasis-markers t)
;; Resize Org headings
(dolist (face '((org-level-1 . 1.2)
(org-level-2 . 1.1)
(org-level-3 . 1.05)
(org-level-4 . 1.0)
(org-level-5 . 1.1)
(org-level-6 . 1.1)
(org-level-7 . 1.1)
(org-level-8 . 1.1)))
(set-face-attribute (car face) nil :font mh-font-variable :weight 'medium :height (cdr face)))
;; Make the document title a bit bigger
(set-face-attribute 'org-document-title nil :font mh-font-variable :weight 'bold :height 1.3)
;; Make sure certain org faces use the fixed-pitch face when variable-pitch-mode is on
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch)
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
(set-face-attribute 'org-formula nil :inherit 'fixed-pitch)
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
;; Tweak font sizes
(setq-local face-remapping-alist '((default (:height 1.5) variable-pitch)
(header-line (:height 4.0) variable-pitch)
(org-document-title (:height 1.75) org-document-title)
(org-code (:height 1.55) org-code)
(org-verbatim (:height 1.55) org-verbatim)
(org-block (:height 1.25) org-block)
(org-block-begin-line (:height 0.7) org-block)))
;; Set a blank line at top of the frame
(setq header-line-mode t)
(setq header-line-format " ")
) )
(defun my/org-present-end ()
(visual-fill-column-mode 0)
(visual-line-mode 0)
(display-line-numbers-mode 1)
;; Reset font customizations
(setq-local face-remapping-alist nil)
;; Show emphasis markers on formatted text
(setq org-hide-emphasis-markers nil)
;; Restore Org headings
(dolist (face '((org-level-1 . 1)
(org-level-2 . 1)
(org-level-3 . 1)
(org-level-4 . 1)
(org-level-5 . 1)
(org-level-6 . 1)
(org-level-7 . 1)
(org-level-8 . 1)))
(set-face-attribute (car face) nil :font mh-font-fixed :weight 'medium :height (cdr face)))
;; Remove the blank line at top of the frame
(setq header-line-format nil)
(setq header-line-mode nil)
) )
#+end_src
(use-package org-present
:hook (
(org-present-mode . my/org-present-start)
(org-present-mode-quit . my/org-present-end)
)
)
(use-package visual-fill-column
:custom
(visual-fill-column-width 110)
(visual-fill-column-center-text t)
)
#+end_src
** Export configuration ** Export configuration
I use =org-mode= to export to LaTeX, (beamer and article) markdown and to HTML I use =org-mode= to export to LaTeX, (beamer and article) markdown and to HTML
...@@ -1176,7 +1269,6 @@ This will print emacs start time as well as the count of GC calls ...@@ -1176,7 +1269,6 @@ This will print emacs start time as well as the count of GC calls
(use-package esup (use-package esup
:ensure t :ensure t
;; To use MELPA Stable use ":pin mepla-stable", ;; To use MELPA Stable use ":pin mepla-stable",
:pin melpa
:commands (esup)) :commands (esup))
#+end_src #+end_src
...@@ -1206,3 +1298,5 @@ like an instrument/. ...@@ -1206,3 +1298,5 @@ like an instrument/.
A [[https://blog.d46.us/advanced-emacs-startup/][guide]] on how to speed up emacs starting time A [[https://blog.d46.us/advanced-emacs-startup/][guide]] on how to speed up emacs starting time
A great [[https://www.youtube.com/watch?v=SCPoF1PTZpI][video]] on =org-present= and how to tweak emacs font in general. It comes with a corresponding
[[https://systemcrafters.net/emacs-tips/presentations-with-org-present/][blog post]].
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment