Tangle setupfile.org
* Let minted handle org source blocks as text. * Let org-babel-tangle-file tangle to emacs-lisp as well as org.
This commit is contained in:
parent
436eea8582
commit
f5fb65404f
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
latexmkrc
|
latexmkrc
|
||||||
org-store-link
|
org-store-link
|
||||||
|
setupfile.org
|
||||||
|
|
||||||
/_minted-README
|
/_minted-README
|
||||||
/eln-cache
|
/eln-cache
|
||||||
|
|
53
README.org
53
README.org
|
@ -2,17 +2,7 @@
|
||||||
#+author: Gerard Vermeulen
|
#+author: Gerard Vermeulen
|
||||||
#+latex_class: article
|
#+latex_class: article
|
||||||
#+latex_class_options: [11pt,a4paper,english,svgnames,tables]
|
#+latex_class_options: [11pt,a4paper,english,svgnames,tables]
|
||||||
#
|
#+setupfile: setupfile.org
|
||||||
#+babel: :cache no
|
|
||||||
#
|
|
||||||
#+macro: kbd @@html:<kbd>$1</kbd>@@@@latex:\colorbox{PaleTurquoise}{\texttt{$1}}@@
|
|
||||||
#
|
|
||||||
#+property: header-args :tangle init.el
|
|
||||||
#+property: header-args:emacs-lisp :exports code :results silent
|
|
||||||
#+property: header-args:latex-header :tangle no
|
|
||||||
#+property: header-args:latex-extra-header :tangle no
|
|
||||||
#
|
|
||||||
#+startup: content
|
|
||||||
|
|
||||||
* LaTeX headers :noexport:
|
* LaTeX headers :noexport:
|
||||||
|
|
||||||
|
@ -61,7 +51,7 @@
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src latex-header
|
#+begin_src latex-header
|
||||||
% Make section, subsection and subsubsection implicit float barriers.
|
% FLOAT BARRIERS:
|
||||||
% https://tex.stackexchange.com/questions/118662/use-placeins-for-subsections
|
% https://tex.stackexchange.com/questions/118662/use-placeins-for-subsections
|
||||||
% Make section an implicit float barrier:
|
% Make section an implicit float barrier:
|
||||||
\usepackage[section]{placeins}
|
\usepackage[section]{placeins}
|
||||||
|
@ -1057,6 +1047,11 @@ The code in listing [[lst:customize-org-babel]], [[lst:customize-org]], and
|
||||||
urlcolor=blue,
|
urlcolor=blue,
|
||||||
}\n")
|
}\n")
|
||||||
'(org-latex-listings 'minted)
|
'(org-latex-listings 'minted)
|
||||||
|
'(org-latex-minted-langs '((cc "c++")
|
||||||
|
(cperl "perl")
|
||||||
|
(shell-script "bash")
|
||||||
|
(caml "ocaml")
|
||||||
|
(org "text")))
|
||||||
'(org-latex-minted-options '(("bgcolor" "LightGoldenrodYellow")))
|
'(org-latex-minted-options '(("bgcolor" "LightGoldenrodYellow")))
|
||||||
`(org-latex-logfiles-extensions
|
`(org-latex-logfiles-extensions
|
||||||
',(cl-union '("lof" "lot") org-latex-logfiles-extensions :test #'equal))
|
',(cl-union '("lof" "lot") org-latex-logfiles-extensions :test #'equal))
|
||||||
|
@ -1283,22 +1278,25 @@ new [[info:org#Editing Source Code][<LANGUAGE>-modes]]: =latex-header= and =late
|
||||||
#+caption: easily.
|
#+caption: easily.
|
||||||
#+name: lst:emacs-lisp-setup-latex-header
|
#+name: lst:emacs-lisp-setup-latex-header
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(with-eval-after-load 'org-src (defun prefix-all-lines (prefix body)
|
(with-eval-after-load 'org-src
|
||||||
(with-temp-buffer (insert body) (string-insert-rectangle (point-min)
|
(defun prefix-all-lines (prefix body)
|
||||||
(point-max) prefix) (buffer-string)))
|
(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))
|
(add-to-list 'org-src-lang-modes '("latex-header" . latex))
|
||||||
|
|
||||||
(defvar org-babel-default-header-args:latex-header '((:results
|
(defvar org-babel-default-header-args:latex-header
|
||||||
. "raw") (:exports . "results")))
|
'((:exports . "results") (:results . "raw")))
|
||||||
|
|
||||||
(defun org-babel-execute:latex-header (body _params)
|
(defun org-babel-execute:latex-header (body _params)
|
||||||
(prefix-all-lines "#+latex_header: " body))
|
(prefix-all-lines "#+latex_header: " body))
|
||||||
|
|
||||||
(add-to-list 'org-src-lang-modes '("latex-extra-header" . latex))
|
(add-to-list 'org-src-lang-modes '("latex-extra-header" . latex))
|
||||||
|
|
||||||
(defvar org-babel-default-header-args:latex-extra-header '((:results
|
(defvar org-babel-default-header-args:latex-extra-header
|
||||||
. "raw") (:exports . "results")))
|
'((:exports . "results") (:results . "raw")))
|
||||||
|
|
||||||
(defun org-babel-execute:latex-extra-header (body _params)
|
(defun org-babel-execute:latex-extra-header (body _params)
|
||||||
(prefix-all-lines "#+latex_extra_header: " body)))
|
(prefix-all-lines "#+latex_extra_header: " body)))
|
||||||
|
@ -1411,7 +1409,7 @@ Listing [[lst:emacs-lisp-setup-call]] initializes the buffer local variables
|
||||||
#+caption: Use the setup macro for =ox-latex=.
|
#+caption: Use the setup macro for =ox-latex=.
|
||||||
#+name: lst:emacs-lisp-setup-call
|
#+name: lst:emacs-lisp-setup-call
|
||||||
#+header: :var title-page=lst/title-page
|
#+header: :var title-page=lst/title-page
|
||||||
#+begin_src emacs-lisp :exports code :results silent :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(my-ox-latex-export-buffer-local-variables title-page)
|
(my-ox-latex-export-buffer-local-variables title-page)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
@ -1438,6 +1436,21 @@ Listing [[lst:emacs-lisp-setup-call]] initializes the buffer local variables
|
||||||
\end{titlepage}
|
\end{titlepage}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
*** [[info:org#Export Settings][SETUPFILE export keyword usage]]
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: sec:setupfile-export-keyword-usage
|
||||||
|
:END:
|
||||||
|
|
||||||
|
#+caption[Setup file export keyword settings]:
|
||||||
|
#+caption: Setup file export keyword settings.
|
||||||
|
#+name: lst:setup-file-export-keyword-settings
|
||||||
|
#+begin_src org :tangle setupfile.org
|
||||||
|
#+babel: :cache no
|
||||||
|
#+macro: kbd @@html:<kbd>$1</kbd>@@@@latex:\colorbox{PowderBlue}{\texttt{$1}}@@
|
||||||
|
#+property: header-args:emacs-lisp :exports code :results silent :tangle init.el
|
||||||
|
#+startup: content
|
||||||
|
#+end_src
|
||||||
|
|
||||||
* Editing
|
* Editing
|
||||||
|
|
||||||
** [[https://www.emacswiki.org/emacs/DisabledCommands][Enable disabled commands and inform]]
|
** [[https://www.emacswiki.org/emacs/DisabledCommands][Enable disabled commands and inform]]
|
||||||
|
|
|
@ -23,7 +23,8 @@ emacs -Q --batch --eval "
|
||||||
(setq org-confirm-babel-evaluate nil)
|
(setq org-confirm-babel-evaluate nil)
|
||||||
(setq python-indent-guess-indent-offset nil)
|
(setq python-indent-guess-indent-offset nil)
|
||||||
|
|
||||||
(org-babel-tangle-file \"$1\"))
|
(org-babel-tangle-file \"$1\" \"init.el\" \"emacs-lisp\")
|
||||||
|
(org-babel-tangle-file \"$1\" \"setupfile.org\" \"org\"))
|
||||||
"
|
"
|
||||||
|
|
||||||
# Local Variables:
|
# Local Variables:
|
||||||
|
|
Loading…
Reference in New Issue