Update css/js + few configs
This commit is contained in:
309
doom.org
309
doom.org
@@ -1,21 +1,6 @@
|
||||
#+TITLE: Doom Emacs Configuration
|
||||
:DRAWER:
|
||||
#+LANGUAGE: en
|
||||
#+EMAIL: dehaeze.thomas@gmail.com
|
||||
#+AUTHOR: Dehaeze Thomas
|
||||
|
||||
#+HTML_LINK_HOME: ./index.html
|
||||
#+HTML_LINK_UP: ./index.html
|
||||
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
|
||||
#+HTML_HEAD: <script type="text/javascript" src="./js/jquery.min.js"></script>
|
||||
#+HTML_HEAD: <script type="text/javascript" src="./js/bootstrap.min.js"></script>
|
||||
#+HTML_HEAD: <script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
|
||||
#+HTML_HEAD: <script type="text/javascript" src="./js/readtheorg.js"></script>
|
||||
|
||||
#+SETUPFILE: ./setup/org-setup-file.org
|
||||
#+PROPERTY: header-args :tangle ~/.config/doom/config.el :results none :padline no
|
||||
:END:
|
||||
|
||||
* Introduction and Resources :ignore:
|
||||
https://medium.com/urbint-engineering/emacs-doom-for-newbies-1f8038604e3b
|
||||
@@ -111,7 +96,7 @@ After that, restart Emacs with =spc q r=.
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq doom-theme 'doom-gruvbox)
|
||||
(setq doom-theme 'leuven)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
@@ -161,6 +146,24 @@ Make horizontal movement cross lines
|
||||
(setq-default evil-cross-lines t)
|
||||
#+end_src
|
||||
|
||||
Evil Surround (not working):
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
;; this macro was copied from here: https://stackoverflow.com/a/22418983/4921402
|
||||
(defmacro define-and-bind-quoted-text-object (name key start-regex end-regex)
|
||||
(let ((inner-name (make-symbol (concat "evil-inner-" name)))
|
||||
(outer-name (make-symbol (concat "evil-a-" name))))
|
||||
`(progn
|
||||
(evil-define-text-object ,inner-name (count &optional beg end type)
|
||||
(evil-select-paren ,start-regex ,end-regex beg end type count nil))
|
||||
(evil-define-text-object ,outer-name (count &optional beg end type)
|
||||
(evil-select-paren ,start-regex ,end-regex beg end type count t))
|
||||
(define-key evil-inner-text-objects-map ,key #',inner-name)
|
||||
(define-key evil-outer-text-objects-map ,key #',outer-name))))
|
||||
|
||||
;; Add dollar as a surround object
|
||||
(define-and-bind-quoted-text-object "dollar" "$" "\\$" "\\$")
|
||||
#+end_src
|
||||
|
||||
** Which Key
|
||||
#+begin_src emacs-lisp
|
||||
(after! which-key
|
||||
@@ -270,15 +273,6 @@ Turn off auto-fill mode that add line breaks.
|
||||
- =(= Hide details
|
||||
- =)= Show git infos
|
||||
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package! dired-narrow
|
||||
:config
|
||||
(map! :map dired-mode-map
|
||||
:n "f"
|
||||
'dired-narrow-fuzzy))
|
||||
#+end_src
|
||||
|
||||
** PDF-Tools
|
||||
#+begin_src emacs-lisp
|
||||
(use-package! pdf-tools
|
||||
@@ -308,6 +302,11 @@ Turn off auto-fill mode that add line breaks.
|
||||
(setq org-files (cdr org-files))))
|
||||
#+end_src
|
||||
|
||||
** Others
|
||||
#+begin_src emacs-lisp
|
||||
(setq auto-save-default t)
|
||||
#+end_src
|
||||
|
||||
* Org Mode
|
||||
- http://cachestocaches.com/2016/9/my-workflow-org-agenda/
|
||||
- http://doc.norang.ca/org-mode.html#TodoKeywords
|
||||
@@ -365,6 +364,16 @@ Display the real size of images and not the one set with =attr_latex: :width \li
|
||||
)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun tdh/pdf-link (filename)
|
||||
(start-process "" nil "zathura" (concat "~/Cloud/pdfs/" filename ".pdf"))
|
||||
"")
|
||||
|
||||
(after! org
|
||||
(org-link-set-parameters "pdf" :follow #'tdh/pdf-link)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
** Org Tagging
|
||||
#+begin_src emacs-lisp
|
||||
(after! org
|
||||
@@ -640,12 +649,15 @@ https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarm
|
||||
("l" . "src emacs-lisp")
|
||||
("q" . "quote")
|
||||
("s" . "src")
|
||||
("ba" . "seealso")
|
||||
("ba" . "answer")
|
||||
("bd" . "definition")
|
||||
("be" . "exampl")
|
||||
("bx" . "exercice")
|
||||
("bq" . "question")
|
||||
("bs" . "summary")
|
||||
("bS" . "seealso")
|
||||
("bh" . "hint")
|
||||
("bn" . "note")
|
||||
("bi" . "important")
|
||||
("bc" . "caution")
|
||||
("bw" . "warning")
|
||||
@@ -751,17 +763,9 @@ Do not export headline with the =:ignore:= tag:
|
||||
*** HTML Defaults
|
||||
#+begin_src emacs-lisp
|
||||
(after! org
|
||||
;; (setq org-html-head-extra (concat
|
||||
;; "<link rel='stylesheet' href='../css/htmlize.css'>\n"
|
||||
;; "<link rel='stylesheet' href='../css/readtheorg.css'>\n"
|
||||
;; "<link rel='stylesheet' href='../css/zenburn.css'>\n"
|
||||
;; "<link rel='text/javascript' href='../js/bootstrap.min.js'>\n"
|
||||
;; "<link rel='text/javascript' href='../js/jquery.min.js'>\n"
|
||||
;; "<link rel='text/javascript' href='../js/jquery.stickytableheaders.min.js'>\n"
|
||||
;; "<link rel='text/javascript' href='../js/readtheorg.js'>\n"))
|
||||
(setq org-html-head "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">")
|
||||
(setq org-html-head-extra "")
|
||||
|
||||
;; cleans up anything that would have been in there.
|
||||
(setq org-html-head nil)
|
||||
(setq org-html-head-include-default-style nil)
|
||||
(setq org-html-head-include-scripts nil)
|
||||
|
||||
@@ -777,6 +781,12 @@ Do not export headline with the =:ignore:= tag:
|
||||
)
|
||||
#+end_src
|
||||
|
||||
*** Footnotes
|
||||
#+begin_src emacs-lisp
|
||||
(after! org
|
||||
(setq org-html-footnotes-section
|
||||
"<div id=\"footnotes\">\n<h2 class=\"footnotes\">%s</h2>\n<div id=\"text-footnotes\">\n%s\n</div>\n</div>"))
|
||||
#+end_src
|
||||
*** MathJax
|
||||
#+begin_src emacs-lisp
|
||||
(after! org
|
||||
@@ -815,9 +825,11 @@ Do not export headline with the =:ignore:= tag:
|
||||
(t
|
||||
path))))
|
||||
|
||||
(org-link-set-parameters "video" :export 'org-video-link-export)
|
||||
(after! org
|
||||
(org-link-set-parameters "video" :export 'org-video-link-export)
|
||||
|
||||
(org-export-string-as "video:xxx.mp4" 'html t)
|
||||
(org-export-string-as "video:xxx.mp4" 'html t)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
*** TODO Ensuring useful HTML Anchors
|
||||
@@ -1069,7 +1081,8 @@ Adapt this from https://github.com/alhassy/emacs.d to do something similar for s
|
||||
)
|
||||
(add-to-list 'org-latex-classes
|
||||
'("scrreprt"
|
||||
"\\documentclass{scrreprt}"
|
||||
"\\documentclass[a4paper, 10pt, DIV=12, parskip=full]{scrreprt}"
|
||||
("\\chapter{%s}" . "\\chapter*{%s}")
|
||||
("\\section{%s}" . "\\section*{%s}")
|
||||
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||
@@ -1131,7 +1144,28 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he
|
||||
)
|
||||
#+end_src
|
||||
|
||||
*** Default added packages
|
||||
*** TODO Default added packages
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(after! org
|
||||
(setq org-latex-default-packages-alist
|
||||
'(("AUTO" "inputenc" t ("pdflatex")) ;; for basic font and character selection
|
||||
("T1" "fontenc" t ("pdflatex")) ;; for basic font and character selection
|
||||
("" "graphicx" t) ;; for including images
|
||||
("" "grffile" t) ;; allow periods and spaces in graphics file names
|
||||
("" "longtable" nil) ;; For multipage tables
|
||||
("" "wrapfig" nil) ;; for figure placement
|
||||
("" "rotating" nil) ;; for sideways figures and tables
|
||||
("normalem" "ulem" t) ;; for underline and strike-through
|
||||
("" "amsmath" t) ;; for subscript and superscript and math environments
|
||||
("" "textcomp" t) ;; for various symbols
|
||||
("" "amssymb" t) ;; for various symbols
|
||||
("" "capt-of" nil) ;; for captions outside of floats
|
||||
("" "hyperref" nil)) ;; for cross references
|
||||
)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(after! org
|
||||
(add-to-list 'org-latex-packages-alist '("" "siunitx" t))
|
||||
@@ -1148,9 +1182,9 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he
|
||||
(after! org
|
||||
;; Setup default option for image size when exporting to LaTeX
|
||||
(setq org-latex-image-default-scale "")
|
||||
(setq org-latex-image-default-width "\\linewidth")
|
||||
(setq org-latex-image-default-width "")
|
||||
(setq org-latex-image-default-height "")
|
||||
(setq org-latex-image-default-option "")
|
||||
(setq org-latex-image-default-option "scale=1")
|
||||
|
||||
;; Use define labels instead of automatic generated ones
|
||||
(setq org-latex-prefer-user-labels t)
|
||||
@@ -1522,31 +1556,48 @@ https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_c
|
||||
)
|
||||
#+end_src
|
||||
|
||||
** Org Special Block Extras
|
||||
#+begin_src emacs-lisp
|
||||
(after! org
|
||||
(require 'org-special-block-extras)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
** Org Inline Task
|
||||
#+begin_src emacs-lisp
|
||||
(after! org
|
||||
(require 'org-inlinetask)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
** Org Links
|
||||
*** Youtube Links
|
||||
#+begin_src emacs-lisp
|
||||
(setq yt-iframe-format
|
||||
;; You may want to change your width and height.
|
||||
(concat "<iframe width=\"1280\""
|
||||
" height=\"720\""
|
||||
" src=\"https://www.youtube.com/embed/%s\""
|
||||
" frameborder=\"0\""
|
||||
" allowfullscreen>%s</iframe>"))
|
||||
(after! org
|
||||
(setq yt-iframe-format
|
||||
;; You may want to change your width and height.
|
||||
(concat "<div class=\"yt\"><iframe width=\"100%%\""
|
||||
" height=\"100%%\""
|
||||
" src=\"https://www.youtube.com/embed/%s\""
|
||||
" frameborder=\"0\""
|
||||
" allowfullscreen>%s</iframe></div>"))
|
||||
|
||||
(org-add-link-type
|
||||
"yt"
|
||||
(lambda (handle)
|
||||
(browse-url
|
||||
(concat "https://www.youtube.com/embed/"
|
||||
handle)))
|
||||
(lambda (path desc backend)
|
||||
(cl-case backend
|
||||
(html (format yt-iframe-format
|
||||
path (or desc "")))
|
||||
(md (format "{{< youtube %s >}}"
|
||||
(org-add-link-type
|
||||
"yt"
|
||||
(lambda (handle)
|
||||
(browse-url
|
||||
(concat "https://www.youtube.com/embed/"
|
||||
handle)))
|
||||
(lambda (path desc backend)
|
||||
(cl-case backend
|
||||
(html (format yt-iframe-format
|
||||
path (or desc "")))
|
||||
(md (format "{{< youtube %s >}}"
|
||||
path))
|
||||
(latex (format "\href{%s}{%s}"
|
||||
path (or desc "video"))))))
|
||||
(latex (format "\\href{%s}{%s}"
|
||||
(concat "https://www.youtube.com/embed/"
|
||||
path) (or desc "video"))))))
|
||||
)
|
||||
#+end_src
|
||||
|
||||
** Org Gcal
|
||||
@@ -1563,7 +1614,7 @@ https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_c
|
||||
("8kjmhe2ar0abnm054ill1fb0gc@group.calendar.google.com" . "~/Cloud/org/gcal_phd.org")))
|
||||
;; Automatic fetch of the new events
|
||||
;; (add-hook 'org-agenda-mode-hook (lambda () (org-gcal-fetch) ))
|
||||
)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
** Citeproc-Org
|
||||
@@ -1582,6 +1633,9 @@ https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_c
|
||||
:init
|
||||
(setq alert-default-style 'libnotify)
|
||||
:config
|
||||
(setq org-wild-notifier-alert-time '(10 5))
|
||||
(setq org-wild-notifier-notification-title "Org Agenda")
|
||||
(org-wild-notifier-mode)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
@@ -1724,7 +1778,7 @@ Take Screenshot and insert a link:
|
||||
(setq filename (read-string "Enter file name:" (car (split-string (file-name-base buffer-file-name) "_"))))
|
||||
(setq filename (read-string "Enter file name:")))
|
||||
(setq filepath (concat "./figs/" filename ".png"))
|
||||
(shell-command (concat "maim -s " filepath))
|
||||
(shell-command (concat "maim -u -s " filepath))
|
||||
(insert (format "#+name: fig:%s\n#+caption:\n[[file:%s]]" filename filepath))
|
||||
(search-backward "caption")
|
||||
(end-of-line)
|
||||
@@ -1795,6 +1849,14 @@ Map Keys
|
||||
#+end_src
|
||||
|
||||
*** Org LaTeX Automatic fragment
|
||||
#+begin_src emacs-lisp
|
||||
(use-package! org-fragtog
|
||||
:after org
|
||||
:config
|
||||
(add-hook 'org-mode-hook 'org-fragtog-mode)
|
||||
)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun tdh-automatic-latex-fragment-activate ()
|
||||
(interactive)
|
||||
@@ -2476,6 +2538,47 @@ Automatic export of backlinks
|
||||
)
|
||||
#+end_src
|
||||
|
||||
Create Org-Roam file from heading ([[https://ag91.github.io/blog/2020/11/12/write-org-roam-notes-via-elisp/][link]])
|
||||
#+begin_src emacs-lisp
|
||||
(defun tdh/make-roam-filepath (title)
|
||||
"Make filename from note TITLE."
|
||||
(concat
|
||||
org-roam-directory
|
||||
(org-roam--title-to-slug title)
|
||||
".org"))
|
||||
|
||||
(defun tdh/insert-org-roam-file (file-path title text)
|
||||
"Insert org roam file in FILE-PATH with TITLE, LINKS, SOURCES, TEXT, QUOTE."
|
||||
(with-temp-file file-path
|
||||
(insert
|
||||
"#+TITLE: " title "\n"
|
||||
"#+SETUPFILE: ./setup/org-setup-file.org\n"
|
||||
"#+HUGO_SECTION: zettels\n"
|
||||
"\n"
|
||||
"- Tags ::\n"
|
||||
"\n"
|
||||
text
|
||||
"\n"
|
||||
"\n"
|
||||
"* Bibliography :ignore:\n"
|
||||
"bibliography:./biblio/references.bib"
|
||||
"\n"
|
||||
)))
|
||||
|
||||
|
||||
(defun tdh/convert-task-to-org-note ()
|
||||
"Convert a task in a `org-roam' note."
|
||||
(interactive)
|
||||
(let* ((heading (org-get-heading t t t t))
|
||||
(body (org-get-entry))
|
||||
(filepath (tdh/make-roam-filepath heading)))
|
||||
(tdh/insert-org-roam-file
|
||||
filepath
|
||||
heading
|
||||
body)
|
||||
(find-file filepath)))
|
||||
#+end_src
|
||||
|
||||
** Helm-Bibtex ([[https://github.com/tmalsburg/helm-bibtex][link]])
|
||||
#+begin_src emacs-lisp
|
||||
(use-package! helm-bibtex
|
||||
@@ -2662,7 +2765,8 @@ Provides nice functions such as:
|
||||
(use-package! citeproc-org
|
||||
:after org
|
||||
:config
|
||||
(citeproc-org-setup))
|
||||
(citeproc-org-setup)
|
||||
(setq citeproc-org-html-backends '(html)))
|
||||
#+end_src
|
||||
|
||||
* LaTeX
|
||||
@@ -3081,27 +3185,86 @@ Choose account label to feed msmtp -a option based on From header in Message buf
|
||||
:END:
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Vimrc
|
||||
(package! vimrc-mode)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Automatic toggling of LaTeX fragments
|
||||
(package! org-fragtog)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; custom blocks and links for org-mode
|
||||
(package! org-special-block-extras)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Nice theme
|
||||
(package! poet-theme)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Major mode for SPICE
|
||||
(package! spice-mode)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Import file to Org-mode
|
||||
(package! org-pandoc-import
|
||||
:recipe (:host github
|
||||
:repo "tecosaur/org-pandoc-import"
|
||||
:files ("*.el" "filters" "preprocessors")))
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Renders Org-mode citations in CSL styles
|
||||
(package! citeproc-org)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Org-mode modules for citations, cross-references, bibliographies
|
||||
(package! org-ref)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Alert notifications for org-agenda
|
||||
(package! org-wild-notifier)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Display Google Calendar in org-calendar
|
||||
(package! org-gcal)
|
||||
;; (package! ox-latex-subfigure
|
||||
;; :recipe (:host github :repo "linktohack/ox-latex-subfigure"))
|
||||
;; (package! matlab-mode)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Turn table into subfigure
|
||||
(package! ox-latex-subfigure
|
||||
:recipe (:host github :repo "linktohack/ox-latex-subfigure"))
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Major Mode for Matlab
|
||||
(package! matlab-mode
|
||||
:recipe (:host github :repo "matlab-mode/mirror"))
|
||||
(package! org-ref)
|
||||
(package! citeproc-org)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Org-mode query language
|
||||
(package! org-ql)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Display Org Mode priorities as custom strings
|
||||
(package! org-fancy-priorities)
|
||||
(package! evil-escape :disable t)
|
||||
(package! dired-narrow)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
;; Web Server
|
||||
(package! web-server)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
;; Don't use this default package in Doom
|
||||
(package! evil-escape :disable t)
|
||||
#+end_src
|
||||
|
||||
Reference in New Issue
Block a user