Emacs personal configuration
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

130 Zeilen
4.8KB

  1. ;;; package --- LaTeX
  2. ;;; Commentary:
  3. ;; https://piotrkazmierczak.com/2010/emacs-as-the-ultimate-latex-editor/
  4. ;;; Code:
  5. (setq TeX-auto-save t)
  6. (setq TeX-parse-self t)
  7. (setq TeX-save-query nil)
  8. ;;(setq TeX-PDF-mode t)
  9. ;; https://tex.stackexchange.com/a/50919/98213
  10. (setq-default TeX-master nil)
  11. (setq TeX-PDF-mode t); PDF mode (rather than DVI-mode)
  12. (add-hook 'TeX-mode-hook 'flyspell-mode); Enable Flyspell mode for TeX modes such as AUCTeX. Highlights all misspelled words.
  13. (add-hook 'emacs-lisp-mode-hook 'flyspell-prog-mode); Enable Flyspell program mode for emacs lisp mode, which highlights all misspelled words in comments and strings.
  14. (setq ispell-dictionary "english"); Default dictionary. To change do M-x ispell-change-dictionary RET.
  15. (add-hook 'TeX-mode-hook
  16. (lambda () (TeX-fold-mode 1))); Automatically activate TeX-fold-mode.
  17. (setq LaTeX-babel-hyphen nil); Disable language-specific hyphen insertion.
  18. ;; " expands into csquotes macros (for this to work babel must be loaded after csquotes).
  19. (setq LaTeX-csquotes-close-quote "}"
  20. LaTeX-csquotes-open-quote "\\enquote{")
  21. ;; LaTeX-math-mode http://www.gnu.org/s/auctex/manual/auctex/Mathematics.html
  22. (add-hook 'TeX-mode-hook 'LaTeX-math-mode)
  23. ;;; RefTeX
  24. ;; Turn on RefTeX for AUCTeX http://www.gnu.org/s/auctex/manual/reftex/reftex_5.html
  25. (add-hook 'TeX-mode-hook 'turn-on-reftex)
  26. (eval-after-load 'reftex-vars; Is this construct really needed?
  27. '(progn
  28. (setq reftex-cite-prompt-optional-args t); Prompt for empty optional arguments in cite macros.
  29. ;; Make RefTeX interact with AUCTeX, http://www.gnu.org/s/auctex/manual/reftex/AUCTeX_002dRefTeX-Interface.html
  30. (setq reftex-plug-into-AUCTeX t)
  31. ;; So that RefTeX also recognizes \addbibresource. Note that you
  32. ;; can't use $HOME in path for \addbibresource but that "~"
  33. ;; works.
  34. (setq reftex-bibliography-commands '("bibliography" "nobibliography" "addbibresource"))
  35. ; (setq reftex-default-bibliography '("UNCOMMENT LINE AND INSERT PATH TO YOUR BIBLIOGRAPHY HERE")); So that RefTeX in Org-mode knows bibliography
  36. (setcdr (assoc 'caption reftex-default-context-regexps) "\\\\\\(rot\\|sub\\)?caption\\*?[[{]"); Recognize \subcaptions, e.g. reftex-citation
  37. (setq reftex-cite-format; Get ReTeX with biblatex, see https://tex.stackexchange.com/questions/31966/setting-up-reftex-with-biblatex-citation-commands/31992#31992
  38. '((?t . "\\textcite[]{%l}")
  39. (?a . "\\autocite[]{%l}")
  40. (?c . "\\cite[]{%l}")
  41. (?s . "\\smartcite[]{%l}")
  42. (?f . "\\footcite[]{%l}")
  43. (?n . "\\nocite{%l}")
  44. (?b . "\\blockcquote[]{%l}{}")))))
  45. ;; Fontification (remove unnecessary entries as you notice them) http://lists.gnu.org/archive/html/emacs-orgmode/2009-05/msg00236.html http://www.gnu.org/software/auctex/manual/auctex/Fontification-of-macros.html
  46. (setq font-latex-match-reference-keywords
  47. '(
  48. ;; biblatex
  49. ("printbibliography" "[{")
  50. ("addbibresource" "[{")
  51. ;; Standard commands
  52. ;; ("cite" "[{")
  53. ("Cite" "[{")
  54. ("parencite" "[{")
  55. ("Parencite" "[{")
  56. ("footcite" "[{")
  57. ("footcitetext" "[{")
  58. ;; ;; Style-specific commands
  59. ("textcite" "[{")
  60. ("Textcite" "[{")
  61. ("smartcite" "[{")
  62. ("Smartcite" "[{")
  63. ("cite*" "[{")
  64. ("parencite*" "[{")
  65. ("supercite" "[{")
  66. ; Qualified citation lists
  67. ("cites" "[{")
  68. ("Cites" "[{")
  69. ("parencites" "[{")
  70. ("Parencites" "[{")
  71. ("footcites" "[{")
  72. ("footcitetexts" "[{")
  73. ("smartcites" "[{")
  74. ("Smartcites" "[{")
  75. ("textcites" "[{")
  76. ("Textcites" "[{")
  77. ("supercites" "[{")
  78. ;; Style-independent commands
  79. ("autocite" "[{")
  80. ("Autocite" "[{")
  81. ("autocite*" "[{")
  82. ("Autocite*" "[{")
  83. ("autocites" "[{")
  84. ("Autocites" "[{")
  85. ;; Text commands
  86. ("citeauthor" "[{")
  87. ("Citeauthor" "[{")
  88. ("citetitle" "[{")
  89. ("citetitle*" "[{")
  90. ("citeyear" "[{")
  91. ("citedate" "[{")
  92. ("citeurl" "[{")
  93. ;; Special commands
  94. ("fullcite" "[{")))
  95. (setq font-latex-match-textual-keywords
  96. '(
  97. ;; biblatex brackets
  98. ("parentext" "{")
  99. ("brackettext" "{")
  100. ("hybridblockquote" "[{")
  101. ;; Auxiliary Commands
  102. ("textelp" "{")
  103. ("textelp*" "{")
  104. ("textins" "{")
  105. ("textins*" "{")
  106. ;; supcaption
  107. ("subcaption" "[{")))
  108. (setq font-latex-match-variable-keywords
  109. '(
  110. ;; amsmath
  111. ("numberwithin" "{")
  112. ;; enumitem
  113. ("setlist" "[{")
  114. ("setlist*" "[{")
  115. ("newlist" "{")
  116. ("renewlist" "{")
  117. ("setlistdepth" "{")
  118. ("restartlist" "{")))
  119. (provide 'init-latex)