From 8de5b4980b89352bc325853d788b078d1bcf9784 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Hauspie?= <michael.hauspie@univ-lille.fr>
Date: Tue, 25 Feb 2025 15:51:22 +0100
Subject: [PATCH] Add configuration for org-present

---
 configuration.org | 752 ++++++++++++++++++++++++++--------------------
 1 file changed, 423 insertions(+), 329 deletions(-)

diff --git a/configuration.org b/configuration.org
index 85694a2..7447af7 100644
--- a/configuration.org
+++ b/configuration.org
@@ -24,9 +24,9 @@ to macOs (until it is released):
    This sets gcc optimization flag to =-O2= (max optimization level,
    fully adherent to the langage semantic).
    #+begin_src emacs-lisp
-     (unless (version< emacs-version "28")
-       (setq comp-speed 2)
-       )
+(unless (version< emacs-version "28")
+  (setq comp-speed 2)
+  )
    #+end_src
 
 ** Garbage collector
@@ -36,7 +36,7 @@ configuration loading. The threshold will be set lower at the end of
 the configuration to make each GC call faster for normal emacs use.
   
 #+begin_src emacs-lisp
-  (setq gc-cons-threshold (* 60 1024 1024))
+(setq gc-cons-threshold (* 60 1024 1024))
 #+end_src
 
 * Personal information
@@ -44,11 +44,11 @@ the configuration to make each GC call faster for normal emacs use.
 Sets who I am
 
 #+begin_src emacs-lisp
-  (setq user-full-name "Michaël Hauspie"
-        user-mail-address "michael.hauspie@univ-lille.fr"
-        calendar-latitude 50.60483
-        calendar-longitude 3.1464
-        calendar-location-name "Villeneuve d'Ascq, France")
+(setq user-full-name "Michaël Hauspie"
+      user-mail-address "michael.hauspie@univ-lille.fr"
+      calendar-latitude 50.60483
+      calendar-longitude 3.1464
+      calendar-location-name "Villeneuve d'Ascq, France")
 #+end_src
 
 
@@ -59,15 +59,16 @@ I use Melpa packages repositories, thus I need to add them to the =package-archi
 For older emacs version, fix some gnutls algorithm priority
 
 #+BEGIN_SRC emacs-lisp
