Improve the `engrave-faces' section
This commit is contained in:
parent
c6b5804223
commit
8216f87ba1
39
README.org
39
README.org
@ -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")
|
(engrave-faces . "gnu-devel")
|
||||||
(hyperbole . "gnu-devel")
|
(hyperbole . "gnu-devel")
|
||||||
(marginalia . "gnu-devel")
|
(marginalia . "gnu-devel")
|
||||||
(org . "gnu-devel")
|
(org . "gnu-devel")
|
||||||
@ -2464,34 +2464,39 @@ 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 aims to produce a versatile generic core which can process a
|
This package has a front-end that processes fontified buffers and pipes its
|
||||||
fontified buffer and pass the data to any number of backends to deal with
|
output into one of three back-ends for export to LaTeX, HTML and text with ANSI
|
||||||
specific output formats and Org offers it as an alternative to =minted=. *The
|
escape codes. It is an alternative to =minted= in case of LaTeX export or to
|
||||||
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)]]
|
=htmlized= in case of HTML export. The listings below work around three issues
|
||||||
*capable of handling this [[file:README.org]] file to my satisfaction:*
|
with spacing in the =pdf= output resulting from =LaTeX= export by means of [[info:org#Source blocks in LaTeXexport][Org
|
||||||
|
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 non-equidistance interline spacing back to the =breakable= option in
|
traced the non-equidistant interline spacing back to the =breakable= option
|
||||||
=Code= environments inside =listing= environments. However, =tcolorbox=
|
of =Code= environments inside =listing= environments. However, =tcolorbox=
|
||||||
requires =breakable= for listings that do not fit on a page. As a
|
requires =breakable= for listings that do not fit on a page. The filter
|
||||||
work-around, the filter =org-latex-engraved-source-block-filter= in listing
|
=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 a caption" or "non-floating breakable
|
blocks to "floating unbreakable with caption" or "non-floating breakable
|
||||||
without a caption" LaTeX environments.
|
without caption" LaTeX environments. This is a partial work-around, but part
|
||||||
|
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
|
||||||
org-mode source blocks during LaTeX export without any further tweaking.
|
for instance org-mode source blocks during LaTeX export without any
|
||||||
|
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
|
||||||
@ -2586,7 +2591,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 :tangle no
|
#+begin_src emacs-lisp
|
||||||
(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)
|
||||||
@ -2622,7 +2627,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 :tangle no
|
#+begin_src emacs-lisp
|
||||||
(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."
|
||||||
|
Loading…
Reference in New Issue
Block a user