From b3f5952e66519fb707404304a5e29f2ca394ad95 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Sun, 17 Apr 2022 19:06:34 +0200 Subject: [PATCH] Add more functions to the shortdoc init group --- README.org | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/README.org b/README.org index 656f39d..4691b39 100644 --- a/README.org +++ b/README.org @@ -595,8 +595,18 @@ defined in this Org file. (set-default-face-height :no-manual t) "Org" + (org-babel-execute:latex-extra-header + :no-manual t) + (org-babel-execute:latex-header + :no-manual t) (org-electric-dollar :no-manual t) + (org-eval-emacs-lisp-setup-blocks + :no-manual t) + (org-eval-python-setup-blocks + :no-manual t) + (org-eval-infixed-blocks + :no-manual t) (org-syntax-convert-keyword-case-to-lower :no-manual t)))) #+end_src @@ -1889,36 +1899,35 @@ new [[info:org#Editing Source Code][-modes]]: =latex-header= and =late #+caption: easily. #+name: lst:emacs-lisp-setup-latex-header #+begin_src emacs-lisp :exports code :silent - (with-eval-after-load 'org-src - (add-to-list 'org-src-lang-modes '("toml" . conf-toml)) - + (with-eval-after-load 'emacs (defun prefix-all-lines (prefix body) (with-temp-buffer (insert body) (string-insert-rectangle (point-min) (point-max) prefix) (buffer-string))) - (add-to-list 'org-src-lang-modes '("latex-header" . latex)) - - (defvar org-babel-default-header-args:latex-header - '((:exports . "results") (:results . "raw"))) + (defun org-babel-execute:latex-extra-header (body _params) + "Execute a block of LaTeX extra header lines with org-babel. + This function is called by `org-babel-execute-src-block' and + prefixes all lines with \"#+latex_extra_header: \"." + (prefix-all-lines "#+latex_extra_header: " body)) (defun org-babel-execute:latex-header (body _params) - "Execute a block of LaTeX preamble lines with org-babel. + "Execute a block of LaTeX header lines with org-babel. This function is called by `org-babel-execute-src-block' and prefixes all lines with \"#+latex_header: \"." (prefix-all-lines "#+latex_header: " body)) - (add-to-list 'org-src-lang-modes '("latex-extra-header" . latex)) - (defvar org-babel-default-header-args:latex-extra-header '((:exports . "results") (:results . "raw"))) - (defun org-babel-execute:latex-extra-header (body _params) - "Execute a block of LaTeX preamble lines with org-babel. - This function is called by `org-babel-execute-src-block' and - prefixes all lines with \"#+latex_extra_header: \"." - (prefix-all-lines "#+latex_extra_header: " body))) + (defvar org-babel-default-header-args:latex-header + '((:exports . "results") (:results . "raw"))) + + (with-eval-after-load 'org-src + (add-to-list 'org-src-lang-modes '("toml" . conf-toml)) + (add-to-list 'org-src-lang-modes '("latex-header" . latex)) + (add-to-list 'org-src-lang-modes '("latex-extra-header" . latex)))) #+end_src The old way is to use a special export attribute as in the function