Skip to content

Commit

Permalink
tweak(latex): better fontification
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Apr 2, 2023
1 parent ad5adae commit 9d31c01
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
91 changes: 91 additions & 0 deletions modules/extras/me-latex-fonts.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
;;; me-latex-fonts.el -*- lexical-binding: t; -*-

;; From Doom Emacs

;; Fontification taken from https://tex.stackexchange.com/a/86119/81279.
(setq font-latex-match-reference-keywords
'(;; BibLaTeX.
("printbibliography" "[{")
("addbibresource" "[{")
;; Standard commands.
("cite" "[{")
("citep" "[{")
("citet" "[{")
("Cite" "[{")
("parencite" "[{")
("Parencite" "[{")
("footcite" "[{")
("footcitetext" "[{")
;; Style-specific commands.
("textcite" "[{")
("Textcite" "[{")
("smartcite" "[{")
("Smartcite" "[{")
("cite*" "[{")
("parencite*" "[{")
("supercite" "[{")
;; Qualified citation lists.
("cites" "[{")
("Cites" "[{")
("parencites" "[{")
("Parencites" "[{")
("footcites" "[{")
("footcitetexts" "[{")
("smartcites" "[{")
("Smartcites" "[{")
("textcites" "[{")
("Textcites" "[{")
("supercites" "[{")
;; Style-independent commands.
("autocite" "[{")
("Autocite" "[{")
("autocite*" "[{")
("Autocite*" "[{")
("autocites" "[{")
("Autocites" "[{")
;; Text commands.
("citeauthor" "[{")
("Citeauthor" "[{")
("citetitle" "[{")
("citetitle*" "[{")
("citeyear" "[{")
("citedate" "[{")
("citeurl" "[{")
;; Special commands.
("fullcite" "[{")
;; Cleveref.
("cref" "{")
("Cref" "{")
("cpageref" "{")
("Cpageref" "{")
("cpagerefrange" "{")
("Cpagerefrange" "{")
("crefrange" "{")
("Crefrange" "{")
("labelcref" "{"))
font-latex-match-textual-keywords
'(;; BibLaTeX brackets.
("parentext" "{")
("brackettext" "{")
("hybridblockquote" "[{")
;; Auxiliary commands.
("textelp" "{")
("textelp*" "{")
("textins" "{")
("textins*" "{")
;; Subcaption.
("subcaption" "[{"))
font-latex-match-variable-keywords
'(;; Amsmath.
("numberwithin" "{")
;; Enumitem.
("setlist" "[{")
("setlist*" "[{")
("newlist" "{")
("renewlist" "{")
("setlistdepth" "{")
("restartlist" "{")
("crefname" "{")))


(provide 'me-latex-fonts)
4 changes: 4 additions & 0 deletions modules/me-latex.el
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,9 @@
(with-eval-after-load 'evil
(add-hook 'reftex-mode-hook #'evil-normalize-keymaps)))

(use-package me-latex-fonts
:after latex
:demand t)


(provide 'me-latex)

0 comments on commit 9d31c01

Please sign in to comment.