From d35034a12eca93c28c079f474a763f8877aee04f Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Sun, 8 May 2022 09:58:53 +0200 Subject: [PATCH] Add a function to update the OTF name database for LuaLaTeX --- README.org | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index 80df674..5ba1966 100644 --- a/README.org +++ b/README.org @@ -1339,10 +1339,12 @@ Loading =tex.el= immediately instead of lazily ensures proper initialization of elisp library file has no autoload cookie. Without prior loading of =tex.el=, Emacs will complain that ~TeX-master~ is no safe local variable in case it reads a LaTeX file that sets ~TeX-master~. Listing [[lst:require-auctex]] initializes -[[https://en.wikipedia.org/wiki/AUCTeX][AUCTeX]] properly for LuaTeX or LuaLaTeX. Finally, out of the box, [[https://en.wikipedia.org/wiki/AUCTeX][AUCTeX]] does -not indent text between square brackets. The code in listing [[lst:configure-auctex]] -corrects this by advising to override ~TeX-brace-count-line~ with -~TeX-brace-count-line-advice~. +[[https://en.wikipedia.org/wiki/AUCTeX][AUCTeX]] properly for LuaTeX or LuaLaTeX. In case the output of =LuaLaTeX= has +missing fonts, listing [[lst:update-lualatex-opentype-font-name-database]] defines a +function to update the =OpenType Font= name database for =LuaLaTeX=. Finally, +out of the box, [[https://en.wikipedia.org/wiki/AUCTeX][AUCTeX]] does not indent text between square brackets. The code +in listing [[lst:configure-auctex]] corrects this by advising to override +~TeX-brace-count-line~ with ~TeX-brace-count-line-advice~. #+caption[Require =AUCTeX=]: #+caption: Require =AUCTeX=. @@ -1359,6 +1361,21 @@ corrects this by advising to override ~TeX-brace-count-line~ with '(TeX-electric-math nil))) #+end_src + +#+caption[Update the =LuaLaTeX OpenType Font= name database]: +#+caption: Update the =LuaLaTeX= =OpenType Font= name database. +#+name: lst:update-lualatex-opentype-font-name-database +#+begin_src emacs-lisp + (defun update-lualatex-opentype-font-name-database () + "Update the \"OpenType Font\" name database for \"LuaLaTeX\"." + (interactive) + (cl-destructuring-bind (exit-code output) + (shell-command-with-exit-code + "luaotfload-tool" "-vv" "--update" "--force") + (if (= 0 exit-code) (message "%s" (string-trim output)) + (error "%s" (string-trim output))))) +#+end_src + #+caption[Configure =AUCTeX=]: #+caption: Configure =AUCTeX=. #+name: lst:configure-auctex