Last active
February 3, 2023 19:23
Revisions
-
meliache revised this gist
Feb 3, 2023 . No changes.There are no files selected for viewing
-
meliache revised this gist
Feb 3, 2023 . No changes.There are no files selected for viewing
-
meliache created this gist
Feb 3, 2023 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ (defun my-get-texlive-package-list () (let ((tlpdb-fpath (file-name-concat (string-trim-right (shell-command-to-string "kpsewhich -var-value TEXMFROOT")) "tlpkg/texlive.tlpdb")) (name-regex "^name \\([^ \n.]+\\)$")) (with-current-buffer (find-file-noselect tlpdb-fpath 'nowarn 'rawfile) (save-excursion (goto-char (point-min)) (cl-loop while (re-search-forward name-regex nil 'noerror) collect (match-string-no-properties 1)))))) ;; simpler alternative to `TeX-documentation-texdoc' which adds completing-read. (defun my-texdoc (pkg) "Show TeX documentation for package PKG. If called interactively, select package from TexLive with interactive completion." (interactive (list (completing-read "texdoc: " (my-get-texlive-package-list) nil nil nil 'my-texdoc-history))) (call-process "texdoc" nil " *texdoc*" nil "--view" pkg))