Many updates
This commit is contained in:
parent
7b07fbd319
commit
a33100a400
5 changed files with 247 additions and 313 deletions
123
bundle/bundle--general.el
Normal file
123
bundle/bundle--general.el
Normal file
|
@ -0,0 +1,123 @@
|
|||
(tool-bar-mode -1)
|
||||
(menu-bar-mode -1)
|
||||
(scroll-bar-mode -1)
|
||||
(horizontal-scroll-bar-mode -1)
|
||||
(global-hl-line-mode 1)
|
||||
(display-time-mode 1)
|
||||
(global-prettify-symbols-mode -1)
|
||||
(set-fringe-mode 10)
|
||||
(setq display-time-format " W%V %a %d %b %Y %R %z")
|
||||
(setq display-time-24hr-format t)
|
||||
|
||||
;; Cursor and mouse
|
||||
(column-number-mode 1)
|
||||
(mouse-wheel-mode 1)
|
||||
(blink-cursor-mode -1)
|
||||
|
||||
(setq ispell-program-name "hunspell")
|
||||
(setq grep-command "grep -i -nH -e ")
|
||||
|
||||
(when (eq system-type 'gnu/linux)
|
||||
(setq shell-file-name "/bin/bash")
|
||||
(setq tex-shell-file-name "/bin/bash"))
|
||||
|
||||
;; Files and sessions
|
||||
(setq auto-save-timeout 60)
|
||||
|
||||
;; Tabs, spaces, lines and parenthesis
|
||||
(show-paren-mode 1)
|
||||
(setq indent-tabs-mode nil)
|
||||
(setq line-spacing nil)
|
||||
(setq make-backup-files nil)
|
||||
|
||||
(setq tab-width 4)
|
||||
(setq sentence-end-double-space nil)
|
||||
(setq next-line-add-newlines t)
|
||||
(setq require-final-newline t)
|
||||
|
||||
;; Miscellaneous
|
||||
(require 'cl-lib)
|
||||
(setq default-major-mode 'text-mode)
|
||||
(setq inhibit-startup-buffer-menu t inhibit-startup-screen t)
|
||||
(put 'narrow-to-region 'disabled nil)
|
||||
(put 'narrow-to-page 'disabled nil)
|
||||
(add-hook 'text-mode-hook 'turn-on-auto-fill)
|
||||
(defalias 'yes-or-no-p 'y-or-n-p)
|
||||
|
||||
(add-hook 'after-save-hook
|
||||
'executable-make-buffer-file-executable-if-script-p)
|
||||
|
||||
(global-set-key (kbd "M-i") 'imenu)
|
||||
(global-set-key (kbd "C-x C-b") 'ibuffer-list-buffers)
|
||||
;;(global-set-key (kbd "M-[") 'tab-bar-history-back)
|
||||
;;(global-set-key (kbd "M-]") 'tab-bar-history-forward)
|
||||
|
||||
(add-hook 'diary-display-hook 'fancy-diary-display)
|
||||
(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
|
||||
(add-hook 'write-file-hooks 'delete-trailing-whitespace)
|
||||
(add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)
|
||||
(add-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files)
|
||||
(setq compilation-ask-about-save nil)
|
||||
(setq vc-handled-backends '(Git Hg)) ;; Only use Git and Hg for VC
|
||||
|
||||
(setq horizontal-scroll-bar nil)
|
||||
(setq vertical-scroll-bar nil)
|
||||
|
||||
(setq default-frame-alist
|
||||
'((font . "MonoLisa-11")
|
||||
(width . 92)
|
||||
(height . 62)
|
||||
(alpha . 100)))
|
||||
|
||||
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((meta)) ((control) . text-scale)))
|
||||
|
||||
(require 'ido)
|
||||
(setq ido-enable-flex-matching t)
|
||||
(setq ido-everywhere t)
|
||||
(setq ido-create-new-buffer 'always)
|
||||
;(setq ido-file-extensions-order '(".org" ".lisp" ".py" ".txt" ".el" ".epub"))
|
||||
(ido-mode t)
|
||||
|
||||
(fido-mode 1) ; replace icomplete mode
|
||||
;;;
|
||||
|
||||
;;; bundle--encoding
|
||||
;; UTF-8 FTW
|
||||
(prefer-coding-system 'utf-8-unix)
|
||||
(set-default-coding-systems 'utf-8-unix)
|
||||
(set-terminal-coding-system 'utf-8)
|
||||
(set-keyboard-coding-system 'utf-8)
|
||||
(setq default-buffer-file-coding-system 'utf-8-unix)
|
||||
(setenv "PYTHONIOENCODING" "UTF-8")
|
||||
|
||||
;;; bundle--customfile
|
||||
(use-package doom-themes
|
||||
:init
|
||||
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
|
||||
doom-themes-enable-italic t) ; if nil, italics is universally disabled
|
||||
(load-theme 'doom-one t))
|
||||
|
||||
(when (eq system-type 'gnu/linux)
|
||||
(setq custom-file "~/.emacs.d/bundle/custom_gnu.el"
|
||||
browse-url-secondary-browser-function 'browse-url-firefox))
|
||||
|
||||
(when (eq system-type 'windows-nt)
|
||||
(setq custom-file "~/.emacs.d/bundle/custom_win32.el")
|
||||
(when (string= (system-name) "EVG02667NB")
|
||||
(cd "d:/opt")
|
||||
(setq custom-file "~/.emacs.d/bundle/custom_win32_EVG02667NB.el")))
|
||||
|
||||
(load custom-file :noerror)
|
||||
|
||||
(setq package-archives
|
||||
'(("melpa" . "https://melpa.org/packages/")
|
||||
("org" . "https://orgmode.org/elpa/")
|
||||
("elpa" . "https://elpa.gnu.org/packages/")
|
||||
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
|
||||
(package-initialize)
|
||||
(unless package-archive-contents
|
||||
(package-refresh-contents))
|
||||
(unless (package-installed-p 'use-package)
|
||||
(package-install 'use-package))
|
||||
(require 'use-package)
|
||||
(setq use-package-always-ensure t)
|
|
@ -89,7 +89,38 @@
|
|||
(org-agenda-custom-commands
|
||||
'(("p" "Projects"
|
||||
((tags "PROJECT")))))
|
||||
(org-latex-packages-alist
|
||||
'(("" "listings")
|
||||
("" "booktabs")
|
||||
("AUTO" "polyglossia" t ("xelatex" "lualatex"))
|
||||
("" "grffile")
|
||||
("" "unicode-math")
|
||||
("" "xcolor")))
|
||||
;; Define the process to convert Org to PDF using XeLaTeX
|
||||
(org-latex-pdf-process '("latexmk -xelatex -shell-escape -quiet -f %f"))
|
||||
;; Set the compiler to XeLaTeX
|
||||
(org-latex-compiler "xelatex")
|
||||
;; Enable listings and other table-related features
|
||||
(org-latex-listings t)
|
||||
(org-latex-tables-booktabs t)
|
||||
(org-latex-images-centered t)
|
||||
;; Customize the appearance of listings (source code blocks)
|
||||
(org-latex-listings-options
|
||||
'(("basicstyle" "\\ttfamily")
|
||||
("showstringspaces" "false")
|
||||
("keywordstyle" "\\color{blue}\\textbf")
|
||||
("commentstyle" "\\color{gray}")
|
||||
("stringstyle" "\\color{green!70!black}")
|
||||
("stringstyle" "\\color{red}")
|
||||
("frame" "single")
|
||||
("numbers" "left")
|
||||
("numberstyle" "\\ttfamily")
|
||||
("columns" "fullflexible")))
|
||||
(org-latex-inputenc-alist '((\"utf8\" . \"utf8x\")))
|
||||
:config
|
||||
(if (eq system-name 'windows-nt)
|
||||
(setq org-babel-python-command "python")
|
||||
(setq org-babel-python-command "python3"))
|
||||
(setq time-stamp-active t
|
||||
time-stamp-start "#\\+[dD][aA][tT][eE]:[ \t]*"
|
||||
time-stamp-end "$"
|
||||
|
@ -124,6 +155,32 @@
|
|||
(overlay-put ov 'line-spacing (1- line-height))))))))
|
||||
(add-hook 'org-agenda-finalize-hook #'org-agenda-log-mode-colorize-block))
|
||||
|
||||
;; Define custom LaTeX class with specific formatting
|
||||
(with-eval-after-load 'ox-latex
|
||||
(add-to-list 'org-latex-classes
|
||||
'("koma-general"
|
||||
"\\documentclass[a4paper,10pt,captions=tableheading,twoside=false]{scrartcl}
|
||||
\\linespread{1.25}
|
||||
\\usepackage{fontspec}
|
||||
\\defaultfontfeatures{Mapping=tex-text, RawFeature={+zero}}
|
||||
\\setmainfont{Noto Sans}[BoldFont=*-Medium,ItalicFont=*-Italic]
|
||||
\\setsansfont{Noto Sans}[BoldFont=*-Medium,ItalicFont=*-Italic]
|
||||
\\setmonofont{Noto Sans Mono}[BoldFont=*-Medium,Scale=0.8]
|
||||
\\usepackage{geometry}
|
||||
\\geometry{a4paper,left=2cm,right=2cm,top=1.6cm,bottom=1.6cm}
|
||||
\\usepackage{fancyhdr}
|
||||
\\pagestyle{fancy}
|
||||
\\fancyhf{}
|
||||
\\fancyhead[L]{\\leftmark} % Left header
|
||||
\\fancyhead[R]{\\thepage} % Right header"
|
||||
("\\section{%s}" . "\\section*{%s}")
|
||||
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||
|
||||
(setq org-latex-default-class "koma-general"))
|
||||
|
||||
(setq org-html-protect-char-alist
|
||||
'(("&" . "&")
|
||||
("<" . "<")
|
||||
|
@ -296,7 +353,7 @@
|
|||
;; and any associated tasks. This can be particularly useful for end-of-year
|
||||
;; reviews or for maintaining a portfolio of accomplishments.
|
||||
(add-to-list 'org-capture-templates
|
||||
`("v" "Achievement" entry (file+datetree "achievements.org")
|
||||
`("v" "Achievement" entry (file+olp+datetree "achievements.org")
|
||||
,(concat "* %^{Achievement Title} :ACHIEVEMENT:\n"
|
||||
":PROPERTIES:\n"
|
||||
":Project: %^{Project}\n"
|
||||
|
@ -380,6 +437,7 @@
|
|||
(use-package org-roam
|
||||
:after org
|
||||
:init
|
||||
(setq org-roam-db-autosync-mode t)
|
||||
(setq org-roam-v2-ack t)
|
||||
(setq org-roam-db-location "~/org-roam.db")
|
||||
(require 'org-roam-dailies)
|
||||
|
|
|
@ -1,20 +1,5 @@
|
|||
;; PACKAGE
|
||||
(require 'package)
|
||||
(setq package-archives
|
||||
'(("melpa" . "https://melpa.org/packages/")
|
||||
("org" . "https://orgmode.org/elpa/")
|
||||
("elpa" . "https://elpa.gnu.org/packages/")
|
||||
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
|
||||
(package-initialize)
|
||||
(unless package-archive-contents
|
||||
(package-refresh-contents))
|
||||
(unless (package-installed-p 'use-package)
|
||||
(package-install 'use-package))
|
||||
(require 'use-package)
|
||||
(setq use-package-always-ensure t)
|
||||
|
||||
(load "bundle--gui")
|
||||
|
||||
(add-hook 'emacs-lisp-mode-hook (lambda () (prettify-symbols-mode)))
|
||||
|
||||
(use-package htmlize)
|
||||
|
@ -304,7 +289,33 @@
|
|||
(defun g-init-lisp-font-lock ()
|
||||
(setq font-lock-defaults g-cl-font-lock-defaults))
|
||||
|
||||
(add-hook 'lisp-mode-hook 'g-init-lisp-font-lock))
|
||||
(add-hook 'lisp-mode-hook 'g-init-lisp-font-lock)
|
||||
(defvar mk/hyperspec-dir-locations
|
||||
'("d:/visua/projects/personal/lisp-docs/HyperSpec-7-0/HyperSpec/"
|
||||
"~/projects/personal/lisp-docs/HyperSpec-7-0/HyperSpec/"
|
||||
"~/lisp-docs/HyperSpec-7-0/HyperSpec/"
|
||||
"~/sites/HyperSpec/")
|
||||
"List of possible locations where the local HyperSpec could reside.")
|
||||
|
||||
(defun mk/find-dir (x)
|
||||
"Recursively search for a valid directory from a list X of directories.
|
||||
Returns the first valid directory, or nil if none found."
|
||||
(cond ((null x) nil)
|
||||
((file-directory-p (car x)) (car x))
|
||||
(t (mk/find-dir (cdr x)))))
|
||||
|
||||
(defun mk/hyperspec-dir ()
|
||||
"Finds and returns the URI of the local HyperSpec directory.
|
||||
Uses `mk/hyperspec-dir-locations' to find the directory."
|
||||
(let ((dir-prefix (if (eq system-type 'windows-nt)
|
||||
"file:///" ; windows needs three slashes
|
||||
"file://"))
|
||||
(dir (mk/find-dir mk/hyperspec-dir-locations)))
|
||||
(if dir
|
||||
(concat dir-prefix (expand-file-name dir))
|
||||
nil)))
|
||||
|
||||
(setq common-lisp-hyperspec-root (mk/hyperspec-dir)))
|
||||
|
||||
(use-package cc-mode
|
||||
;; https://www.gnu.org/prep/standards/html_node/Writing-C.html
|
||||
|
@ -564,10 +575,41 @@
|
|||
|
||||
(use-package plantuml-mode
|
||||
:defer t
|
||||
:custom
|
||||
(plantuml-default-exec-mode 'jar)
|
||||
:config
|
||||
(when (eq system-type 'windows-nt)
|
||||
(setq plantuml-default-exec-mode 'jar
|
||||
plantuml-jar-path "~/AppData/Local/Programs/plantuml/plantuml.jar")))
|
||||
(let ((jar-path "~/AppData/Local/Programs/plantuml/plantuml.jar"))
|
||||
(setq plantuml-jar-path jar-path
|
||||
org-plantuml-jar-path jar-path))))
|
||||
|
||||
(use-package tex-mode
|
||||
:defer t
|
||||
:ensure auctex
|
||||
:hook ((LaTeX-mode . turn-on-reftex)
|
||||
(LaTeX-mode . flyspell-mode)
|
||||
(LaTeX-mode . LaTeX-math-mode))
|
||||
:config
|
||||
;; TeX mode settings for editing .tex files
|
||||
(setq TeX-auto-save t) ; Enable auto-save
|
||||
(setq TeX-electric-math (cons "$" "$")) ; Shortcut for math mode
|
||||
(if (eq system-type 'windows-nt)
|
||||
(progn
|
||||
(setq TeX-view-program-list '(("SumatraPDF" "~/AppData/Local/SumatraPDF/SumatraPDF.exe %o")))
|
||||
(setq TeX-view-program-selection '((output-pdf "SumatraPDF"))))
|
||||
(setq TeX-view-program-selection '((output-pdf "Evince"))))
|
||||
(setq TeX-source-correlate-start-server t) ; Enable source-correlate
|
||||
(setq TeX-master nil) ; Default master file
|
||||
(setq TeX-engine 'xetex) ; Set engine to XeTeX
|
||||
(setq TeX-command-extra-options "-shell-escape")) ; Allow shell escape
|
||||
|
||||
(use-package epg
|
||||
:ensure nil
|
||||
:config
|
||||
(when (eq system-name 'windows-nt)
|
||||
(setq epg-gpg-home-directory "~/AppData/Roaming/gnupg"
|
||||
epg-gpg-program "c:/Program Files (x86)/GnuPG/bin/gpg.exe"
|
||||
epg-gpgconf-program "c:/Program Files (x86)/GnuPG/bin/gpgconf.exe")))
|
||||
|
||||
(use-package gptel)
|
||||
|
||||
|
@ -575,6 +617,3 @@
|
|||
(which-key-mode)
|
||||
|
||||
(use-package restclient)
|
||||
|
||||
(load "bundle--irc")
|
||||
(load "bundle--news")
|
||||
|
|
|
@ -26,9 +26,6 @@
|
|||
'(display-line-numbers-grow-only t)
|
||||
'(doc-view-resolution 300)
|
||||
'(doom-modeline-env-version nil)
|
||||
'(epg-gpg-home-directory "~/AppData/Roaming/gnupg")
|
||||
'(epg-gpg-program "c:/Program Files (x86)/GnuPG/bin/gpg.exe")
|
||||
'(epg-gpgconf-program "c:/Program Files (x86)/GnuPG/bin/gpgconf.exe")
|
||||
'(flycheck-color-mode-line-face-to-color 'mode-line-buffer-id)
|
||||
'(frame-background-mode 'dark)
|
||||
'(hl-todo-keyword-faces
|
||||
|
@ -57,8 +54,6 @@
|
|||
'(org-directory "d:/UserData/marcus.kammer/OneDrive - Siemens AG/org/")
|
||||
'(org-modules
|
||||
'(ol-bbdb ol-bibtex ol-docview ol-eww ol-gnus ol-info ol-irc ol-mhe ol-rmail org-tempo ol-w3m))
|
||||
'(org-plantuml-jar-path "~/AppData/Local/Programs/plantuml/plantuml.jar")
|
||||
'(org-roam-db-autosync-mode t)
|
||||
'(org-roam-directory "d:/UserData/marcus.kammer/OneDrive - Siemens AG/org/")
|
||||
'(package-selected-packages
|
||||
'(ob-restclient restclient which-key auctex ace-window jabber js2-mode gptel elpher plantuml-mode htmlize hyperbole typescript-mode markdown-mode csv-mode yaml-mode magit nim-mode kotlin-mode nano-theme mastodon mpv ob-http powershell ox-reveal org-web-tools org-tree-slide org-roam elfeed erc-image go-translate simple-httpd slime racket-mode web-mode go-mode eglot nov shrface smartparens emojify olivetti rainbow-delimiters helpful doom-modeline doom-themes all-the-icons-dired all-the-icons))
|
||||
|
@ -66,9 +61,6 @@
|
|||
'(ring-bell-function 'ignore)
|
||||
'(scroll-step 5)
|
||||
'(sql-mysql-options '("-C" "-t" "-f" "-n"))
|
||||
'(sql-mysql-program "c:/Program Files/MariaDB 10.11/bin/mysql")
|
||||
'(sql-sqlite-program
|
||||
"~/AppData/Local/Programs/sqlite-tools-win32-x86-3410200/sqlite3.exe")
|
||||
'(tetris-x-colors
|
||||
[[229 192 123]
|
||||
[97 175 239]
|
||||
|
|
288
init.el
288
init.el
|
@ -2,292 +2,14 @@
|
|||
(require 'server)
|
||||
(or (eq (server-running-p) t)
|
||||
(server-start))
|
||||
(tool-bar-mode -1)
|
||||
(menu-bar-mode -1)
|
||||
(scroll-bar-mode -1)
|
||||
(horizontal-scroll-bar-mode -1)
|
||||
(global-hl-line-mode 1)
|
||||
(display-time-mode 1)
|
||||
(global-prettify-symbols-mode -1)
|
||||
(set-fringe-mode 10)
|
||||
(setq display-time-format " W%V %a %d %b %Y %R %z")
|
||||
(setq display-time-24hr-format t)
|
||||
|
||||
;; Cursor and mouse
|
||||
(column-number-mode 1)
|
||||
(mouse-wheel-mode 1)
|
||||
(blink-cursor-mode -1)
|
||||
|
||||
(setq ispell-program-name "hunspell")
|
||||
(setq grep-command "grep -i -nH -e ")
|
||||
|
||||
(when (eq system-type 'gnu/linux)
|
||||
(setq shell-file-name "/bin/bash")
|
||||
(setq tex-shell-file-name "/bin/bash"))
|
||||
|
||||
;; Files and sessions
|
||||
(setq auto-save-timeout 60)
|
||||
|
||||
;; Tabs, spaces, lines and parenthesis
|
||||
(show-paren-mode 1)
|
||||
(setq indent-tabs-mode nil)
|
||||
(setq line-spacing nil)
|
||||
(setq make-backup-files nil)
|
||||
|
||||
(setq tab-width 4)
|
||||
(setq sentence-end-double-space nil)
|
||||
(setq next-line-add-newlines t)
|
||||
(setq require-final-newline t)
|
||||
|
||||
;; Miscellaneous
|
||||
(require 'cl-lib)
|
||||
(setq default-major-mode 'text-mode)
|
||||
(setq inhibit-startup-buffer-menu t inhibit-startup-screen t)
|
||||
(put 'narrow-to-region 'disabled nil)
|
||||
(put 'narrow-to-page 'disabled nil)
|
||||
(add-hook 'text-mode-hook 'turn-on-auto-fill)
|
||||
(defalias 'yes-or-no-p 'y-or-n-p)
|
||||
|
||||
;; ;; Mode line
|
||||
;; (setq mode-line-format
|
||||
;; '((""
|
||||
;; mode-line-modified
|
||||
;; mode-line-frame-control "%b %z%n "
|
||||
;; mode-name
|
||||
;; vc-mode
|
||||
;; " "
|
||||
;; mode-line-position
|
||||
;; mode-line-misc-info
|
||||
;; minor-mode-alist
|
||||
;; mode-line-end-spaces "%-"
|
||||
;; )))
|
||||
|
||||
;; Disable line numbers in modes
|
||||
;; (dolist (mode '(org-mode-hook term-mode-hook shell-mode-hook eshell-mode-hook))
|
||||
;; (add-hook mode (lambda () (display-line-numbers-mode 0))))
|
||||
|
||||
(add-hook 'after-save-hook
|
||||
'executable-make-buffer-file-executable-if-script-p)
|
||||
|
||||
(global-set-key (kbd "M-i") 'imenu)
|
||||
(global-set-key (kbd "C-x C-b") 'ibuffer-list-buffers)
|
||||
;;(global-set-key (kbd "M-[") 'tab-bar-history-back)
|
||||
;;(global-set-key (kbd "M-]") 'tab-bar-history-forward)
|
||||
|
||||
(add-hook 'diary-display-hook 'fancy-diary-display)
|
||||
(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
|
||||
(add-hook 'write-file-hooks 'delete-trailing-whitespace)
|
||||
(add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)
|
||||
(add-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files)
|
||||
(setq compilation-ask-about-save nil)
|
||||
(setq vc-handled-backends '(Git Hg)) ;; Only use Git and Hg for VC
|
||||
|
||||
(setq horizontal-scroll-bar nil)
|
||||
(setq vertical-scroll-bar nil)
|
||||
|
||||
(setq default-frame-alist
|
||||
'((font . "MonoLisa-11")
|
||||
(width . 92)
|
||||
(height . 62)
|
||||
(alpha . 100)))
|
||||
|
||||
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((meta)) ((control) . text-scale)))
|
||||
|
||||
(require 'ido)
|
||||
(setq ido-enable-flex-matching t)
|
||||
(setq ido-everywhere t)
|
||||
(setq ido-create-new-buffer 'always)
|
||||
;(setq ido-file-extensions-order '(".org" ".lisp" ".py" ".txt" ".el" ".epub"))
|
||||
(ido-mode t)
|
||||
|
||||
(fido-mode 1) ; replace icomplete mode
|
||||
;;;
|
||||
|
||||
;;; bundle--encoding
|
||||
;; UTF-8 FTW
|
||||
(prefer-coding-system 'utf-8-unix)
|
||||
(set-default-coding-systems 'utf-8-unix)
|
||||
(set-terminal-coding-system 'utf-8)
|
||||
(set-keyboard-coding-system 'utf-8)
|
||||
(setq default-buffer-file-coding-system 'utf-8-unix)
|
||||
(setenv "PYTHONIOENCODING" "UTF-8")
|
||||
|
||||
(use-package tramp
|
||||
:ensure nil
|
||||
:config
|
||||
(if (eq system-name 'windows-nt)
|
||||
(setq tramp-default-method "sshx")
|
||||
(setq tramp-default-method "ssh")))
|
||||
|
||||
;;; bundle--customfile
|
||||
(use-package doom-themes
|
||||
:init
|
||||
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
|
||||
doom-themes-enable-italic t) ; if nil, italics is universally disabled
|
||||
(load-theme 'doom-one t))
|
||||
|
||||
(defvar mk/hyperspec-dir-locations
|
||||
'("d:/visua/projects/personal/lisp-docs/HyperSpec-7-0/HyperSpec/"
|
||||
"~/projects/personal/lisp-docs/HyperSpec-7-0/HyperSpec/"
|
||||
"~/lisp-docs/HyperSpec-7-0/HyperSpec/"
|
||||
"~/sites/HyperSpec/")
|
||||
"List of possible locations where the local HyperSpec could reside.")
|
||||
|
||||
(defun mk/find-dir (x)
|
||||
"Recursively search for a valid directory from a list X of directories.
|
||||
Returns the first valid directory, or nil if none found."
|
||||
(cond ((null x) nil)
|
||||
((file-directory-p (car x)) (car x))
|
||||
(t (mk/find-dir (cdr x)))))
|
||||
|
||||
(defun mk/hyperspec-dir ()
|
||||
"Finds and returns the URI of the local HyperSpec directory.
|
||||
Uses `mk/hyperspec-dir-locations' to find the directory."
|
||||
(let ((dir-prefix (if (eq system-type 'windows-nt)
|
||||
"file:///" ; windows needs three slashes
|
||||
"file://"))
|
||||
(dir (mk/find-dir mk/hyperspec-dir-locations)))
|
||||
(if dir
|
||||
(concat dir-prefix (expand-file-name dir))
|
||||
nil)))
|
||||
|
||||
(setq common-lisp-hyperspec-root (mk/hyperspec-dir))
|
||||
|
||||
;; OS SETTINGS
|
||||
(when (eq system-type 'gnu/linux)
|
||||
(setq custom-file "~/.emacs.d/bundle/custom_gnu.el"
|
||||
browse-url-secondary-browser-function 'browse-url-firefox))
|
||||
|
||||
(when (eq system-type 'windows-nt)
|
||||
(setq custom-file "~/.emacs.d/bundle/custom_win32.el")
|
||||
(setq org-babel-python-command "python")
|
||||
(when (string= (system-name) "EVG02667NB")
|
||||
(cd "d:/opt")
|
||||
(setq custom-file "~/.emacs.d/bundle/custom_win32_EVG02667NB.el")))
|
||||
|
||||
;; CUSTOM_FILE
|
||||
(load custom-file :noerror)
|
||||
;;;
|
||||
|
||||
(load "bundle--general")
|
||||
(load "bundle--gui")
|
||||
(load "bundle--package")
|
||||
(load "bundle--irc")
|
||||
(load "bundle--news")
|
||||
(load "bundle--calendar")
|
||||
(load "bundle--email")
|
||||
(load "bundle--org")
|
||||
(load "bundle--ux")
|
||||
|
||||
;;; bundle--latex.el --- Configuration for Org-mode LaTeX export and AUCTeX
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This file contains configurations for exporting Org-mode files to LaTeX
|
||||
;; PDFs using XeLaTeX. It sets up custom packages, table settings, and source
|
||||
;; code listings. Also, it includes settings for AUCTeX package for enhanced
|
||||
;; .tex file editing.
|
||||
;;
|
||||
;; Features:
|
||||
;; - Uses the XeLaTeX compiler for PDF generation.
|
||||
;; - Sets up various LaTeX packages like 'listings', 'booktabs', 'xcolor', etc.
|
||||
;; - Provides custom LaTeX class based on KOMA-script for specific formatting.
|
||||
;; - Enables SumatraPDF for PDF viewing on Windows, and Evince on other systems.
|
||||
;;
|
||||
;; Installation:
|
||||
;; Add this file to your load-path and then add `(require 'bundle--latex)`
|
||||
;; to your init.el file.
|
||||
;;
|
||||
;; Usage:
|
||||
;; Simply save this configuration and restart Emacs or re-evaluate the buffer.
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Org-mode LaTeX export settings
|
||||
(require 'ox-latex)
|
||||
|
||||
;; Add custom LaTeX packages
|
||||
(setq org-latex-packages-alist '(("" "listings")
|
||||
("" "booktabs")
|
||||
("AUTO" "polyglossia" t ("xelatex" "lualatex"))
|
||||
("" "grffile")
|
||||
("" "unicode-math")
|
||||
("" "xcolor")))
|
||||
|
||||
;; Define the process to convert Org to PDF using XeLaTeX
|
||||
(setq org-latex-pdf-process '("latexmk -xelatex -shell-escape -quiet -f %f"))
|
||||
|
||||
;; Set the compiler to XeLaTeX
|
||||
(setq org-latex-compiler "xelatex")
|
||||
|
||||
;; Enable listings and other table-related features
|
||||
(setq org-latex-listings t)
|
||||
(setq org-latex-tables-booktabs t)
|
||||
(setq org-latex-images-centered t)
|
||||
|
||||
;; Customize the appearance of listings (source code blocks)
|
||||
(setq org-latex-listings-options
|
||||
'(("basicstyle" "\\ttfamily")
|
||||
("showstringspaces" "false")
|
||||
("keywordstyle" "\\color{blue}\\textbf")
|
||||
("commentstyle" "\\color{gray}")
|
||||
("stringstyle" "\\color{green!70!black}")
|
||||
("stringstyle" "\\color{red}")
|
||||
("frame" "single")
|
||||
("numbers" "left")
|
||||
("numberstyle" "\\ttfamily")
|
||||
("columns" "fullflexible")))
|
||||
|
||||
;; Set the input encoding
|
||||
(setq org-latex-inputenc-alist '((\"utf8\" . \"utf8x\")))
|
||||
|
||||
;; Define custom LaTeX class with specific formatting
|
||||
(with-eval-after-load 'ox-latex
|
||||
(add-to-list 'org-latex-classes
|
||||
'("koma-general"
|
||||
"\\documentclass[a4paper,10pt,captions=tableheading,twoside=false]{scrartcl}
|
||||
\\linespread{1.25}
|
||||
\\usepackage{fontspec}
|
||||
\\defaultfontfeatures{Mapping=tex-text, RawFeature={+zero}}
|
||||
\\setmainfont{Noto Sans}[BoldFont=*-Medium,ItalicFont=*-Italic]
|
||||
\\setsansfont{Noto Sans}[BoldFont=*-Medium,ItalicFont=*-Italic]
|
||||
\\setmonofont{Noto Sans Mono}[BoldFont=*-Medium,Scale=0.8]
|
||||
\\usepackage{geometry}
|
||||
\\geometry{a4paper,left=2cm,right=2cm,top=1.6cm,bottom=1.6cm}
|
||||
\\usepackage{fancyhdr}
|
||||
\\pagestyle{fancy}
|
||||
\\fancyhf{}
|
||||
\\fancyhead[L]{\\leftmark} % Left header
|
||||
\\fancyhead[R]{\\thepage} % Right header"
|
||||
("\\section{%s}" . "\\section*{%s}")
|
||||
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
|
||||
|
||||
;; Set default LaTeX class
|
||||
(setq org-latex-default-class "koma-general")
|
||||
|
||||
;; Load KOMA letter support
|
||||
(eval-after-load 'ox '(require 'ox-koma-letter))
|
||||
|
||||
;; TeX mode settings for editing .tex files
|
||||
(setq TeX-auto-save t) ; Enable auto-save
|
||||
(setq TeX-electric-math (cons "$" "$")) ; Shortcut for math mode
|
||||
(if (eq system-type 'windows-nt)
|
||||
(progn
|
||||
(setq TeX-view-program-list '(("SumatraPDF" "~/AppData/Local/SumatraPDF/SumatraPDF.exe %o")))
|
||||
(setq TeX-view-program-selection '((output-pdf "SumatraPDF"))))
|
||||
(setq TeX-view-program-selection '((output-pdf "Evince"))))
|
||||
(setq TeX-source-correlate-start-server t) ; Enable source-correlate
|
||||
(setq TeX-master nil) ; Default master file
|
||||
(setq TeX-engine 'xetex) ; Set engine to XeTeX
|
||||
(setq TeX-command-extra-options "-shell-escape") ; Allow shell escape
|
||||
|
||||
(use-package tex-mode
|
||||
:defer t
|
||||
:ensure auctex
|
||||
:hook ((LaTeX-mode . turn-on-reftex)
|
||||
(LaTeX-mode . flyspell-mode)
|
||||
(LaTeX-mode . LaTeX-math-mode)))
|
||||
|
||||
;;; bundle--latex.el ends here
|
||||
|
||||
(load "bundle--calendar")
|
||||
(load "bundle--mk")
|
||||
(load "bundle--linux")
|
||||
|
|
Loading…
Add table
Reference in a new issue