Simplify inclusion of the first 9 lines of README.org

This commit is contained in:
Gerard Vermeulen 2022-09-18 11:09:04 +02:00
parent a7c8227362
commit 3593e0c3d7
1 changed files with 5 additions and 34 deletions

View File

@ -2821,44 +2821,15 @@ blocks) do not work in [[info:org#Export Settings][#+SETUPFILE: <FILE>]], but on
:CUSTOM_ID: sec:include-file-usage
:END:
Evaluation of the source block in listing
[[lst:make-source-block-with-export-keyword-settings]] produces the source block
that exports to listing [[lst:source-file-export-keyword-settings]] in order to show
the first nine lines of this [[file:README.org]] file. The last line shows that
[[file:include.org][include.org]] is the argument for [[info:org#Export Settings][#+INCLUDE: <FILE>]].
Listing [[lst:source-file-export-keyword-settings]] shows the first nine lines of
this [[file:README.org]] file. The last line shows that [[file:include.org][include.org]] is the argument
for [[info:org#Export Settings][#+INCLUDE: <FILE>]].
#+caption[Make setup and include file export keyword settings source block]:
#+caption: The shell script to make the source block containing the export
#+caption: keyword settings.
#+name: lst:make-source-block-with-export-keyword-settings
#+begin_src shell :exports both :results drawer
echo "#+caption[Source file export keyword settings]:"
echo "#+caption: The first nine lines of README.org containing the export"
echo "#+caption: keyword settings."
echo "#+name: lst:source-file-export-keyword-settings"
echo "#+begin_src org :tangle no"
head -n 9 README.org
echo -n "#+end_src"
#+end_src
#+RESULTS: lst:make-source-block-with-export-keyword-settings
:results:
#+caption[Source file export keyword settings]:
#+caption: The first nine lines of README.org containing the export
#+caption: keyword settings.
#+name: lst:source-file-export-keyword-settings
#+begin_src org :tangle no
#+title: Emacs setup for use with LaTeX, Org, and Python
#+author: Gerard Vermeulen
#+latex_class: article-local
#+latex_class_options: [11pt,a4paper,english,svgnames,tables]
#+macro: kbd (eval (by-backend-kbd-org-macro $1))
#+property: header-args:emacs-lisp :exports code :results silent :tangle init.el
#+property: header-args:org :tangle include.org
#+startup: showeverything
#+include: "include.org"
#+end_src
:end:
#+include: "README.org" src org :lines "1-10"
Listing [[lst:by-backend-kbd-org-macro]] defines the tools for the definition of the
[[https://orgmode.org/][Org mode]] =kbd= macro on the fifth line of listing
@ -2873,7 +2844,7 @@ Listing [[lst:by-backend-kbd-org-macro]] defines the tools for the definition of
(when (ensure-package-installation 'htmlize)
(autoload 'htmlize-protect-string "htmlize" nil t))
;; https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#orge5c50fd
;; https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html
(defmacro by-backend (&rest body)
"Help for org-export backend dependent execution."
`(cl-case ',(bound-and-true-p org-export-current-backend) ,@body))