diff --git a/lisp/init-latex.el b/lisp/init-latex.el index 86a3c3c..33f1e01 100644 --- a/lisp/init-latex.el +++ b/lisp/init-latex.el @@ -2,17 +2,33 @@ (setopt text-mode-ispell-word-completion nil) +(defface punctuation-error-face + '((t (:foreground "Red"))) + "red" + :group 'latex) + +(defun tvd-latex-punctuation() + "Highlight german speech punctuation errors. See https://korrektur.de/woertliche-rede-zeichensetzung. + +The following errors are highlighted: +- a dot following closing quotes, as: ``done''. +- a dot before the closing quote if followed by a comma, as: ``boo.'', sagte er. +- an uppercase word following an opening quote after a comma, as: ... said, ``Doch.''" + (interactive) + (highlight-regexp "''\\." 'punctuation-error-face) + (highlight-regexp "\\.''," 'punctuation-error-face) + (highlight-regexp ", ``[A-Z]" 'punctuation-error-face)) + (use-package latex :ensure nil :mode - ("\\.tex\\'" . latex-mode) - - :config) + ("\\.tex\\'" . latex-mode)) (add-hook 'latex-mode-hook (lambda () - (add-hook 'completion-at-point-functions #'dabbrev-capf 20 t))) + (add-hook 'completion-at-point-functions #'dabbrev-capf 20 t) + (tvd-latex-punctuation))) (provide 'init-latex)