Add a function to update the OTF name database for LuaLaTeX

This commit is contained in:
Gerard Vermeulen 2022-05-08 09:58:53 +02:00
parent ad5c15f5e6
commit d35034a12e

View File

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