Compare commits

..

No commits in common. "8216f87ba1efe228af2fb66ec04cc096a60ddd3b" and "c91fb8f2cbefffa69ce1f9847b6a920f156ec668" have entirely different histories.

View File

@ -22,7 +22,7 @@
This README contains my Emacs setup for use with LaTeX, Org, and Python. This README contains my Emacs setup for use with LaTeX, Org, and Python.
Copyright \copy 2021-2023 Gerard Vermeulen. Copyright \copy 2021-2022 Gerard Vermeulen.
#+BEGIN_QUOTE #+BEGIN_QUOTE
Permission is granted to copy, distribute and/or modify this Permission is granted to copy, distribute and/or modify this
@ -243,7 +243,7 @@ The [[info:emacs#Init File][init file (info)]] does not load the ~custom-file~ a
'(eglot . "gnu-devel")) '(eglot . "gnu-devel"))
(embark . "gnu-devel") (embark . "gnu-devel")
(embark-consult . "gnu-devel") (embark-consult . "gnu-devel")
(engrave-faces . "gnu-devel") (engrave-faces . "gnu")
(hyperbole . "gnu-devel") (hyperbole . "gnu-devel")
(marginalia . "gnu-devel") (marginalia . "gnu-devel")
(org . "gnu-devel") (org . "gnu-devel")
@ -2464,39 +2464,34 @@ valid directories and files. In an [[https://orgmode.org/][Org-mode]] buffer th
:CUSTOM_ID: sec:engrave-faces :CUSTOM_ID: sec:engrave-faces
:END: :END:
This package has a front-end that processes fontified buffers and pipes its This package aims to produce a versatile generic core which can process a
output into one of three back-ends for export to LaTeX, HTML and text with ANSI fontified buffer and pass the data to any number of backends to deal with
escape codes. It is an alternative to =minted= in case of LaTeX export or to specific output formats and Org offers it as an alternative to =minted=. *The
=htmlized= in case of HTML export. The listings below work around three issues listings below make* [[https://github.com/tecosaur/engrave-faces#readme][Engrave Faces]] and [[info:org#Source blocks in LaTeX export][Org source block export to LaTeX (info)]]
with spacing in the =pdf= output resulting from =LaTeX= export by means of [[info:org#Source blocks in LaTeXexport][Org *capable of handling this [[file:README.org]] file to my satisfaction:*
source block export to LaTeX (info)]] and [[https://github.com/tecosaur/engrave-faces#readme][Engrave Faces]]. They increase the
quality of the export results of this [[file:README.org][README.org]] to a level acceptable for my
workflow:
1. The default Org export configuration for engraving listings produces =pdf= 1. The default Org export configuration for engraving listings produces =pdf=
output with a non-equidistant interline spacing in floating listings and output with a non-equidistant interline spacing in floating listings and
equidistant interline spaces non-floating =tcolorbox= environments. I have equidistant interline spaces non-floating =tcolorbox= environments. I have
traced the non-equidistant interline spacing back to the =breakable= option traced non-equidistance interline spacing back to the =breakable= option in
of =Code= environments inside =listing= environments. However, =tcolorbox= =Code= environments inside =listing= environments. However, =tcolorbox=
requires =breakable= for listings that do not fit on a page. The filter requires =breakable= for listings that do not fit on a page. As a
=org-latex-engraved-source-block-filter= in listing work-around, the filter =org-latex-engraved-source-block-filter= in listing
[[lst:org-latex-engraved-source-block-filter]] and the [[lst:org-latex-engraved-source-block-filter]] and the
=org-latex-engraved-preamble= customization in listing =org-latex-engraved-preamble= customization in listing
[[lst:smart-latex-engrave-org-source-blocks]] allow to engrave =org-mode= source [[lst:smart-latex-engrave-org-source-blocks]] allow to engrave =org-mode= source
blocks to "floating unbreakable with caption" or "non-floating breakable blocks to "floating unbreakable with a caption" or "non-floating breakable
without caption" LaTeX environments. This is a partial work-around, but part without a caption" LaTeX environments.
of my workflow.
2. Listing [[lst:ensure-engrave-faces-with-latex-face-apply-fix]] makes 2. Listing [[lst:ensure-engrave-faces-with-latex-face-apply-fix]] makes
=engrave-faces-latex-face-apply= handle symbolic color name strings (in =engrave-faces-latex-face-apply= handle symbolic color name strings (in
addition to the hexadecimal strings). Since faces in for instance addition to the hexadecimal strings). Since faces in for instance
src_emacs-lisp{(find-library "org-faces")} and src_emacs-lisp{(find-library src_emacs-lisp{(find-library "org-faces")} and src_emacs-lisp{(find-library
"faces")} have symbolic color names (beware: Emacs themes may replace the "faces")} have symbolic color names (beware: Emacs themes may replace the
symbolic color names with hexadecimal strings), this fix allows to engrave symbolic color names with hexadecimal strings), this fix allows to engrave
for instance org-mode source blocks during LaTeX export without any org-mode source blocks during LaTeX export without any further tweaking.
customization of =engrave-faces-themes=.
3. Listing [[lst:ensure-engrave-faces-with-latex-face-mapper-fix]] makes 3. Listing [[lst:ensure-engrave-faces-with-latex-face-mapper-fix]] makes
=engrave-faces-latex-face-mapper= handle horizontal and vertical spacing =engrave-faces-latex-face-mapper= handle horizontal and vertical spacing
in multiple line documentation strings correctly. For instance, without this in multiple line documentation strings correctly. For instance, *without this
fix the mishandling of vertical and horizontal spacing destroys the fix* the mishandling of vertical and horizontal spacing destroys the
indentation in Python documentation strings. An Emacs lisp example of the indentation in Python documentation strings. An Emacs lisp example of the
bug is the disappearance of the empty line in the documentation string of bug is the disappearance of the empty line in the documentation string of
=org-latex-engraved-source-block-filter= of listing =org-latex-engraved-source-block-filter= of listing
@ -2591,7 +2586,7 @@ environments and non-floating breakable LaTeX environments by means of
#+caption[Fix engraving of symbolic color names]: #+caption[Fix engraving of symbolic color names]:
#+caption: Fix engraving of symbolic colors names. #+caption: Fix engraving of symbolic colors names.
#+name: lst:ensure-engrave-faces-with-latex-face-apply-fix #+name: lst:ensure-engrave-faces-with-latex-face-apply-fix
#+begin_src emacs-lisp #+begin_src emacs-lisp :tangle no
(when (and (ensure-package-installation 'engrave-faces) (when (and (ensure-package-installation 'engrave-faces)
(require 'engrave-faces-latex nil t)) (require 'engrave-faces-latex nil t))
(defun engrave-faces-latex--color (color) (defun engrave-faces-latex--color (color)
@ -2627,7 +2622,7 @@ environments and non-floating breakable LaTeX environments by means of
#+caption: Fix engraving of horizontal and vertical spacing in multiple line #+caption: Fix engraving of horizontal and vertical spacing in multiple line
#+caption: documentation strings. #+caption: documentation strings.
#+name: lst:ensure-engrave-faces-with-latex-face-mapper-fix #+name: lst:ensure-engrave-faces-with-latex-face-mapper-fix
#+begin_src emacs-lisp #+begin_src emacs-lisp :tangle no
(when (require 'engrave-faces-latex nil t) (when (require 'engrave-faces-latex nil t)
(defun engrave-faces-latex-face-mapper-override (faces content) (defun engrave-faces-latex-face-mapper-override (faces content)
"Create a LaTeX representation of CONTENT with FACES applied." "Create a LaTeX representation of CONTENT with FACES applied."