From 0f3bfc872e191ecadb389ceebae4993995afb72e Mon Sep 17 00:00:00 2001 From: TEC Date: Sun, 10 Jul 2022 20:29:36 +0800 Subject: [PATCH] Update org-glossary and config --- config.org | 21 ++++++++++++++++++++- lisp/org-glossary | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index 17e90dc..2e9ec47 100644 --- a/config.org +++ b/config.org @@ -5594,13 +5594,32 @@ to make that right again, and this package makes that even easier to do. ***** Glossaries and more +For glossary-type entries, there's a nice package for this I'm developing. + #+begin_src emacs-lisp (package! org-glossary :recipe (:local-repo "lisp/org-glossary")) #+end_src +Other than hooking this to =org-mode=, we also want to set a collection root and +improve the LaTeX usage references with =cleveref='s ~\labelcpageref~ command. + #+begin_src emacs-lisp :tangle yes (use-package! org-glossary - :hook (org-mode . org-glossary-mode)) + :hook (org-mode . org-glossary-mode) + :config + (setq org-glossary-collection-root "~/.config/doom/misc/glossaries/") + (defun +org-glossary--latex-cdef (backend info term-entry form &optional ref-index plural-p capitalized-p extra-parameters) + (org-glossary--export-template + (if (plist-get term-entry :uses) + "*%d*\\emsp{}%v\\ensp{}@@latex:\\labelcpageref{@@%b@@latex:}@@\n" + "*%d*\\emsp{}%v\n") + backend info term-entry ref-index + plural-p capitalized-p extra-parameters)) + (org-glossary-set-export-spec + 'latex t + :backref "gls-%K-use-%r" + :backref-seperator "," + :definition-structure #'+org-glossary--latex-cdef)) #+end_src ***** Document comparison diff --git a/lisp/org-glossary b/lisp/org-glossary index c520d66..b2b53e8 160000 --- a/lisp/org-glossary +++ b/lisp/org-glossary @@ -1 +1 @@ -Subproject commit c520d66cd86fce4154d2dcf42c7669146425bd89 +Subproject commit b2b53e82468feda2d0b68d3b30bdbe4c06dc815d