Compare commits

..

2 Commits

View File

@ -3794,11 +3794,19 @@ define the [[https://orgmode.org/][Org mode]] =kbd= macro in listing
:CUSTOM_ID: sec:testing-org
:END:
Listing [[lst:setup-org-mode-test-1]] and [[lst:setup-org-mode-test-2]] provide
facilities for [[https://orgmode.org/worg/org-tests/index.html][Testing Org]].
Listing [[lst:batch-org-testing]] shows the recommended way: use =make test= in a
clean Org git repository. Listing [[lst:setup-org-mode-test-1]] and
[[lst:setup-org-mode-test-2]] provide facilities for [[https://orgmode.org/worg/org-tests/index.html][Testing Org]] interactively.
#+caption[Batch Org testing]:
#+caption: Batch Org testing: obligatory before mailing a patch.
#+name: lst:batch-org-testing
#+begin_src shell -n :eval never :tangle no
make test > out.txt 2>&1
#+end_src
#+caption[Testing Org facilities 1]:
#+caption: Testing Org facilities 1.
#+caption: Testing Org facilities 1: for use during development only.
#+name: lst:setup-org-mode-test-1
#+begin_src emacs-lisp -n
(with-eval-after-load 'emacs
@ -3841,7 +3849,7 @@ facilities for [[https://orgmode.org/worg/org-tests/index.html][Testing Org]].
#+end_src
#+caption[Testing Org facilities 2]:
#+caption: Testing Org facilities 2.
#+caption: Testing Org facilities 2: for use during development only.
#+name: lst:setup-org-mode-test-2
#+begin_src emacs-lisp -n
(with-eval-after-load 'emacs
@ -3888,7 +3896,7 @@ Examples: `ob/' or `ob-maxima'."
(ert text)))))
#+end_src
*** [[info:org#Noweb Reference Syntax][Noweb (info)]] trickery
*** LaTex preamble editing using [[info:org#Noweb Reference Syntax][Noweb (info)]]
:PROPERTIES:
:CUSTOM_ID: sec:file-inclusion-and-noweb
:END:
@ -4105,15 +4113,17 @@ handled by [[info:org#Noweb Reference Syntax][noweb (info)]].
<<latex-header-5>>
#+end_src
*** [[info:org#LaTeX header and sectioning][Deprecated easy LaTeX preamble editing methods]]
*** [[info:org#LaTeX header and sectioning][Deprecated LaTeX preamble editing methods]]
:PROPERTIES:
:CUSTOM_ID: sec:easy-latex-preamble-editing
:END:
There are at least two deprecated (old and historic) ways to edit the LaTeX
preamble =latex_header= and =latex_extra_header= export options easily in LaTeX
source or export blocks. This [[info:org#Top][Org (info)]] file uses the recommended method of
noweb trickery in Section [[#sec:file-inclusion-and-noweb]].
*NOTE:* This [[info:org#Top][Org (info)]] file uses the recommended method of noweb trickery in
Section [[#sec:file-inclusion-and-noweb]].
There are at least two deprecated (old and historic) ways to edit the Org
=#+latex_header:= and =#+latex_extra_header:= keywords easily
for export to LaTeX, see [[info:org#LaTeX header and sectioning][LaTeX header and sectioning (info)]].
The old way -- exploiting an idea of [[https://www.matem.unam.mx/~omar/][Omar Antolin Camarena]] -- is to code new
[[info:org#Editing Source Code][<LANGUAGE>-modes]] allowing to edit in LaTeX mode and to export to LaTeX code with
@ -4125,6 +4135,17 @@ exposing his idea:
Listing [[lst:org-babel-latex-header-blocks]] implements this way by means of two
new [[info:org#Editing Source Code][<LANGUAGE>-modes]]: =latex-header= and =latex-extra-header=.
The old way is to define two Org Babel languages (=latex-extra-header= and
=latex-header=) as done in Listing [[lst:org-babel-latex-header-blocks]]. The
historic way is to use a special export attribute as in the function
=org-latex-header-blocks-filter= in [[https://git.sr.ht/~bzg/org-contrib/tree/master/item/lisp/ox-extra.el][ox-extra.el]]. Apparently, nobody is using
this broken function (broken, since it relies on support only in org-mode before
=2014-11-11=). Listing [[lst:org-latex-header-blocks-filter]] proposes a fix for
=org-latex-header-blocks-filter=. This setup keeps the deprecated ways for
backwards compatibility. A practical difference is that new way source blocks
(contrary to old way export blocks) do not work in [[info:org#Export Settings][#+SETUPFILE: <FILE>]], but only
in [[info:org#Export Settings][#+INCLUDE: <FILE>]] files.
#+caption[New =<LANGUAGE>-modes= to edit the LaTeX preamble easily]:
#+caption: Add =latex-header= and =latex-extra-header= language modes to edit
#+caption: LaTeX preamble =latex_header= and =latex_extra_header= export options
@ -4163,12 +4184,6 @@ prefixes all lines with \"#+latex_header: \"."
(add-to-list 'org-src-lang-modes '("latex-extra-header" . latex))))
#+end_src
The historic way is to use a special export attribute as in the function
=org-latex-header-blocks-filter= in [[https://git.sr.ht/~bzg/org-contrib/tree/master/item/lisp/ox-extra.el][ox-extra.el]]. Apparently, nobody is using
this broken function (broken, since it relies on support only in org-mode before
=2014-11-11=). Listing [[lst:org-latex-header-blocks-filter]] proposes a fix for
=org-latex-header-blocks-filter=.
#+caption[Convert marked LaTeX export blocks to LaTeX header lines]:
#+caption: Convert marked LaTeX export blocks to LaTeX header lines.
#+name: lst:org-latex-header-blocks-filter
@ -4219,11 +4234,6 @@ converts to
org-export-before-parsing-functions))
#+end_src
This file uses the new most simple way, while keeping the deprecated ways for
backwards compatibility. A practical difference is that new way source blocks
(contrary to old way export blocks) do not work in [[info:org#Export Settings][#+SETUPFILE: <FILE>]], but only
in [[info:org#Export Settings][#+INCLUDE: <FILE>]] files.
*** [[info:org#HTML Export][HTML export (info)]]
:PROPERTIES:
:CUSTOM_ID: sec:html-export