highlight punctuation errors in latex mode

This commit is contained in:
2026-11-11 22:51:38 +01:00
parent 4ccc82f632
commit 86c3b994de

View File

@@ -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)