Org LaTeX: Disable microtype protrusion in code

This commit is contained in:
TEC 2022-01-08 02:37:09 +08:00
parent 5be7a92419
commit fcc88360c1
Signed by: tec
GPG Key ID: 779591AFDB81F06C
1 changed files with 11 additions and 0 deletions

View File

@ -9368,6 +9368,17 @@ better) we add bit to the preamble:
breakable}
#+end_src
One little annoyance with this is the interaction between microtype and =Verbatim=
environments. Protrusion is not desirable here. Thankfully, we can patch the
=Verbatim= environment to turn off protrusion locally.
#+begin_src emacs-lisp
(add-to-list 'org-latex-feature-implementations
'(.no-protrusion-in-code :snippet "\\let\\oldcode\\Code\\renewcommand{\\Code}{\\microtypesetup{protrusion=false}\\oldcode}"
:when (microtype engraved-code-setup)
:eager t
:order 98.5) t)
#+end_src
At some point it would be nice to make the box colours easily customisable. At
the moment it's fairly easy to change the syntax highlighting colours with
src_elisp{(setq engrave-faces-preset-styles (engrave-faces-generate-preset))},