Tidy Org configuration with export to LuaLaTeX.

This commit is contained in:
Gerard Vermeulen 2022-07-14 12:26:21 +02:00
parent b53de51ffb
commit 0795f0e50a
1 changed files with 38 additions and 14 deletions

View File

@ -1665,15 +1665,16 @@ buffers with help of an external [[https://nodejs.org][node.js]] program.
:CUSTOM_ID: sec:customize-org
:END:
The code in listing [[lst:customize-org-babel]], [[lst:customize-org]],
[[lst:customize-org-link]], [[lst:customize-org-export]], and
[[lst:customize-org-latex-export]] does basic customization of [[https://orgmode.org/][Org-mode]] variables.
Listing [[lst:customize-ob-python]] allows to pretty-print Python session source
block values with [[https://github.com/psf/black#readme][black]] instead of [[https://docs.python.org/3/library/pprint.html][pprint]]. Listing [[lst:customize-org-link]]
configures =org-link= to use relative file path links. Listing
[[lst:customize-org-latex-classes]] defines [[info:org#LaTeX specific export settings][org-latex-classes (info)]] for backward
compatibility. See table [[tab:org-latex-class-tag-placeholder]] and type {{{kbd(C-h
v org-latex-classes)}}} for an explanation of the code in listing
Listing [[lst:customize-org-babel]], [[lst:customize-org]], [[lst:customize-org-link]] does
basic customization of [[https://orgmode.org/][Org-mode]] variables. Listing
[[lst:customize-org-for-lualatex-export]], and
[[lst:customize-ox-latex-for-lualatex-export]] configure [[https://orgmode.org/][Org-mode]] for export to
LuaLaTeX. Listing [[lst:customize-ob-python]] allows to pretty-print Python session
source block values with [[https://github.com/psf/black#readme][black]] instead of [[https://docs.python.org/3/library/pprint.html][pprint]]. Listing
[[lst:customize-org-link]] configures =org-link= to use relative file path links.
Listing [[lst:customize-org-latex-classes]] defines [[info:org#LaTeX specific export settings][org-latex-classes (info)]] for
backward compatibility. See table [[tab:org-latex-class-tag-placeholder]] and type
{{{kbd(C-h v org-latex-classes)}}} for an explanation of the code in listing
[[lst:customize-org-latex-classes]].
#+attr_latex: :booktabs yes :float table
@ -1854,12 +1855,27 @@ v org-latex-classes)}}} for an explanation of the code in listing
'(org-export-dispatch-use-expert-ui t)))
#+end_src
#+caption[Customize =org-latex-export=]:
#+caption: Customize =org-latex-export=.
#+name: lst:customize-org-latex-export
#+caption[Customize =org= for export to LuaLaTeX]:
#+caption: Customize =org= for export to LuaLaTeX.
#+name: lst:customize-org-for-lualatex-export
#+begin_src emacs-lisp
(with-eval-after-load 'org
;; https://list.orgmode.org/87o84fd4oi.fsf@posteo.net/
(add-to-list
'org-preview-latex-process-alist
'(luamagick
:programs ("lualatex" "convert")
:description "pdf > png"
:message "you need to install lualatex and imagemagick."
:image-input-type "pdf"
:image-output-type "png"
:image-size-adjust (1.0 . 1.0)
:post-clean nil
:latex-header nil
:latex-compiler ("lualatex -interaction nonstopmode -output-directory %o %f")
:image-converter ("convert -density %D -trim -antialias %f -quality 100 %O")))
(custom-set-variables
'(org-preview-latex-default-process 'luamagick)
'(org-latex-default-packages-alist '(("" "fontspec" t ("lualatex"))
("AUTO" "inputenc" t ("pdflatex"))
("T1" "fontenc" t ("pdflatex"))
@ -1872,9 +1888,17 @@ v org-latex-classes)}}} for an explanation of the code in listing
("" "amssymb" t)
("" "capt-of" nil)
("" "hyperref" nil)))))
#+end_src
#+caption[Customize =ox-latex= for export to LuaLaTeX]:
#+caption: Customize =ox-latex= for export to LuaLaTeX.
#+name: lst:customize-ox-latex-for-lualatex-export
#+begin_src emacs-lisp
(with-eval-after-load 'ox-latex
(custom-set-variables
'(org-latex-pdf-process
;; https://tecosaur.github.io/emacs-config/#compiling
("latexmk -f -pdf -%latex -interaction=nonstopmode -shell-escape -outdir=%o %f"))
'(org-latex-compiler "lualatex")
'(org-latex-hyperref-template "\\hypersetup{
pdfauthor={%a},
@ -1991,8 +2015,8 @@ configuration.
(with-eval-after-load 'oc
(custom-set-variables
'(org-cite-export-processors '((latex biblatex)
(t csl)))
'(org-cite-export-processors '((latex biblatex)
(t csl)))
'(org-cite-global-bibliography '("~/VCS/research/refs.bib")))
(when (require 'citar nil 'noerror)
(custom-set-variables