-  (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
+(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
 #+END_SRC
 
 Then add package repositories
 
 #+BEGIN_SRC emacs-lisp
-  (require 'package)
-  (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
-  (unless (fboundp 'package-activate-all) (package-initialize))
+(require 'package)
+                                        ;  (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))
 #+END_SRC
 
 
@@ -77,9 +78,9 @@ Emacs on a new computer and have it setup automatically, I use
 
 
 #+BEGIN_SRC emacs-lisp
-  (when (not (package-installed-p 'use-package))
-    (package-refresh-contents)
-    (package-install 'use-package))
+(when (not (package-installed-p 'use-package))
+  (package-refresh-contents)
+  (package-install 'use-package))
 #+END_SRC
 
 
@@ -87,35 +88,35 @@ If I use a package, I want to ensure that it is installed, so set
 ensure package by default
 
 #+BEGIN_SRC emacs-lisp
-  (require 'use-package-ensure)
-  (setq use-package-always-ensure t)
+(require 'use-package-ensure)
+(setq use-package-always-ensure t)
 #+END_SRC
 
 We can keep things up to date, using =auto-package-update=, but it
 tends to make emacs very slow to start
 
 #+BEGIN_SRC emacs-lisp
-  ;; (use-package auto-package-update
-  ;;   :config
-  ;;   (setq auto-package-update-delete-old-versions t)
-  ;;   (setq auto-package-update-hide-results t)
-  ;;   (auto-package-update-maybe))
+;; (use-package auto-package-update
+;;   :config
+;;   (setq auto-package-update-delete-old-versions t)
+;;   (setq auto-package-update-hide-results t)
+;;   (auto-package-update-maybe))
 #+END_SRC
 
 and I want to be sure that compiled versions of packages are up-to-date
 
 #+begin_src emacs-lisp
-  (use-package auto-compile
-    :config 
-    (auto-compile-on-load-mode)
-    (setq load-prefer-newer t)
-    )
+(use-package auto-compile
+  :config 
+  (auto-compile-on-load-mode)
+  (setq load-prefer-newer t)
+  )
 #+end_src
 
 some packages I use depends on =pkg-info=
 
 #+begin_src emacs-lisp
-  (use-package pkg-info)
+(use-package pkg-info)
 #+end_src
   
 ** Non package modules
@@ -123,7 +124,7 @@ some packages I use depends on =pkg-info=
 Add a folder for .el files that are not available as packages
 
 #+begin_src emacs-lisp
-  (add-to-list 'load-path "~/.emacs.d/plugins")
+(add-to-list 'load-path "~/.emacs.d/plugins")
 #+end_src
 
 
@@ -142,18 +143,18 @@ I use [[https://github.com/technomancy/better-defaults][better-defaults]] to twe
 
 
 #+BEGIN_SRC emacs-lisp
-  (use-package better-defaults
-    :config
-    (menu-bar-mode t)
-    (setq ido-enable-flex-matching t)
-    (setq ido-everywhere t)
-    )
+(use-package better-defaults
+  :config
+  (menu-bar-mode t)
+  (setq ido-enable-flex-matching t)
+  (setq ido-everywhere t)
+  )
 #+END_SRC
 
 Allow pressing only =y= instead of =yes= for fast answer to yes or no question
 
 #+begin_src emacs-lisp
-  (fset 'yes-or-no-p 'y-or-n-p)
+(fset 'yes-or-no-p 'y-or-n-p)
 #+end_src
 
 ** MacOS
@@ -162,8 +163,8 @@ As I often use Emacs on MacOS, I need the right option (alt) key to behave *as*
 not an Emacs =meta= key.
 
 #+begin_src emacs-lisp
-  (when (eq system-type 'darwin)
-    (setq mac-right-option-modifier nil))
+(when (eq system-type 'darwin)
+  (setq mac-right-option-modifier nil))
 #+end_src
 
 
@@ -172,39 +173,39 @@ not an Emacs =meta= key.
 Save the place in the file when killing the buffer so that it reopens at the same spot later
 
 #+begin_src emacs-lisp
-  (save-place-mode t)
+(save-place-mode t)
 #+end_src
 
 Syntax highlighting everywhere 
 
 #+begin_src emacs-lisp
-  (global-font-lock-mode t)
-  (setq font-lock-maximum-decoration t)
+(global-font-lock-mode t)
+(setq font-lock-maximum-decoration t)
 #+end_src
 
 Use 4 spaces as tab
 
 #+begin_src emacs-lisp
-  (setq tab-width 4)
+(setq tab-width 4)
 #+end_src
 
 Allow cursor to top/bottom of file before signaling a scrolling error
 
 #+begin_src emacs-lisp
-  (setq scroll-error-top-bottom t)
+(setq scroll-error-top-bottom t)
 #+end_src
 
 
 Replace selection as I type
 
 #+begin_src emacs-lisp
-  (delete-selection-mode t)
+(delete-selection-mode t)
 #+end_src
 
 When using =C-k=, kill the whole line (including =\n=)
 
 #+begin_src emacs-lisp
-  (setq kill-whole-line t)
+(setq kill-whole-line t)
 #+end_src
 
 When moving the cursor up or down, remember when it was on a line end and keep it that way even
@@ -212,7 +213,7 @@ if next line is longer or shorter
 
 
 #+begin_src emacs-lisp
-  (setq track-eol t)
+(setq track-eol t)
 #+end_src
 
 Automatically revert buffers if they change on disk. This prevent keeping an outdated buffer open
@@ -220,43 +221,43 @@ and makes changes that will overwrite the newer file on disk. If the buffer was
 last save/revert, Emacs asks what to do.
 
 #+begin_src emacs-lisp
-  (global-auto-revert-mode t)
-  ;; kept for future use, I think I do not want that
-  ;;  (setq global-auto-revert-non-file-buffers nil)
+(global-auto-revert-mode t)
+;; kept for future use, I think I do not want that
+;;  (setq global-auto-revert-non-file-buffers nil)
 #+end_src
 
 Do not word wrap buffers, truncate long lines
 
 #+begin_src emacs-lisp
-  ;; Truncate lines (don't word wrap)
-  (setq truncate-lines t)
+;; Truncate lines (don't word wrap)
+(setq truncate-lines t)
 #+end_src
 
 If a timestamp tag is present in the file, update it when saving
 
 #+begin_src emacs-lisp
-  ;; Time stamping
-  (setq  time-stamp-active t          ; do enable time-stamps
-         time-stamp-line-limit 70     ; check first 70 buffer lines for Time-stamp:
-         time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S (%u)") ; date format
-  (add-hook 'write-file-hooks 'time-stamp)
+;; Time stamping
+(setq  time-stamp-active t          ; do enable time-stamps
+       time-stamp-line-limit 70     ; check first 70 buffer lines for Time-stamp:
+       time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S (%u)") ; date format
+(add-hook 'write-file-hooks 'time-stamp)
 #+end_src
 
 Define a shortcut to re-indent all buffer. This saves the current point, marks whole buffer and call =indent-region=
 
 #+begin_src emacs-lisp
-  (defun mh/indent-buffer()
-    (interactive)
-    (save-excursion
-      (indent-region (point-min) (point-max))))
+(defun mh/indent-buffer()
+  (interactive)
+  (save-excursion
+    (indent-region (point-min) (point-max))))
 
-  (global-set-key (kbd "C-c i b") 'mh/indent-buffer)
+(global-set-key (kbd "C-c i b") 'mh/indent-buffer)
 #+end_src
 
 Set the line width for fill command
 
 #+begin_src emacs-lisp
-  (setq-default fill-column 100) 
+(setq-default fill-column 100) 
 #+end_src
 
 
@@ -269,9 +270,9 @@ Ensure that Emacs uses the path from my shell (especially when using MacOS)
   :custom
   (shell-file-name "/bin/zsh")
   (exec-path-from-shell-variables '("PATH" "MANPATH" "PKG_CONFIG_PATH")
-  :init
-  (if (string-equal system-type "darwin")
-      (exec-path-from-shell-initialize)))
+                                  :init
+                                  (if (string-equal system-type "darwin")
+                                      (exec-path-from-shell-initialize)))
   )
 #+end_src
 
@@ -283,43 +284,51 @@ I always display visual line where the cursor is and I like to have line numbers
 buffer. I also like to have Emacs show me matching parenthesis. Also do not show the welcome screen.
 
 #+BEGIN_SRC emacs-lisp
-  ;; Do not show welcome screen
-  (setq inhibit-startup-screen t)
+;; Do not show welcome screen
+(setq inhibit-startup-screen t)
 
-  ;; Highlight current line
-  (global-hl-line-mode t)
+;; Highlight current line
+(global-hl-line-mode t)
 
-  ;; Show line number on the left hand side of the code 
-  (global-display-line-numbers-mode)
+;; Show line number on the left hand side of the code 
+(global-display-line-numbers-mode)
 
-  ;; Show matching parenthesis
-  (show-paren-mode t)
+;; Show matching parenthesis
+(show-paren-mode t)
 
-  ;; Detailed window title
-  (setq-default frame-title-format (list "%65b %f"))
-  (setq-default icon-title-format (list "%b"))
+;; Detailed window title
+(setq-default frame-title-format (list "%65b %f"))
+(setq-default icon-title-format (list "%b"))
 #+END_SRC
 
 ** Theme
 
 #+BEGIN_SRC emacs-lisp
-  (use-package color-theme-sanityinc-tomorrow
-    :config
-    (load-theme 'sanityinc-tomorrow-bright t)
-    )
+(use-package color-theme-sanityinc-tomorrow
+  :config
+  (load-theme 'sanityinc-tomorrow-bright t)
+  )
 #+END_SRC
 
 Select the font I will use depending on the system
 
 #+begin_src emacs-lisp
-  (if (eq system-type 'darwin)
-                                          ; Font on MacOS
-      (setq mh-font "Fira Code-13")
-                                          ; Font on Other Systems (Linux actually, I do not use emacs on windows)
-    (setq mh-font "DejaVu Sans Mono-12")
+(if (eq system-type 'darwin)
+                                        ; Font on MacOS
+    (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)
+  (progn
+    (setq mh-font-fixed "DejaVu Sans Mono")
+    (setq mh-font-variable "DejaVu Sans")
     )
-  (set-face-attribute 'default t :font mh-font )
-  (set-frame-font mh-font nil t)
+  )
+(set-face-attribute 'default nil :font mh-font-fixed :weight 'light :height 160)
+(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
 
 ** Modeline
@@ -328,14 +337,14 @@ Tweak how some modeline elements are displayed
 
 #+begin_src emacs-lisp
 
-  ;; Show line and column number in mode line
-  (column-number-mode t)
-  (line-number-mode t)
+;; Show line and column number in mode line
+(column-number-mode t)
+(line-number-mode t)
 
-  ;; Show time in mode line
-  (setq display-time-24hr-format t)
-  (setq display-time-day-and-date t)
-  (display-time-mode t)
+;; Show time in mode line
+(setq display-time-24hr-format t)
+(setq display-time-day-and-date t)
+(display-time-mode t)
 #+end_src
 
 
@@ -343,15 +352,15 @@ To not display all minor modes. =eval-after-load= is there to
 ensure that diminish is called only for modules that are installed
 and loaded.
 #+begin_src emacs-lisp
-  (use-package diminish
-    :config
-    (eval-after-load "company" '(diminish 'company-mode))
-    (eval-after-load "company-box" '(diminish 'company-box-mode))
-    (eval-after-load "undo-tree" '(diminish 'undo-tree-mode))
-    (eval-after-load "yasnippet" '(diminish 'yas-minor-mode))
-    (eval-after-load "which-key" '(diminish 'which-key-mode))
-    (diminish 'eldoc-mode)
-    )
+(use-package diminish
+  :config
+  (eval-after-load "company" '(diminish 'company-mode))
+  (eval-after-load "company-box" '(diminish 'company-box-mode))
+  (eval-after-load "undo-tree" '(diminish 'undo-tree-mode))
+  (eval-after-load "yasnippet" '(diminish 'yas-minor-mode))
+  (eval-after-load "which-key" '(diminish 'which-key-mode))
+  (diminish 'eldoc-mode)
+  )
 #+end_src
 
 *** TRAMP configuration for remote editing
@@ -379,11 +388,11 @@ the very best.
 For this, I use the =tramp-theme= package that does what I want.
 
 #+begin_src emacs-lisp
-  (use-package tramp-theme
-    :ensure t
-    :config
-    (load-theme 'tramp t)
-    )
+(use-package tramp-theme
+  :ensure t
+  :config
+  (load-theme 'tramp t)
+  )
 #+end_src
 
 ** Shortcut dynamic help buffer
@@ -392,9 +401,9 @@ When a key binding sequence is started and not finished, display
 possible next keys in the mini-buffer
 
 #+begin_src emacs-lisp
-  (use-package which-key
-    :config
-    (which-key-mode t))
+(use-package which-key
+  :config
+  (which-key-mode t))
 #+end_src
 
 
@@ -404,7 +413,7 @@ Enable winner mode globally. Then with =C-c left= and =C-c right=
 we can redo/undo the buffer configuration
 
 #+begin_src emacs-lisp
-  (winner-mode t)
+(winner-mode t)
 #+end_src
 
 ** Better mini-buffer
@@ -413,14 +422,14 @@ Vertico and Marginlia upgrades the minibuffer completion window by making it mor
 (=vertico=) and displaying a short documentation string for each item.
 
 #+begin_src emacs-lisp
-  (use-package vertico
-    :config
-    (vertico-mode t)
-    )
-  (use-package marginalia
-    :config
-    (marginalia-mode t)
-    )
+(use-package vertico
+  :config
+  (vertico-mode t)
+  )
+(use-package marginalia
+  :config
+  (marginalia-mode t)
+  )
 #+end_src
 
 * Org mode
@@ -537,51 +546,135 @@ org with contributed packages added.
 Add a shortcut to toggle display of emphasis characters
 
 #+begin_src emacs-lisp
-  (defun org-toggle-emphasis ()
-    "Toggle hiding/showing of org emphasize markers."
-    (interactive)
-    (if org-hide-emphasis-markers
-        (set-variable 'org-hide-emphasis-markers nil)
-      (set-variable 'org-hide-emphasis-markers t)))
-  (define-key org-mode-map (kbd "C-c e") 'org-toggle-emphasis)
+(defun org-toggle-emphasis ()
+  "Toggle hiding/showing of org emphasize markers."
+  (interactive)
+  (if org-hide-emphasis-markers
+      (set-variable 'org-hide-emphasis-markers nil)
+    (set-variable 'org-hide-emphasis-markers t)))
+(define-key org-mode-map (kbd "C-c e") 'org-toggle-emphasis)
 #+end_src
 
 Use =org-mode= for the initial scratch buffer
 
 #+begin_src emacs-lisp
-  (setq initial-major-mode 'org-mode)
+(setq initial-major-mode 'org-mode)
 #+end_src
 
 Use =org-ref= for citation
 
 #+begin_src emacs-lisp
-  (use-package org-ref
-    :bind ("C-c [" . 'org-reftex-citation)
-    )
-  (use-package org-ref-prettify)
+(use-package org-ref
+  :bind ("C-c [" . 'org-reftex-citation)
+  )
+(use-package org-ref-prettify)
 #+end_src
 
 Use bullets instead of asterisks
 
 #+begin_src emacs-lisp
-  (use-package org-bullets
-    :hook org-mode
-    )
+(use-package org-bullets
+  :hook org-mode
+  )
 #+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
-  (use-package org-tree-slide
-    :bind (:map org-mode-map
-                ("<f8>" . 'org-tree-slide-mode)
-                )
-    )
-#+end_src
 
+;; so that org-* face attributes are available
+(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)
+  )
+
+
+(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
 
@@ -589,27 +682,27 @@ I use =org-mode= to export to LaTeX, (beamer and article) markdown and to HTML
 using bootstrap template.
 
 #+begin_src emacs-lisp
-  ;; Add Beamer to export list
-  (use-package ox-beamer
-    :ensure nil
-    )
-  ;; And markdown
-  (use-package ox-md
-    :ensure nil
-    )
+;; Add Beamer to export list
+(use-package ox-beamer
+  :ensure nil
+  )
+;; And markdown
+(use-package ox-md
+  :ensure nil
+  )
 
-  ;; some HTML slide export engines
-  ;; Don't really use them actually so commented out
-  ;; (use-package ox-html5slide)
-  ;; (use-package ox-impress-js)
-  ;; (use-package ox-reveal)     
-  ;; (use-package ox-spectacle )
+;; some HTML slide export engines
+;; Don't really use them actually so commented out
+;; (use-package ox-html5slide)
+;; (use-package ox-impress-js)
+;; (use-package ox-reveal)     
+;; (use-package ox-spectacle )
 
-  ;; bootstrap html
-  (use-package ox-twbs)
+;; bootstrap html
+(use-package ox-twbs)
 
-  ;; Export using pandoc
-  (use-package ox-pandoc)
+;; Export using pandoc
+(use-package ox-pandoc)
 #+end_src
 
    
@@ -618,28 +711,28 @@ Configure code highlighting using [[https://www.ctan.org/pkg/minted][minted]] (w
 
 #+begin_src emacs-lisp
 
-  (use-package ox-latex
-    :ensure nil
-    :custom
-    (org-latex-listings 'minted)
-    :config
-    (add-to-list 'org-latex-classes
-                 '("book-noparts"
-                   "\\documentclass{book}"
-                   ("\\chapter{%s}" . "\\chapter*{%s}")
-                   ("\\section{%s}" . "\\section*{%s}")
-                   ("\\subsection{%s}" . "\\subsection*{%s}")
-                   ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
-                   ("\\paragraph{%s}" . "\\paragraph*{%s}")
-                   ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
-    (add-to-list 'org-latex-packages-alist '("cache=false" "minted"))
-    )
+(use-package ox-latex
+  :ensure nil
+  :custom
+  (org-latex-listings 'minted)
+  :config
+  (add-to-list 'org-latex-classes
+               '("book-noparts"
+                 "\\documentclass{book}"
+                 ("\\chapter{%s}" . "\\chapter*{%s}")
+                 ("\\section{%s}" . "\\section*{%s}")
+                 ("\\subsection{%s}" . "\\subsection*{%s}")
+                 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
+                 ("\\paragraph{%s}" . "\\paragraph*{%s}")
+                 ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
+  (add-to-list 'org-latex-packages-alist '("cache=false" "minted"))
+  )
 #+end_src
 
 For HTML source code highlight, use =htmlize=
 
 #+begin_src emacs-lisp
-  (use-package htmlize)
+(use-package htmlize)
 #+end_src
 
 
@@ -658,21 +751,21 @@ Turn off validate link in org html export:
 
 
 #+begin_src emacs-lisp
-  (use-package gnuplot)
-  (use-package gnuplot-mode)
-  (use-package ob-rust)
+(use-package gnuplot)
+(use-package gnuplot-mode)
+(use-package ob-rust)
 #+END_SRC
 
 
 Preserve indentation in source block (useful for makefiles to preserve tabs for example)
 #+begin_src emacs-lisp
-  (setq org-src-preserve-indentation t)
+(setq org-src-preserve-indentation t)
 #+end_src
 
 Don't ask before evaluating
 
 #+begin_src emacs-lisp
-  (setq org-confirm-babel-evaluate nil)
+(setq org-confirm-babel-evaluate nil)
 #+end_src
 
 Correctly associate some language with the correct major-mode inside org.
@@ -687,20 +780,20 @@ Correctly associate some language with the correct major-mode inside org.
 Make org mode correctly export quotes
 
 #+begin_src emacs-lisp
-  (setq org-export-with-smart-quotes t)
+(setq org-export-with-smart-quotes t)
 #+end_src
 
 
 Use =python3=
 
 #+begin_src emacs-lisp
-  (setq org-babel-python-command "python3")
+(setq org-babel-python-command "python3")
 #+end_src
 
 
 Set line count limit before using =begin_example= blocs in code evaluation results
 #+begin_src emacs-lisp
-  (setq org-babel-min-lines-for-block-output 10)
+(setq org-babel-min-lines-for-block-output 10)
 #+end_src
 
 ** Transform json results to org-table
@@ -710,7 +803,7 @@ json output to an org table. The emacs module can be found here:
 https://github.com/noonker/json-to-org-table
 
 #+begin_src emacs-lisp
-  (require 'json-to-org-table nil t)
+(require 'json-to-org-table nil t)
 #+end_src
 
 * Markdown mode
@@ -719,7 +812,7 @@ I use pandoc to generate html output from markdown file. In order to
 export a standalone file with the correct options, I set pandoc call here
 
 #+begin_src emacs-lisp
-  (setq markdown-command "pandoc --standalone --mathjax")
+(setq markdown-command "pandoc --standalone --mathjax")
 #+end_src
 
 * Completion setup
@@ -732,20 +825,20 @@ First, install and configure company and enable it for
 all buffers. I also set =M-/= to trigger =company-complete=
 
 #+begin_src emacs-lisp
-  (use-package company
-    :ensure company-box
-    :ensure company-php 
-    :ensure company-web 
-    :init
-    (global-company-mode t)
-    (global-set-key (kbd "M-/") 'company-complete)
-    ;; Complete quite soon
-    :custom
-    (company-minimum-prefix-length 3)
-    (company-idle-delay 0.1)
-    (company-show-quick-access "off")  
-    (company-quick-access-hint-function (lambda (param) " unknown"))
-    )
+(use-package company
+  :ensure company-box
+  :ensure company-php 
+  :ensure company-web 
+  :init
+  (global-company-mode t)
+  (global-set-key (kbd "M-/") 'company-complete)
+  ;; Complete quite soon
+  :custom
+  (company-minimum-prefix-length 3)
+  (company-idle-delay 0.1)
+  (company-show-quick-access "off")  
+  (company-quick-access-hint-function (lambda (param) " unknown"))
+  )
 #+end_src
 
 Then, add backends and company tweaks. 
@@ -754,17 +847,17 @@ Then, add backends and company tweaks.
 completing symbols in source code.
 
 #+begin_src emacs-lisp
-  (use-package company-box
-    :ensure frame-local
-    :hook (company-mode . company-box-mode))
+(use-package company-box
+  :ensure frame-local
+  :hook (company-mode . company-box-mode))
 #+end_src
 
 Now some backends I use. Mainly php and web
 related. 
 
 #+begin_src emacs-lisp
-  (use-package company-php)
-  (use-package company-web)
+(use-package company-php)
+(use-package company-web)
 #+end_src
 
 
@@ -777,11 +870,11 @@ navigate. You can have several workspaces that are simply a list of
 projects. I bind =C-c t= to toggle treemacs panel.
 
 #+begin_src emacs-lisp
-  (use-package treemacs
-    :custom
-    (treemacs--icon-size 16)
-    :bind ("C-c t" . treemacs-select-window)
-    )
+(use-package treemacs
+  :custom
+  (treemacs--icon-size 16)
+  :bind ("C-c t" . treemacs-select-window)
+  )
 #+end_src
 
 ** Projectile
@@ -793,16 +886,16 @@ whenever a =.git= folder or a =.projectile= file is in a foler.
 Bind =C-c p= as the prefix for projectile command keybinds.
 
 #+begin_src emacs-lisp
-  (use-package projectile
-    :config
-    (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
-    (projectile-mode t))
+(use-package projectile
+  :config
+  (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
+  (projectile-mode t))
 #+end_src
 
 As I use =treemacs=, adds =treemacs-projectile= plugin
 
 #+begin_src emacs-lisp
-  (use-package treemacs-projectile)
+(use-package treemacs-projectile)
 #+end_src
 
 * Snippets
@@ -811,10 +904,10 @@ I use =yasnippet= for defining and using snippets for several modes. I
 preload all snippets by [[https://github.com/AndreaCrotti/yasnippet-snippets][AndreaCrotti]] (=yasnippet-snippets= package).
 
 #+begin_src emacs-lisp
-  (use-package yasnippet
-    :init
-    (yas-global-mode))
-  (use-package yasnippet-snippets)
+(use-package yasnippet
+  :init
+  (yas-global-mode))
+(use-package yasnippet-snippets)
 #+end_src
 
 
@@ -853,32 +946,32 @@ error if any and sets its height.
 ** LSP
 
 #+begin_src emacs-lisp
-  (use-package lsp-mode
-    :hook (
-           (c++-mode . lsp)
-           (python-mode . lsp)
-           (rust-mode . lsp)
-           (slint-mode . lsp)
-           (lsp-mode . lsp-enable-which-key-integration)
-           )
-    :config
-    (lsp-headerline-breadcrumb-mode t)
-    :commands lsp
-    )
+(use-package lsp-mode
+  :hook (
+         (c++-mode . lsp)
+         (python-mode . lsp)
+         (rust-mode . lsp)
+         (slint-mode . lsp)
+         (lsp-mode . lsp-enable-which-key-integration)
+         )
+  :config
+  (lsp-headerline-breadcrumb-mode t)
+  :commands lsp
+  )
 #+end_src
 
 
 For displaying more information directly in the buffer, I use =lsp-ui=
 
 #+begin_src emacs-lisp
-  (use-package lsp-ui
-    :commands lsp-ui-mode)
+(use-package lsp-ui
+  :commands lsp-ui-mode)
 #+end_src
 
 LSP keybinds
 
 #+begin_src emacs-lisp
-  (setq lsp-keymap-prefix "s-l")
+(setq lsp-keymap-prefix "s-l")
 #+end_src
 
 *** LSP through TRAMP
@@ -886,12 +979,12 @@ LSP keybinds
 For rust
 
 #+begin_src emacs-lisp
-  ;; (lsp-register-client
-  ;;  (make-lsp-client :new-connection (lsp-tramp-connection "rust-analyzer")
-  ;;                   :major-modes '(rust-mode)
-  ;;                   :remote? t
-  ;;                   :server-id 'rust-analyzer-remote))
-  (with-eval-after-load "tramp" (add-to-list 'tramp-remote-path "~/.cargo/bin"))
+;; (lsp-register-client
+;;  (make-lsp-client :new-connection (lsp-tramp-connection "rust-analyzer")
+;;                   :major-modes '(rust-mode)
+;;                   :remote? t
+;;                   :server-id 'rust-analyzer-remote))
+(with-eval-after-load "tramp" (add-to-list 'tramp-remote-path "~/.cargo/bin"))
 #+end_src
 
 
@@ -901,9 +994,9 @@ For rust
 LSP can integrate with treemacs to display packages, class, symbols and such.
 
 #+begin_src emacs-lisp
-  (use-package lsp-treemacs
-    :custom
-    (lsp-treemacs-sync-mode 1))
+(use-package lsp-treemacs
+  :custom
+  (lsp-treemacs-sync-mode 1))
 #+end_src
 
 
@@ -913,7 +1006,7 @@ LSP can integrate with treemacs to display packages, class, symbols and such.
 flycheck if available to show code diagnosis.
 
 #+begin_src emacs-lisp
-  (use-package flycheck)
+(use-package flycheck)
 #+end_src
 
 
@@ -923,8 +1016,8 @@ flycheck if available to show code diagnosis.
 
 Set indentation size and parameters
 #+begin_src emacs-lisp
-  (setq c-default-style "linux"
-        c-basic-offset 4)
+(setq c-default-style "linux"
+      c-basic-offset 4)
 #+end_src
 
 
@@ -933,10 +1026,10 @@ Set indentation size and parameters
 Install =rust-mode= and set the rust language server to [[https://rust-analyzer.github.io/][rust-analyzer]]
 
 #+begin_src emacs-lisp
-  (use-package rust-mode
-    :custom
-    (lsp-rust-server 'rust-analyzer)
-    )
+(use-package rust-mode
+  :custom
+  (lsp-rust-server 'rust-analyzer)
+  )
 #+end_src
 
 For this to work, you need to install =rust-analyzer= and =rustmft=. This can be done using
@@ -947,7 +1040,7 @@ For this to work, you need to install =rust-analyzer= and =rustmft=. This can be
 Simply add =lua-mode=
 
 #+begin_src emacs-lisp
-  (use-package lua-mode)
+(use-package lua-mode)
 #+end_src
 
 *** Docker
@@ -955,12 +1048,12 @@ Simply add =lua-mode=
 For dockerfiles and docker-compose files, install some docker packages
 
 #+begin_src emacs-lisp
-  (use-package dockerfile-mode)
-  (use-package docker-compose-mode)
-  (use-package docker)
-                                          ;(use-package docker-tramp)
-  (use-package docker-api)
-  (use-package docker-cli)
+(use-package dockerfile-mode)
+(use-package docker-compose-mode)
+(use-package docker)
+                                        ;(use-package docker-tramp)
+(use-package docker-api)
+(use-package docker-cli)
 #+end_src
 
 *** Web
@@ -978,20 +1071,20 @@ Add =web-mode=, =rainbow-mode=, =simple-httpd= and =impatient-mode= for web edit
   the web browser
 
   #+begin_src emacs-lisp
-    (use-package web-mode
-      :config
-      (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
-      (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
-      (add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
-      (add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode))
-      (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
-      (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
-      (add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
-      (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
-      )
-    (use-package rainbow-mode)
-    (use-package simple-httpd)
-    (use-package impatient-mode)
+(use-package web-mode
+  :config
+  (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
+  (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
+  )
+(use-package rainbow-mode)
+(use-package simple-httpd)
+(use-package impatient-mode)
   #+end_src
 
 *** LaTeX
@@ -999,16 +1092,16 @@ Add =web-mode=, =rainbow-mode=, =simple-httpd= and =impatient-mode= for web edit
 Enable =reftex= whenever =tex-mode= is activated
 
 #+begin_src emacs-lisp
-  (add-hook 'latex-mode-hook 'reftex-mode)
+(add-hook 'latex-mode-hook 'reftex-mode)
 #+end_src
 
 Use =auctex= for better experience editing latex files
 
 #+begin_src emacs-lisp
-  (use-package auctex
-    :ensure auctex-latexmk
-    :defer t
-    )
+(use-package auctex
+  :ensure auctex-latexmk
+  :defer t
+  )
 #+end_src
     
 
@@ -1017,7 +1110,7 @@ Use =auctex= for better experience editing latex files
 A mode to edit [[https://nginx.org/][nginx]] configuration files.
 
 #+begin_src emacs-lisp
-  (use-package nginx-mode)
+(use-package nginx-mode)
 #+end_src
 
 *** Terraform
@@ -1025,9 +1118,9 @@ A mode to edit [[https://nginx.org/][nginx]] configuration files.
 Packages to edit terraform configuration files
 
 #+begin_src emacs-lisp
-  (use-package terraform-mode)
-  (use-package terraform-doc)
-  (use-package company-terraform)
+(use-package terraform-mode)
+(use-package terraform-doc)
+(use-package company-terraform)
 #+end_src
 
 *** Slint
@@ -1038,14 +1131,14 @@ describe the UI element.
 Install and load slint mode package.
 
 #+begin_src emacs-lisp
-  (use-package slint-mode)
+(use-package slint-mode)
 #+end_src
 
 
 =slint-lsp= langage server can be installed using:
 
 #+begin_src shell
-  cargo install slint-lsp
+cargo install slint-lsp
 #+end_src
 
 
@@ -1054,27 +1147,27 @@ Install and load slint mode package.
 [[https://magit.vc/][Magit]] is git porcelain inside emacs.
 
 
-  + Bind =C-x g= to pop up the magit status buffer
-  + configure magit to automatically revert buffers that are opened
-    if they are modified by a magit action (such as changing branch,
-    merging...)
-  + Save buffers that visit a file that belongs to a repository if
-    needed
++ Bind =C-x g= to pop up the magit status buffer
++ configure magit to automatically revert buffers that are opened
+  if they are modified by a magit action (such as changing branch,
+  merging...)
++ Save buffers that visit a file that belongs to a repository if
+  needed
 
-    #+begin_src emacs-lisp
-      (use-package magit
-        :config
-        (magit-auto-revert-mode t)
-        (magit-save-repository-buffers t)
-        :bind ("C-x g" . magit-status)
-        )
-    #+end_src
+  #+begin_src emacs-lisp
+(use-package magit
+  :config
+  (magit-auto-revert-mode t)
+  (magit-save-repository-buffers t)
+  :bind ("C-x g" . magit-status)
+  )
+  #+end_src
 
 
 *** Protocol buffers
 
 #+begin_src emacs-lisp
-  (use-package protobuf-mode)
+(use-package protobuf-mode)
 #+end_src
 
 * Spell checking
@@ -1082,7 +1175,7 @@ Install and load slint mode package.
 First, set =aspell= to be the spell checking program instead of =ispell=
 
 #+begin_src emacs-lisp
-  (setq ispell-program-name "aspell")
+(setq ispell-program-name "aspell")
 #+end_src
 
 #+RESULTS:
@@ -1091,28 +1184,28 @@ First, set =aspell= to be the spell checking program instead of =ispell=
 Then define a command that will run flyspell on the buffer *and* activate it
 
 #+begin_src emacs-lisp
-  (defun mh/spellcheck ()
-    (interactive)
-    (flyspell-mode t)
-    (flyspell-buffer)
-    )
+(defun mh/spellcheck ()
+  (interactive)
+  (flyspell-mode t)
+  (flyspell-buffer)
+  )
 #+end_src
 
 And define a global binding to call it
   
 #+begin_src emacs-lisp
-  (global-set-key (kbd "C-c s") 'mh/spellcheck)
+(global-set-key (kbd "C-c s") 'mh/spellcheck)
 #+end_src
 
 Binding to fix a word /then/ go to the next error. 
 
 #+begin_src emacs-lisp
-  (defun mh/cycle-spellcheck ()
-    (interactive)
-    (flyspell-goto-next-error)
-    (ispell-word))
+(defun mh/cycle-spellcheck ()
+  (interactive)
+  (flyspell-goto-next-error)
+  (ispell-word))
 
-  (global-set-key (kbd "C-$") 'mh/cycle-spellcheck)
+(global-set-key (kbd "C-$") 'mh/cycle-spellcheck)
 #+end_src
 
 
@@ -1121,7 +1214,7 @@ Binding to fix a word /then/ go to the next error.
 Using grammalecte with flycheck
 
 #+begin_src emacs-lisp
-  (use-package flycheck-grammalecte)
+(use-package flycheck-grammalecte)
 #+end_src
 
 * Misc.
@@ -1130,13 +1223,13 @@ Starts Emacs server so that we can use =emacsclient= for opening new
 files.
 
 #+begin_src emacs-lisp
-  (server-start)
+(server-start)
 #+end_src
 
 A handy way of starting Emacs from the shell is then to call 
 
 #+begin_src bash
-  emacsclient -a emacs ...
+emacsclient -a emacs ...
 #+end_src
 
 This will attempt to connect to Emacs server and run Emacs if the
@@ -1145,7 +1238,7 @@ server is not started yet.
 Add synthax highlighting for ssh_config files
 
 #+begin_src emacs-lisp
-  (use-package ssh-config-mode)
+(use-package ssh-config-mode)
 #+end_src
 
 * To check later
@@ -1161,23 +1254,22 @@ This configuration can make emacs being long to start, let's profile a bit
 
 This will print emacs start time as well as the count of GC calls
 #+begin_src emacs-lisp
-  (add-hook 'emacs-startup-hook
-            (lambda ()
-              (message "Emacs ready in %s with %d garbage collections."
-                       (format "%.2f seconds"
-                               (float-time
-                                (time-subtract after-init-time before-init-time)))
-                       gcs-done)))
+(add-hook 'emacs-startup-hook
+          (lambda ()
+            (message "Emacs ready in %s with %d garbage collections."
+                     (format "%.2f seconds"
+                             (float-time
+                              (time-subtract after-init-time before-init-time)))
+                     gcs-done)))
 #+end_src
 
 [[https://github.com/jschaf/esup][ESup]] is an emacs profiler
 
 #+begin_src emacs-lisp
-  (use-package esup
-    :ensure t
-    ;; To use MELPA Stable use ":pin mepla-stable",
-    :pin melpa
-    :commands (esup))
+(use-package esup
+  :ensure t
+  ;; To use MELPA Stable use ":pin mepla-stable",
+  :commands (esup))
 #+end_src
 
 #+RESULTS:
@@ -1189,7 +1281,7 @@ This will print emacs start time as well as the count of GC calls
 Set GC threshold to something more reasonable for standard use.
 
 #+begin_src emacs-lisp
-  (setq gc-cons-threshold (* 2 1024 1024))
+(setq gc-cons-threshold (* 2 1024 1024))
 #+end_src
 
 
@@ -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 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]].
-- 
GitLab