Update --latex

This commit is contained in:
Marcus Kammer 2023-08-25 16:38:06 +02:00
parent ab7cb45203
commit 69ab45b35f
Signed by: marcuskammer
GPG key ID: C374817BE285268F

View file

@ -1,5 +1,7 @@
;; Org-mode LaTeX export settings
(require 'ox-latex)
;; Add custom LaTeX packages
(setq org-latex-packages-alist '(("" "listings")
("" "booktabs")
("AUTO" "polyglossia" t ("xelatex" "lualatex"))
@ -7,14 +9,18 @@
("" "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")
@ -27,8 +33,10 @@
("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"
@ -52,6 +60,21 @@
("\\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
(use-package tex-mode
:ensure auctex
:mode ("\\.tex\\$" . latex-mode)
:custom
(TeX-auto-save t) ; Enable auto-save
(TeX-electric-math (cons "$" "$")) ; Shortcut for math mode
(TeX-view-program-selection '((output-pdf "Evince"))) ; PDF viewer
(TeX-source-correlate-start-server t) ; Enable source-correlate
(TeX-master nil) ; Default master file
(TeX-engine 'xetex) ; Set engine to XeTeX
(TeX-command-extra-options "-shell-escape")) ; Allow shell escape