summaryrefslogtreecommitdiff
path: root/emacs/inits/24-latex.el
diff options
context:
space:
mode:
authortslil clingman <>2024-05-27 20:19:08 +0200
committertslil clingman <>2024-05-27 20:19:08 +0200
commitb994a2704fd8248cbc83acc384bf73ea8bc3f224 (patch)
treed4db64cddcc339a4dbca61e8243c29f38e244ea2 /emacs/inits/24-latex.el
parentfb7ae216bf69bcab8984e22bc7e2a9a4bb9dcc86 (diff)
[emacs] minor changes
Diffstat (limited to 'emacs/inits/24-latex.el')
-rw-r--r--emacs/inits/24-latex.el202
1 files changed, 101 insertions, 101 deletions
diff --git a/emacs/inits/24-latex.el b/emacs/inits/24-latex.el
index 4922cf1..4b9e908 100644
--- a/emacs/inits/24-latex.el
+++ b/emacs/inits/24-latex.el
@@ -1,4 +1,4 @@
-;; Time-stamp: <2023-07-15 19h45 CEST (anker)>
+;; Time-stamp: <2024-05-27 20h16 CEST (83a9252e)>
(defvar latex-template-dir (expand-file-name "~/typeset/latex-templates"))
(defun prompt-latex-file-template ()
@@ -7,17 +7,17 @@ interactively. If neither, prompt to insert from a template
populated from the directory *latex-template-dir*"
(interactive)
(when (and (if (file-exists-p (buffer-file-name))
- (called-interactively-p 'interactive)
- t)
- (yes-or-no-p "Insert template?"))
+ (called-interactively-p 'interactive)
+ t)
+ (yes-or-no-p "Insert template?"))
(let* ((tfiles (directory-files latex-template-dir nil "\\.tex"))
- (template (completing-read "Select template: " tfiles nil t)))
+ (template (completing-read "Select template: " tfiles nil t)))
(when template
- (goto-char (point-min))
- (insert-file-contents (concat latex-template-dir "/" template))
- (search-forward "begin{document}")
- (forward-line)
- (save-buffer)))))
+ (goto-char (point-min))
+ (insert-file-contents (concat latex-template-dir "/" template))
+ (search-forward "begin{document}")
+ (forward-line)
+ (save-buffer)))))
(use-package cdm-mode
:load-path "~/.emacs.d/scripts/")
@@ -27,25 +27,25 @@ populated from the directory *latex-template-dir*"
(use-package latex
:ensure auctex
:bind (:map LaTeX-mode-map
- ("<" . LaTeX-insert-left-brace)
- ;; ("|" . LaTeX-insert-left-brace)
- ("'" . better-TeX-insert-single-quote)
- ;; ("TAB" . LaTeX-indent-line)
- ("M-TAB" . TeX-complete-symbol)
- ("M-q" . unfill-paragraph)
- ("C-c e" . LaTeX-environment)
- ("C-c C-d" . TeX-view))
+ ("<" . LaTeX-insert-left-brace)
+ ;; ("|" . LaTeX-insert-left-brace)
+ ("'" . better-TeX-insert-single-quote)
+ ;; ("TAB" . LaTeX-indent-line)
+ ("M-TAB" . TeX-complete-symbol)
+ ("M-q" . unfill-paragraph)
+ ("C-c e" . LaTeX-environment)
+ ("C-c C-d" . TeX-view))
:hook (LaTeX-mode . (lambda ()
- (latex-setup-visual-aesthetics)
- (latex-setup-text-environment)
- (latex-setup-special-minor-modes)
- (latex-setup-completions)
- (prompt-latex-file-template)))
+ (latex-setup-visual-aesthetics)
+ (latex-setup-text-environment)
+ (latex-setup-special-minor-modes)
+ (latex-setup-completions)
+ (prompt-latex-file-template)))
:init
(defun latex-setup-visual-aesthetics ()
(interactive)
- (variable-pitch-mode 1)
+ (variable-pitch-mode -1)
(auto-fill-mode -1)
(visual-line-mode)
(display-line-numbers-mode))
@@ -76,37 +76,37 @@ populated from the directory *latex-template-dir*"
(defun better-TeX-insert-single-quote ()
(interactive)
(let ((old-open TeX-open-quote)
- (old-close TeX-close-quote))
+ (old-close TeX-close-quote))
(unwind-protect (progn
- (setq TeX-open-quote "`"
- TeX-close-quote "'")
- (call-interactively 'TeX-insert-quote))
- (setq TeX-open-quote old-open
- TeX-close-quote old-close))))
+ (setq TeX-open-quote "`"
+ TeX-close-quote "'")
+ (call-interactively 'TeX-insert-quote))
+ (setq TeX-open-quote old-open
+ TeX-close-quote old-close))))
:config
(setq TeX-debug-bad-boxes t
- TeX-command-list '(("XeLaTeX" "xelatex %t"
- TeX-run-TeX nil (latex-mode doctex-mode) :help "Run XeLaTeX")
- ("TeX" "%(PDF)%(tex) %(file-line-error) %`%(extraopts) %S%(PDFout)%(mode)%' %t"
- TeX-run-TeX nil (plain-tex-mode ams-tex-mode texinfo-mode) :help "Run plain TeX")
- ("LaTeX" "%`%l%(mode)%' %T"
- TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX")
- ("Biber" "biber %s %(output-dir)" TeX-run-Biber nil
- (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Run Biber")
- ("BibTeX" "bibtex %s" TeX-run-BibTeX nil
- (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode context-mode) :help "Run BibTeX")
- ("View" "%V" TeX-run-discard-or-function t t :help "Run External Viewer")
- ("View internally" "(find-file \"%o\")" TeX-run-function nil t :help "Run Viewer")
- ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help "Spell-check the document")
- ("Clean" "TeX-clean" TeX-run-function nil t :help "Delete generated intermediate files")
- ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help "Delete generated intermediate and output files")
- ("Other" "" TeX-run-command t t :help "Run an arbitrary command")))
+ TeX-command-list '(("XeLaTeX" "xelatex %t"
+ TeX-run-TeX nil (latex-mode doctex-mode) :help "Run XeLaTeX")
+ ("TeX" "%(PDF)%(tex) %(file-line-error) %`%(extraopts) %S%(PDFout)%(mode)%' %t"
+ TeX-run-TeX nil (plain-tex-mode ams-tex-mode texinfo-mode) :help "Run plain TeX")
+ ("LaTeX" "%`%l%(mode)%' %T"
+ TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX")
+ ("Biber" "biber %s %(output-dir)" TeX-run-Biber nil
+ (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Run Biber")
+ ("BibTeX" "bibtex %s" TeX-run-BibTeX nil
+ (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode context-mode) :help "Run BibTeX")
+ ("View" "%V" TeX-run-discard-or-function t t :help "Run External Viewer")
+ ("View internally" "(find-file \"%o\")" TeX-run-function nil t :help "Run Viewer")
+ ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help "Spell-check the document")
+ ("Clean" "TeX-clean" TeX-run-function nil t :help "Delete generated intermediate files")
+ ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help "Delete generated intermediate and output files")
+ ("Other" "" TeX-run-command t t :help "Run an arbitrary command")))
(setq TeX-electric-sub-and-superscript t
- TeX-electric-math '("$" . "$")
- TeX-electric-escape nil
- LaTeX-electric-left-right-brace t)
+ TeX-electric-math '("$" . "$")
+ TeX-electric-escape nil
+ LaTeX-electric-left-right-brace t)
;; no idea why this is not a default ... ?
(push '("<" . ">") TeX-braces-association)
@@ -114,13 +114,13 @@ populated from the directory *latex-template-dir*"
(setq reftex-plug-into-AUCTeX t)
;; (setq-default TeX-master nil)
(setq TeX-auto-save t
- TeX-parse-self t
- TeX-PDF-mode t
- TeX-source-correlate-mode 'synctex
- TeX-view-program-selection '(((output-dvi style-pstricks) "dvips and gv")
- (output-dvi "xdvi")
- (output-pdf "Zathura")
- (output-html "xdg-open")))
+ TeX-parse-self t
+ TeX-PDF-mode t
+ TeX-source-correlate-mode 'synctex
+ TeX-view-program-selection '(((output-dvi style-pstricks) "dvips and gv")
+ (output-dvi "xdvi")
+ (output-pdf "Zathura")
+ (output-html "xdg-open")))
;; for PDF tools
;; (add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
@@ -130,50 +130,50 @@ populated from the directory *latex-template-dir*"
(use-package cdlatex
:ensure t
:bind (:map cdlatex-mode-map
- ("(" . nil)
- ("{" . nil)
- ("[" . nil)
- ("|" . nil)
- ("<" . nil)
- ("'" . nil)
- ("TAB" . cdlatex-tab)
- ;; ("C-c e" . cdlatex-environment)
- ("~" . cdlatex-math-modify)
- ("`" . cdlatex-math-symbol))
+ ("(" . nil)
+ ("{" . nil)
+ ("[" . nil)
+ ("|" . nil)
+ ("<" . nil)
+ ("'" . nil)
+ ("TAB" . cdlatex-tab)
+ ;; ("C-c e" . cdlatex-environment)
+ ("~" . cdlatex-math-modify)
+ ("`" . cdlatex-math-symbol))
:init
(setq cdlatex-math-modify-prefix ?~
- cdlatex-math-symbol-prefix ?`
- cdlatex-math-modify-alist '((?a "\\mathbb" nil t nil nil)
- (?c "\\mathcal" "\\textsc" t nil nil)
- (?v "\\texttt" "\\texttt" t nil nil)
- (?k "\\mathfrak" nil t nil nil)
- (?- "\\overline" nil t nil nil)
- (?_ "\\underline" nil t nil nil))
- cdlatex-math-symbol-alist '((?^ ("\\widehat{?}" "\\hat{?}"))
- (?' ("^{\\prime}" "\\prime"))
- (?* ("\\times" "\\otimes" "\\star"))
- (?+ ("+" "\\oplus"))
- (?- ("\\dashv" "\\vdash" "\\setminus"))
- (?. ("\\circ" "\\sq" "\\cdot"))
- (?0 ("\\emptyset" "\\circ"))
- (?< ("\\leftarrow" "\\leftharpoonup" "\\xleftarrow"))
- (?> ("\\to" "\\rightharpoonup" "\\xrightarrow"))
- (?B ("\\bullet"))
- (?C ("\\widecheck{?}" "\\check{?}"))
- (?f ("\\varphi" "\\phi"))
- (?F ("\\Phi" "\\Varphi"))
- (?M ("\\begin{bsmallmatrix}?\\end{bsmallmatrix}"))
- (?P ("\\Prod{?}" "\\Pi" "\\partial"))
- (?S ("\\Sigma" "\\Sum{?}" "\\arcsin"))
- (?\"("^{\\prime\\prime}" "\\prime\\prime"))
- (?a ("\\alpha" "\\cap" "\\sqcap"))
- (?c ("\\cat{?}" "\\catn{?}"))
- (?e ("\\varepsilon" "\\epsilon" "\\exp{?}"))
- (?i ("\\iota" "\\in"))
- (?j ("{\\id^{h}}_{?}" "{\\id^{v}}_{?}"))
- (?r ("\\rho" "\\varrho" "\\restrict{?}"))
- (?u ("\\upsilon" "\\cup" "\\sqcup"))
- (?y ("\\psi" "\\Psi"))
- (?{ ("\\subseteq" "\\subsetneq"))
- (?} ("\\supseteq" "\\supsetneq"))
- )))
+ cdlatex-math-symbol-prefix ?`
+ cdlatex-math-modify-alist '((?a "\\mathbb" nil t nil nil)
+ (?c "\\mathcal" "\\textsc" t nil nil)
+ (?v "\\texttt" "\\texttt" t nil nil)
+ (?k "\\mathfrak" nil t nil nil)
+ (?- "\\overline" nil t nil nil)
+ (?_ "\\underline" nil t nil nil))
+ cdlatex-math-symbol-alist '((?^ ("\\widehat{?}" "\\hat{?}"))
+ (?' ("^{\\prime}" "\\prime"))
+ (?* ("\\times" "\\otimes" "\\star"))
+ (?+ ("+" "\\oplus"))
+ (?- ("\\dashv" "\\vdash" "\\setminus"))
+ (?. ("\\circ" "\\sq" "\\cdot"))
+ (?0 ("\\emptyset" "\\circ"))
+ (?< ("\\leftarrow" "\\leftharpoonup" "\\xleftarrow"))
+ (?> ("\\to" "\\rightharpoonup" "\\xrightarrow"))
+ (?B ("\\bullet"))
+ (?C ("\\widecheck{?}" "\\check{?}"))
+ (?f ("\\varphi" "\\phi"))
+ (?F ("\\Phi" "\\Varphi"))
+ (?M ("\\begin{bsmallmatrix}?\\end{bsmallmatrix}"))
+ (?P ("\\Prod{?}" "\\Pi" "\\partial"))
+ (?S ("\\Sigma" "\\Sum{?}" "\\arcsin"))
+ (?\"("^{\\prime\\prime}" "\\prime\\prime"))
+ (?a ("\\alpha" "\\cap" "\\sqcap"))
+ (?c ("\\cat{?}" "\\catn{?}"))
+ (?e ("\\varepsilon" "\\epsilon" "\\exp{?}"))
+ (?i ("\\iota" "\\in"))
+ (?j ("{\\id^{h}}_{?}" "{\\id^{v}}_{?}"))
+ (?r ("\\rho" "\\varrho" "\\restrict{?}"))
+ (?u ("\\upsilon" "\\cup" "\\sqcup"))
+ (?y ("\\psi" "\\Psi"))
+ (?{ ("\\subseteq" "\\subsetneq"))
+ (?} ("\\supseteq" "\\supsetneq"))
+ )))