Files
emacs/lisp/my/my-org-article.el

2999 lines
112 KiB
EmacsLisp
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
;;; my-org-article.el --- Summary -*- lexical-binding: t -*-
;;; Commentary:
;; LaTeX and HTML export
;; EXAMPLE:
;; # -*- ispell-local-dictionary: "german" -*-
;; #+LANGUAGE: en
;; #+TITLE: Emacs
;; #+SUBTITLE:
;; #+AUTHOR: Daniel Weschke
;; #+EMAIL: daniel.weschke@directbox.de
;; #+DATE: 25. November 2019
;; #+KEYWORDS:
;; #+DESCRIPTION:
;; * Header :ignore:
;; article-latex is based on latex
;; article-html is based on tufte-html
;; KEYWORDS are set in (org-export-define-derived-backend ... :options-alist
;; internal
;; `translate-alist' defines Org export function with own function
;; TODO: org-ref cite version 3 not working, the tex file still has
;; the from cite:&... -> \cite{&...}
;; OR? org - oc-biblatex.el
;; using #+CITE_EXPORT:
;;; Code:
(require 'ob-latex)
(require 'ob-gnuplot)
(require 'ox-latex)
(require 'ox-tufte)
;; add to general org variables, so that is works also to latex snippets, preview
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\ti}[1]{_\\mathrm{#1}}" t) ;; tiefstellen, Index
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\ho}[1]{^\\mathrm{#1}}" t) ;; hochstellen
(add-to-list 'org-latex-default-packages-alist "\\newcommand*{\\rom}[1]{\\mathrm{\\romannumeral #1}}" t) ;; \rom{2} -> ii
(add-to-list 'org-latex-default-packages-alist "\\makeatletter\\newcommand*{\\Rom}[1]{\\mathrm{\\expandafter\\@slowromancap\\romannumeral #1@}}\\makeatother" t) ;; \Rom{2} -> II
(add-to-list 'org-latex-default-packages-alist '("" "mathtools" t) t) ;; line underneath with text \\underbracket[1pt][0pt]{bla}_\\text{blo}
(add-to-list 'org-latex-default-packages-alist "\\newcommand\\Dfrac[2]{\\dfrac{\\displaystyle #1}{\\displaystyle #2}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\slfrac}[2]{\\left.#1\\middle/#2\\right.}" t)
(add-to-list 'org-latex-default-packages-alist '("" "xfrac" t) t) ;; defines \sfrac[<instance>]{<num>}[<sep>]{<denum>}
(add-to-list 'org-latex-default-packages-alist '("" "nicefrac" t) t)
(add-to-list 'org-latex-default-packages-alist '("" "faktor" t) t)
(add-to-list 'org-latex-default-packages-alist "\\DeclareDocumentCommand{\\Faktor}{s m O{0.5} m O{-0.5}}{%
\\setbox0=\\hbox{\\scalebox{0.8}{\\ensuremath{#2\\vphantom{1}}}}%
\\setbox1=\\hbox{\\ensuremath{\\diagup}}%
\\setbox2=\\hbox{\\scalebox{0.8}{\\ensuremath{#4}}}%
\\raisebox{#3\\ht1}{\\usebox0}%
\\mkern-5mu\\ifthenelse{\\equal{#1}{\\BooleanTrue}}%
{\\diagup}%
{\\rotatebox{-44}{\\rule[#5\\ht2]{0.4pt}{-#5\\ht2+#3\\ht0+\\ht0}}}%
\\mkern-4mu%
\\raisebox{#5\\ht2}{\\usebox2}%
}" t) ;; http://tex.stackexchange.com/questions/27591/extending-the-faktor-package/27735#27735"
(add-to-list 'org-latex-default-packages-alist '("thinspace,thinqspace,squaren,Gray" "SIunits" nil) t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\field}[1]{\\ensuremath{\\mathds{#1}}}" t) ;; \field{X} defined with mathds
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fA}{\\field{A}}" t) ;; \fA Affine field A
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fC}{\\field{C}}" t) ;; \fC Complex field C
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fFp}{\\ensuremath{\\field{F}_{\\!p}}}" t) ;; \fFp Finite field F_p
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fFq}{\\ensuremath{\\field{F}_{\\!q}}}" t) ;; \fFq Finite field F_q
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fGa}{\\ensuremath{\\field{G}_{a}}}" t) ;; \fGa Group scheme G_a
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fK}{\\field{K}}" t) ;; \fK Generic field K (Körper)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fN}{\\field{N}}" t) ;; \fN Natural numbers N
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fPj}{\\field{P}}" t) ;; \fPj Projective field P
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fR}{\\field{R}}" t) ;; \fR Real numbers R
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fQ}{\\field{Q}}" t) ;; \fQ Rational numbers Q
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fI}{\\field{I}}" t) ;; \fI Irrational numbers I
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fZ}{\\field{Z}}" t) ;; \fZ Integers Z
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\Def}{\\field{D}}" t) ;; \Def Domain of a function (Definitionsbereich)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\LM}{\\field{L}}" t) ;; \LM Solution set (Lösungsmenge)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\fdg}{\\;|\\;}" t) ;; \fdg 'für die gilt'
(add-to-list 'org-latex-default-packages-alist "\\newcommand*{\\qed}{\\hfill\\ensuremath{\\blacksquare}}" t) ;; \qed Q.E.D. quod erat demonstrandum "what was to be shown" -> "which was to be demonstrated"
(add-to-list 'org-latex-default-packages-alist "\\newcommand*\\euler{\\mathrm{e}}" t) ;; \euler e
(add-to-list 'org-latex-default-packages-alist '("" "xspace" nil) t) ;; for \deg
(add-to-list 'org-latex-default-packages-alist "\\renewcommand{\\deg}{\\ensuremath{^{\\circ}}\\xspace}" t) ;; for text \deg ° degree
(add-to-list 'org-latex-default-packages-alist "\\newcommand\\degC{{\\,^{\\circ}\\mathrm{C}}}" t) ;; \degC °C
(add-to-list 'org-latex-default-packages-alist "\\newcommand\\sins{{\\mathrm{s}}}" t) ;; \sins short sin: s
(add-to-list 'org-latex-default-packages-alist "\\newcommand\\coss{{\\mathrm{c}}}" t) ;; \coss short cos: c
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\T}{{\\mathrm{T}}\\!}" t) ;; \T Transpose operator
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\TF}{{\\raisebox{-0.5ex}{$\\sim$}}}" t) ;; \TF sign for transfomed values: low tilde
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\adj}{{\\mathrm{H}}}" t) ;; \adj Adjoint operator
(add-to-list 'org-latex-default-packages-alist "\\newcommand*\\dif{\\mathop{}\\!\\mathrm{d}}" t) ;; \dif
(add-to-list 'org-latex-default-packages-alist "\\newcommand*\\E{\\ensuremath{\\mathrm{E}}}" t) ;; \E
(add-to-list 'org-latex-default-packages-alist "\\providecommand{\\norm}[1]{\\lVert #1 \\rVert}" t) ;; \norm{x} ||x||
(add-to-list 'org-latex-default-packages-alist "\\providecommand{\\abs}[1]{\\lvert #1 \\rvert}" t) ;; \abs{x} |x|
(add-to-list 'org-latex-default-packages-alist "\\providecommand{\\innerProd}[2]{\\langle #1, #2\\rangle}" t) ;; \innerProd{x}{y} <x,y>
(add-to-list 'org-latex-default-packages-alist "\\DeclareMathOperator{\\Bild}{Bild}" t) ;; \Bild Map of a function (mapping, transformation)
(add-to-list 'org-latex-default-packages-alist "\\DeclareMathOperator{\\rank}{rank}" t) ;; \rank Rank of a matrix
(add-to-list 'org-latex-default-packages-alist "\\DeclareMathOperator{\\tr}{tr}" t) ;; \tr Matrix trace
(add-to-list 'org-latex-default-packages-alist "\\DeclareMathOperator{\\dev}{dev}" t) ;; \dev Matrix deviation
(add-to-list 'org-latex-default-packages-alist "\\DeclareMathOperator{\\var}{var}" t) ;; \var Variance
(add-to-list 'org-latex-default-packages-alist "\\DeclareMathOperator{\\grad}{grad}" t) ;; \(\grad u\) = grad u
(add-to-list 'org-latex-default-packages-alist "\\DeclareMathOperator{\\divergence}{div}" t) ;; \(\div u\) = div u
(add-to-list 'org-latex-default-packages-alist "\\DeclareMathOperator{\\rot}{rot}" t) ;; \(\rot u\) = rot u
(add-to-list 'org-latex-default-packages-alist "\\DeclareMathOperator{\\diag}{diag}" t) ;; Diagonal matrix
(add-to-list 'org-latex-default-packages-alist "\\DeclareMathOperator{\\adjugate}{adj}" t) ;; Classical adjoint (adjugate)
(add-to-list 'org-latex-default-packages-alist "\\newcommand*\\corresponds{\\mbox{\\kern0em\\raisebox{-.5ex}{\\Large\\^{}}\\kern-.55em\\raisebox{-.1ex}{=}}\\ }" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand*{\\dt}[1]{\\overset{\\mbox{\\large\\bfseries .}}{#1}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand*{\\ddt}[1]{\\overset{\\mbox{\\large\\bfseries .\\hspace{-0.1ex}.}}{#1}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand*{\\Eval}[3]{{\\left.#1\\phantom{\\Big|}\\!\\!\\right\\rvert_{#2}^{#3}}}" t)
(add-to-list 'org-latex-default-packages-alist '("" "accents" nil) t) ;; tensors
(add-to-list 'org-latex-default-packages-alist '("" "ushort" nil) t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensor}[1]{\\ensuremath{{\\boldsymbol{#1}}}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensorI}[1]{\\ensuremath{\\ushort{{\\boldsymbol{#1}}}}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensorII}[1]{\\ensuremath{\\ushortd{{\\boldsymbol{#1}}}}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensorIII}[1]{\\ensuremath{\\underaccent{3}{\\underaccent{\\tilde}{{\\boldsymbol{#1}}}}}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensorIV}[1]{\\ensuremath{\\underaccent{4}{\\underaccent{\\tilde}{{\\boldsymbol{#1}}}}}}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensori}[1]{
\\tikz[baseline, anchor=base,inner sep=0pt]{
\\node{\\ensuremath{\\phantom{#1\\vphantom{\\overrightharpoon{b}}}}};
\\node[overlay]{ \\ensuremath{ \\overrightharpoon{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } };
}
}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensorii}[1]{
\\tikz[baseline, anchor=base,inner sep=0pt]{
\\node{\\ensuremath{\\phantom{#1\\vphantom{\\overrightharpoon{b}}}}};
\\node[overlay]{ \\ensuremath{ \\overrightharpoon{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } };
\\node[overlay]{ \\reflectbox{ \\ensuremath{ \\overrightharpoon{ \\phantom{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } } } };
}
}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensoriii}[1]{
\\tikz[baseline, anchor=base,inner sep=0pt]{
\\node{\\ensuremath{\\phantom{#1\\vphantom{\\overrightharpoon{b}}}}};
\\node[overlay]{ \\ensuremath{ \\overrightarrow{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } };
\\node[overlay]{ \\reflectbox{ \\ensuremath{ \\overrightharpoon{ \\phantom{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } } } };
}
}" t)
(add-to-list 'org-latex-default-packages-alist "\\newcommand{\\tensoriv}[1]{
\\tikz[baseline, anchor=base,inner sep=0pt]{
\\node{\\ensuremath{\\phantom{#1\\vphantom{\\overrightharpoon{b}}}}};
\\node[overlay]{ \\ensuremath{ \\overrightarrow{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } };
\\node[overlay]{ \\reflectbox{ \\ensuremath{ \\overrightarrow{ \\phantom{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } } } };
}
}" t)
;; also added to `my-org-article-latex-default-packages-alist'
;; convert table #+name: glossary to \newglossaryentry to latex_header_extra
(add-hook 'org-export-before-parsing-hook
'org-ref-glossary-before-parsing)
;; convert table #+name: acronyms to \newacronym to latex_header_extra
(add-hook 'org-export-before-parsing-hook
'org-ref-acronyms-before-parsing)
;; General
(defvar my-org-article-export-headline-levels)
(defvar my-org-article-export-with-sub-superscripts)
(defvar my-org-article-export-with-toc)
;;; User Configurable Variables
(defgroup my-org-export-article nil
"Options for exporting Org mode files."
:tag "Org Export"
:group 'org)
(defcustom my-org-article-export-headline-levels 5
"See `org-export-headline-levels'."
:group 'my-org-export-article
:type 'integer
:safe #'integerp)
(defcustom my-org-article-export-with-sub-superscripts '{}
"See `org-export-with-sub-superscripts'."
:group 'my-org-export-article
:version "24.4"
:package-version '(Org . "8.0")
:type '(choice
(const :tag "Interpret them" t)
(const :tag "Curly brackets only" {})
(const :tag "Do not interpret them" nil))
:safe (lambda (x) (memq x '(t nil {}))))
(defcustom my-org-article-export-with-toc nil
"See `org-export-with-toc'."
:group 'my-org-export-article
:type '(choice
(const :tag "No Table of Contents" nil)
(const :tag "Full Table of Contents" t)
(integer :tag "TOC to level"))
:safe (lambda (x)
(or (booleanp x)
(integerp x))))
;; LaTeX
;;(setq org-babel-latex-htlatex "htlualatex")
;;(setq org-babel-latex-htlatex "htlatex")
;; (executable-find org-babel-latex-htlatex)
;; Babel latex and gnuplot
;; PROPERTY src block header arguments https://orgmode.org/manual/Property-Syntax.html
;; https://orgmode.org/manual/Using-Header-Arguments.html
;; on src block C-c C-v I - org-babel-view-src-block-info this will eval as org backend
;; LaTeX
(setq org-babel-default-header-args:latex
`((:results . "latex")
(:exports . "results")
(:headers . (lambda ()
;; define latex preamble part if used with ctrl-c-ctrl-c for example (the else part)
(if (org-export-derived-backend-p org-export-current-backend 'latex)
""
"")))
(:packages . ""
)))
;; Gnuplot
(setq org-babel-default-header-args:gnuplot
`((:results . "file")
(:exports . "results")
(:session)
(:prologue . (lambda ()
(concat (by-backend
(latex gnuplot-init-light)
(article-latex gnuplot-init-light)
(t gnuplot-init-dark)))))))
;; MACRO https://orgmode.org/manual/Macro-Replacement.html
(add-to-list
'org-export-global-macros
'("kbd" . "@@html:<kbd>$1</kbd>@@@@latex:\\keys{$1}@@") t)
(add-to-list
'org-export-global-macros
'("color" . "@@html:<font color=\"#$1\">$2</font>@@@@latex:\\textcolor[HTML]{$1}{$2}@@"))
(add-to-list
'org-export-global-macros
'("highlight" . "(eval (concat \"@@html:<mark style=\\\"\"
(when $2 (concat \"background-color:\" $2 \";\"))
(when $3 (concat \"border:1px solid \" $3 \";\"))
\"\\\">\" $1 \"</mark>@@\"
\"@@latex:\\\\highlight[\"
(when $2 (concat $2 \",\"))
(when $3 (concat \"draw=\" $3))
\"]{\" $1 \"}@@\"))") t)
(add-to-list 'org-export-global-macros
'("title-name" . "@@latex:\\mytitlename@@") t)
(add-to-list 'org-export-global-macros
'("keyword-name" . "@@latex:\\mykeywordname@@") t)
(add-to-list 'org-export-global-macros
'("description-name" . "@@latex:\\mydescriptionname@@") t)
;; QUOTATION
;;; quotation mark (auto language, html using main language)
(add-to-list
'org-export-global-macros
'("enquote" . "@@html:“$1”@@@@latex:\enquote{$1}@@"))
;;; german quotation (glqq: german left quote quote, grqq ...)
(add-to-list
'org-export-global-macros
'("gq" . "@@html:„$1“@@@@latex:\\glqq{}$1\\grqq{}@@"))
;;; french quotation (flqq: french left quote quote, frqq ...)
(add-to-list
'org-export-global-macros
'("fq" . "@@html:«$1»@@@@latex:\flqq{}$1\frqq{}@@"))
;; FONT
(add-to-list
'org-export-global-macros
'("textsc" . "@@html:<span style=\"font-variant-caps: small-caps;\">$1</span>@@@@latex:\\textsc{$1}@@"))
(add-to-list
'org-export-global-macros
'("ruby" . "@@html:<ruby>$1<rp>(</rp><rt>$2</rt><rp>)</rp></ruby>@@@@latex:\\ruby{$1}{$2}@@"))
;; LaTeX
;; TODO: can be removed, replaced by my-string-insert-after-nth-newline
(defun my-string-insert-after-first-newline (text parasite)
"insert a PARASITE string (and a newline character) into TEXT after
first newline and returns the new text."
(let ((textarray (split-string text "\n" nil)))
(concat (car textarray) "\n"
parasite "\n"
(string-join (cdr textarray) "\n"))))
(defun my-split (list count)
"Slit list at (after) COUNT element and return list containing both
sub lists."
;; Example:
;; (split '(a b c d e f g h i k) 3) -> ((a b c) (d e f g h j k))
;; https://codereview.stackexchange.com/a/179682
(values (subseq list 0 count) (nthcdr count list)))
(defun my-string-insert-after-nth-newline (text parasite nth)
"insert a PARASITE string (and a newline character) into TEXT after
NTH newline and returns the new text."
(let* ((textarraysplit (my-split (split-string text "\n" nil) nth)))
(concat (string-join (car textarraysplit) "\n") "\n"
parasite "\n"
(string-join (cadr textarraysplit) "\n"))))
(defun my-org-article-latex-appendix (headline backend info)
"Insert a appendix before the heading if property appendix is non-nil.
Uses function `my-org-headline-string-element' and
`my-string-insert-after-nth-newline' with nth equal 2.
A 'normal' looks like:
\\section{Appendix}
\\label{sec:org0069643}
Currently only one i.e. A.x is possible."
;; headline will have all the content and children, so the string after is at the end of the section
(when (org-export-derived-backend-p backend 'latex)
(let ((elmnt (my-org-headline-string-element headline backend info)))
(when (and elmnt (org-element-property :APPENDIX elmnt))
(concat
(my-string-insert-after-nth-newline
headline
"\\markboth{\\nameappendix}{\\nameappendix}
\\begin{mtchideinmaintoc}[-1]
\\setcounter{section}{0}
\\renewcommand{\\thesection}{A}
\\setcounter{subsection}{0}
\\setcounter{figure}{0}
\\setcounter{table}{0}
\\sectiontoc" 2)
;; %\\renewcommand{\\thesection}{\\Alph{section}} % will be A.x but points to 1.x
;; %\\renewcommand{\\thesubsection}{A\\arabic{subsection}}
;; %\\renewcommand{\\thetable}{A\\arabic{table}}
"\\end{mtchideinmaintoc}")))))
(add-to-list 'org-export-filter-headline-functions
'my-org-article-latex-appendix)
;;; Function Declarations
(defvar my-org-article-latex-default-packages-alist)
(defvar my-org-article-latex-packages-alist)
(defvar my-org-article-latex-compiler)
(defvar my-org-article-latex-default-class)
(defvar my-org-article-latex-default-class-options)
(defvar my-org-article-latex-header)
(defvar my-org-article-latex-header-extra)
(defvar my-org-article-latex-document-type)
(defvar my-org-article-latex-opening)
(defvar my-org-article-latex-closing)
(defvar my-org-article-latex-draft)
(defvar my-org-article-latex-references)
(defcustom my-org-article-latex-references "" "")
;; see ox-latex function org-export-define-backend
(org-export-define-derived-backend 'article-latex 'latex
:menu-entry
'(?l ?a
(
;;(?A "As LaTeX buffer" my-org-article-latex-export-as-latex)
;;(?a "As LaTeX file" my-org-article-latex-export-to-latex)
(?a "As PDF-article file" my-org-article-latex-export-to-pdf)
(?A "As PDF-article and open"
(lambda (a s v b)
(if a (my-org-article-latex-export-to-pdf t s v b)
(org-open-file (my-org-article-latex-export-to-pdf nil s v b)))))))
:options-alist
'(;; (:PROPERTY-NAME KEYWORD OPTION DEFAULT BEHAVIOR) see `org-export-options-alist'
(:headline-levels nil "H" my-org-article-export-headline-levels)
(:with-sub-superscript nil "^" my-org-article-export-with-sub-superscripts)
(:with-toc nil "toc" my-org-article-export-with-toc)
;; ox-latex
(:latex-class "LATEX_CLASS" nil my-org-article-latex-default-class t)
(:latex-class-options "LATEX_CLASS_OPTIONS" nil my-org-article-latex-default-class-options t)
(:latex-header "LATEX_HEADER" nil my-org-article-latex-header newline)
(:latex-header-extra "LATEX_HEADER_EXTRA" nil my-org-article-latex-header-extra newline)
(:latex-hyperref-template nil nil my-org-article-latex-hyperref-template t)
(:latex-compiler "LATEX_COMPILER" nil my-org-article-latex-compiler t)
;; custom
(:article-document-type "DOCUMENT_TYPE" nil my-org-article-latex-document-type t)
(:article-closing "CLOSING" nil my-org-article-latex-closing newline)
(:article-opening "OPENING" nil my-org-article-latex-opening newline)
(:article-draft nil "draft" my-org-article-latex-draft t) ;; toogle (nil/t) to activate draft visuals, see :draft in `my-org-article-latex-template-plist'
(:article-references "REFERENCES" nil my-org-article-latex-references newline)) ;; TODO not installed yet, maybe using oc-biblatex?
:translate-alist
'((template . my-org-article-latex-template)))
;;;; Compilation
(defcustom my-org-article-latex-compiler "lualatex"
"See `org-latex-compiler'."
:group 'my-org-export-article
:type '(choice
(const :tag "pdfLaTeX" "pdflatex")
(const :tag "XeLaTeX" "xelatex")
(const :tag "LuaLaTeX" "lualatex")
(const :tag "Unset" ""))
:version "26.1"
:package-version '(Org . "9.0"))
;;;; Preamble
(defcustom my-org-article-latex-default-class "koma-article"
"The default LaTeX class."
:group 'my-org-export-article
:type '(string :tag "LaTeX class"))
(defvar my-org-article-latex-header-biblatex
"
%\\usepackage[fixlanguage]{babelbib} % Mehrsprachige Literaturliste, nicht mit biblatex
%\\selectbiblanguage{german}
\\usepackage[
%bibstyle=chem-acs,
style=numeric-comp, % alphabetic, numeric-comp, authoryear-icomp, authortitle-icomp
sorting=none, % name, title, year, none
%abbreviate=false, % keine Abkürzungen
%sortcites=true, % sorted according to the global sorting order
%sortgiveninits=true, % sorting names will only use their initials
%block=nbpar, % none, space, par, nbpar, ragged
autocite=footnote, % citations as footnotes
uniquename=init, % set true if giveninits is set to true
giveninits=true, % all first and middle names will be rendered as initials
isbn=false,
maxnames=2,
backend=biber, % backend=bibtex8 by latin1, biber by utf8
safeinputenc, % erlaubt Zeichen aus dem tipa-Paket (Biber only)
]{biblatex}
% Erst Nachname, dann Vorname
\\DeclareNameAlias{default}{family-given}
% Autorennamen in Kapitälchen
\\renewcommand*{\\mkbibnamelast}[1]{\\textsc{#1}}
% muss ich noch nachvollziehen, nur dick?
\\renewbibmacro*{author/editor+others/translator+others}{%
%\\mkbibbold{% ADDED
\\ifboolexpr{
test \\ifuseauthor%
and
not test {\\ifnameundef{author}}
}
{\\usebibmacro{author}}
{\\ifboolexpr{
test \\ifuseeditor%
and
not test {\\ifnameundef{editor}}
}
{\\usebibmacro{editor+others}}
{\\usebibmacro{translator+others}}}
%}% ADDED
}
% Trennen mit Semikolon, bei mehreren Autoren
\\renewcommand*{\\multinamedelim}{\\addsemicolon\\space}
\\renewcommand*{\\finalnamedelim}{\\addsemicolon\\space}
% : als Trennzeichen nach Titel
%\\DeclareFieldFormat{title}{\\mkbibemph{#1}~:\\addspace}
\\renewbibmacro*{title}{%
\\ifthenelse{\\iffieldundef{title}\\AND\\iffieldundef{subtitle}}
{}
{\\printtext[title]{%
\\printfield[titlecase]{title}}%
%\\setunit{\\subtitlepunct}% DELETE
\\setunit{~:\\addspace}%
% DELETE and close in title
%\\printfield[titlecase]{subtitle}}
% ADD
\\printfield{subtitle}
\\newunit}%
\\printfield{titleaddon}}
% Änderung des Subtitles
\\DeclareFieldFormat{subtitle}{\\mkbibemph{#1}}
% : als Trennzeichen zwischen Ort und Verlag
\\renewbibmacro*{publisher+location+date}{%
\\printlist{location}%
\\iflistundef{publisher}
{\\setunit*{\\addcomma\\space}}
% {\\setunit*{addcolon\\space}}% DELETED
{\\setunit*{~:\\space}}% ADDED
\\printlist{publisher}%
\\setunit*{\\addcomma\\space}%
\\usebibmacro{date}%
\\newunit}
\\DeclareFieldFormat{edition}{%
\\ifinteger{#1}
{\\mkbibordedition{#1}~\\bibstring{edition}}% DELETED
% {\\mkbibordedition{#1}\\bibstring{edition}}% ADDED
{#1\\isdot}}
%Doppelpunkt statt Komma vor der Seitenangabe in der Zitierung, z.B. «(Gaukeley 2005: S. 387)»
\\renewcommand{\\postnotedelim}{\\addcolon\\addspace}
%Kein einleitendes «S.» vor der Seitenangabe in der Zitierung, z.B. «(Gaukeley 2005: 387)»
\\DeclareFieldFormat{postnote}{#1}
% Doppelpunkt statt Punkt vor dem Titel in der Literaturliste,
% z.B. «Gaukeley, Gundel (2005): Das kleine Einmaleins der Hexerei. [...]»
\\renewcommand{\\labelnamepunct}{\\addcolon\\addspace}
% Allfällige Angabe von Serie und Nummer in der Literaturliste eingeklammert und mit Gleichheitszeichen versehen,
% z.B. «[...] (= Schriftenreihe des Entenhausener Pfadfinderverbandes 13).»
\\renewbibmacro*{series+number}{%
\\iffieldundef{series}
{}
{\\printtext[parens]{%
\\iffieldundef{number}
{}
{=\\addhpthinspace}%
\\printfield{series}%
\\setunit*{\\addspace}%
\\printfield{number}%
}}\\newunit}
% Allfälliges Datum der Erstausgabe in der Literaturliste,
% z.B. «Duck, Tick u.a. (1966/2004): Ordens- und Abzeichenkunde für Fieselschweiflinge. [...]»
%\\renewbibmacro*{date+extrayear}{
\\newbibmacro*{date+extrayear}{%
\\iffieldundef{year}
{}
{\\printtext[parens]{%
\\iffieldundef{origyear}
{}
{\\printfield{origyear}\\addslash}%
\\printdateextra}}}
% Allfälliges Datum der Erstausgabe in Zitierungen, z.B. «(Duck u.a. 1966/2004: 37 f.)»
%\\renewbibmacro*{cite:labelyear+extrayear}{%
\\newbibmacro*{cite:labelyear+extrayear}{%
\\iffieldundef{labelyear}
{}
{\\printtext[bibhyperref]{%
\\iffieldundef{origyear}
{}
{\\printfield{origyear}\\addslash}%
\\printfield{labelyear}%
\\printfield{extrayear}}}}
% Hat es mehrere Werke derselben Person(en), den Strich durch eine entsprechende Abkürzung ersetzen (wie ders./dies.)
\\renewcommand*{\\bibnamedash}{%
\\bibsentence\\bibstring{idem\\thefield{gender}}}
% Hat/haben die Person(en) eines der zusätzlichen Werke nur herausgegeben, vor der Abkürzung Komma und Leerschlag einfügen
% Erfordert Angabe des Geschlechts in .bib, gender={sf} sn, pp
%\\renewbibmacro*{bbx:editor}[1]{%
\\newbibmacro*{bbx:editor}[1]{%
\\ifboolexpr{
test \\ifuseeditor%
and
not test {\\ifnameundef{editor}}
}
{\\usebibmacro{bbx:dashcheck}
{\\bibnamedash%
\\setunit{\\addcomma\\space}}
{\\printnames{editor}%
\\setunit{\\addcomma\\space}%
\\usebibmacro{bbx:savehash}}%
\\usebibmacro{#1}%
\\clearname{editor}%
\\setunit{\\addspace}}%
{\\global\\undef\\bbx@lasthash
\\usebibmacro{labeltitle}%
\\setunit*{\\addspace}}%
\\usebibmacro{date+extrayear}}
\\addbibresource{references.bib}
"
"Used in `my-org-article-latex-template-plist'
points to references.bib")
(defvar my-org-article-latex-template-plist
(list
:draft "\\setlength{\\overfullrule}{5pt}"
;; LANG REPLACEMENTS
:documentclass-en "english"
:documentclass-de "ngerman"
;;; FONTS
:babel-en "\\usepackage[english]{babel}"
:babel-de "\\usepackage[ngerman]{babel}"
:fontspec-en ""
:fontspec-ja "\\usepackage{luatexja-fontspec} % add japanese support using lualatex compiler"
:ruby-en ""
:ruby-ja "\\usepackage[CJK,overlap]{ruby} % support for FURIGANA - japanese"
;;; REFERENCES
:biblatex-en my-org-article-latex-header-biblatex
:biblatex-de-rott ""
:csquotes-en "\\usepackage[autostyle]{csquotes}"
:csquotes-de "\\usepackage[autostyle,german=quotes]{csquotes}"
;;; APPENDIX
:mtcselectlanguage-en ""
:mtcselectlanguage-de "\\mtcselectlanguage{german}"
;;; LISTINGS lstlistingname for the caption of listings and lstlistlistingname for the table of listings
:lstlistingname-en "\\renewcommand{\\lstlistlistingname}{List of Listings}"
:lstlistingname-de "\\renewcommand{\\lstlistingname}{Programmausdruck}\\renewcommand{\\lstlistlistingname}{Programmausdrucke}"
:siunitx-en ""
:siunitx-de "\\sisetup{locale = DE}"
)
"Replacements.
:documentclass-xx used in
`my-org-article-latex-default-class-options' as <<documentclass>>
all other in `my-org-article-latex-header' template replacements
in `my-org-article-latex-template-value' IMPORTANT an 'en'
version must be defined. This is the fallback for language
replacements.")
(defcustom my-org-article-latex-default-class-options
;; DIV: Satzspiegel
;; BCOR: Bindungskorrektur
;; captions: correct spacing for captions ABOVE the table
;; bibliography: add to toc
;; %titlepage: first page, cover page (invoking \maketitle)
;; %draft: display a block at the end of a line, which is too long (bad line break)
;; dvipsnames: colors
"\
[
paper=a4,
fontsize=11pt,
DIV=12,
BCOR=10mm,
headsepline,
%<<documentclass>>,
captions=tableheading,
version=first,
bibliography=totoc,
dvipsnames,
]"
"The default LaTeX class options.
Replaces <<...>> with values defined in
`my-org-article-latex-template-plist'"
:group 'my-org-export-article
:type '(string :tag "LaTeX class"))
(add-to-list 'org-latex-classes
;; (numbered-section . unnumbered-section)
'("koma-article" "\\documentclass{scrartcl}"
("\\cleardoublepage\\section{%s}\\thispagestyle{plain}" . "\\def\\my_org_article_section{%s}\\cleardoublepage\\section*{\\my_org_article_section}\\phantomsection\\addcontentsline{toc}{section}{\\my_org_article_section}\\thispagestyle{plain}")
("\\subsection{%s}" . "\\def\\my_org_article_subsection{%s}\\subsection*{\\my_org_article_subsection}\\phantomsection\\addcontentsline{toc}{subsection}{\\my_org_article_subsection}")
("\\subsubsection{%s}" . "\\def\\my_org_article_subsubsection{%s}\\subsubsection*{\\my_org_article_subsubsection}\\phantomsection\\addcontentsline{toc}{subsubsection}{\\my_org_article_subsubsection}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
(defcustom my-org-article-latex-header
;; see also `my-org-article-latex-default-packages-alist'
"\
%<<draft>>
%<<babel>>
%<<fontspec>>
%<<lstlistingname>>
\\def\\nameappendix{Appendix}
%<<biblatex>>
%<<csquotes>>
%<<siunitx>>
" "Inserted after `my-org-article-latex-default-packages-alist'.")
(defcustom my-org-article-latex-header-bak
"
%%%
%%% ARTICLE
%%%
% provides \\isempty test
\\usepackage{xifthen}
%\\newcommand{\\optarg}[1][]{%
% \\ifthenelse{\\isempty{#1}}%
% {}% if #1 is empty
% {(((#1)))}% if #1 is not empty
%}
\\makeatletter
\\newcommand{\\@scrartcl@loaded}{0}
\\AtBeginDocument{\\@ifpackageloaded{scrartcl}
{\\renewcommand{\\@scrartcl@loaded}{1}}
{\\renewcommand{\\@scrartcl@loaded}{0}}
}
\\makeatother
%%%
%%% COLORS
%%%
\\usepackage{colortbl}
\\xdefinecolor{navyblue}{rgb}{0,0.35,0.62}
% links, \\everydisplay:
\\definecolor{darkred}{rgb}{0.88,0.16,0.17}
\\definecolor{dkgreen}{rgb}{0,0.6,0}
\\definecolor{gray}{rgb}{0.5,0.5,0.5}
% listings:
\\definecolor{mauve}{rgb}{0.58,0,0.82}
\\definecolor{orange}{rgb}{0.8 0.4 0.2}
\\definecolor{dkorange}{rgb}{0.68 0.25 0.07}
\\definecolor{rouge}{rgb}{0.79 0.0 0.1}
\\definecolor{matlab1}{HTML}{0071BC}
\\definecolor{matlab2}{HTML}{D85218}
\\definecolor{matlab3}{HTML}{ECB01F}
\\definecolor{matlab4}{HTML}{7D2E8D}
\\definecolor{matlab5}{HTML}{76AB2F}
\\definecolor{matlab6}{HTML}{4CBDED}
\\definecolor{matlab7}{HTML}{A1132E}
%%%
%%% PAGE
%%%
\\newif\\iftwocol%
%\\twocoltrue
\\twocolfalse%
% Verzeichnis
\\iftwocol%
\\usepackage[toc]{multitoc}
\\renewcommand*{\\multicolumntoc}{2}
\\setlength{\\columnseprule}{0.5pt}
\\fi
% debug the box warnings
\\showboxdepth=\\maxdimen%
\\showboxbreadth=\\maxdimen%
% \\pdfminorversion=5 % to allow compression ## LuaLatex does not understand this
% \\pdfobjcompresslevel=2 ## LuaLatex does not understand this
\\usepackage{afterpage}
\\makeatletter
\\def\\mynobreakpar{\\par\\nobreak\\@afterheading}
\\def\\mynobreakline{\\par\\nobreak\\vspace{-\\parskip}\\@afterheading\\noindent}
\\makeatother
\\newenvironment{absolutelynopagebreak}
{\\par\\nobreak\\vfil\\penalty0\\vfilneg%
\\vtop\\bgroup}
{\\par\\xdef\\tpd{\\the\\prevdepth}\\egroup%
\\prevdepth=\\tpd}
%\\begin{absolutelynopagebreak}
%\\lipsum[1-3]\\lipsum*[4]
%\\end{absolutelynopagebreak}
%%%
%%% FONTS
%%%
% -----------------------------------------
% Schrift
% -----------------------------------------
\\usepackage[scale=0.95]{opensans}
% hyphenatable letterspacing, underlining and some derivatives such as overstriking and highlighting, soul
\\usepackage{soulutf8}
% \\so{letterspacing} l e t t e r s p a c i n g
% \\caps{CAPITALS, Small Capitals} like \\textsc{}
% \\ul{underlining}
% \\st{overstriking}
% \\hl{highlighting}
% Damit ich mir nicht immer neuen Text ausdenken muss
\\usepackage{blindtext}
% use: \\ce IMPORTANT: mhchem must be load before sparse and/or xpatch: l3str: \\c_backslash_str
\\usepackage[version=3]{mhchem}
\\usepackage{xparse}
% \\tiny \\scriptsize \\footnotesize \\small
% \\normalsize (default)
% \\large \\Large \\LARGE \\huge \\Huge
%\\usepackage[normalem]{ulem}
% \\uline{...} Underlined text, breaks over multiple lines
% \\uuline{...} double-underlined text
% \\uwave{...} wave-underlined text
% \\sout{...} ------------
% \\xout{...} ////////////
% remap ulem command to soul: underline
%\\renewcommand{\\uline}[1]{\\ul{#1}}
% remap ulem command to soul: overstriking
% TODO uncomment?
\\renewcommand{\\sout}[1]{\\st{#1}}
<<ruby>>
%%%
%%% REFERENCES
%%%
% -----------------------------------------
% Literatur
% -----------------------------------------
\\expandafter\\def\\expandafter\\quote\\expandafter{\\quote\\small} % Schriftverkleinerung in quote-Umgebung
% cite, key, page numbers
\\newcommand{\\zitat}[3]{
\\begin{quote}\\small
#1
% \\psq: no suffixes/prefix
\\hfill\\autocite[#3\\psq]{#2}
\\end{quote}
}
%%%
%%% ACRONYMS
%%%
% -----------------------------------------
% Listen: Aufzählende, Acronyms
% -----------------------------------------
\\setlength{\\leftmargini}{2\\parskip} % Listeneinzug
% how to use acronyms:
% \\ac = use acronym, first time write both, full name and acronym
% \\acf = use full name (text + acronym)
% \\acs = only use acronym
% \\acl = only use long text
% \\acp, acfp, acsp, aclp = use plural form for acronym (append 's')
% \\acsu, aclu = write + mark as used
% \\acfi = write full name in italics and acronym in normal style
% \\acused = mark acronym as used
% \\acfip = full, emphasized, plural, used
% \\iac and \\Iac = indefinite articles
\\usepackage[
%footnote, % die Langform als Fußnote ausgeben
%nohyperlinks, % wenn hyperref geladen ist, wird die Verlinkung unterbunden
%printonlyused, % nur Abkürzungen auflisten, die tatsächlich verwendet werden.
%withpage,
%smaller, % Text soll kleiner erscheinen, das Paket relsize wird vorausgesetzt
%dua, % es wird immer die Langform ausgegeben
%nolist, % es wird keine Liste mit allen Abkürzungen ausgegeben
]{acronym}
\\renewcommand\\acsfont{\\normalfont}
\\makeatletter
\\def\\uplabel#1{{\\normalfont{\\textsf{#1}}\\hfill}}
\\renewenvironment{acronym}[1][1]{%
\\singlespacing%
\\setstretch{0.8}
\\providecommand*{\\acro}{\\AC@acro}%
\\providecommand*{\\acroplural}{\\AC@acroplural}%
\\long\\def\\acroextra##1{##1}%
\\def\\@tempa{1}\\def\\@tempb{#1}%
\\ifx\\@tempa\\@tempb%
\\global\\expandafter\\let\\csname ac@des@mark\\endcsname\\AC@used%
\\ifAC@nolist%
\\else%
\\begin{list}{}%
% change according to your needs , 4.45
{\\settowidth{\\labelwidth}{\\normalfont{\\textsf{#1}}\\hspace*{3.5em}}%
\\setlength{\\leftmargin}{\\labelwidth+\\parskip}%
\\addtolength{\\leftmargin}{\\labelsep}%
\\renewcommand{\\makelabel}{\\uplabel}}
\\fi%
\\else%
\\begin{AC@deflist}{#1}%
\\fi%
}%
{%
\\ifx\\AC@populated\\AC@used\\else%
\\ifAC@nolist%
\\else%
\\item[]\\relax%
\\fi%
\\fi%
\\expandafter\\ifx\\csname ac@des@mark\\endcsname\\AC@used%
\\ifAC@nolist%
\\else%
\\end{list}%
\\fi%
\\else%
\\end{AC@deflist}%
\\fi}%
\\renewenvironment{AC@deflist}[1]%
{\\ifAC@nolist%
\\else%
\\raggedright\\begin{list}{}%
% change according to your needs , 4.45
{\\settowidth{\\labelwidth}{\\normalfont{\\textsf{#1}}\\hspace*{3.5em}}%
\\setlength{\\leftmargin}{\\labelwidth}%
\\addtolength{\\leftmargin}{\\labelsep}%
\\renewcommand{\\makelabel}{\\uplabel}}%
\\fi}%
{\\ifAC@nolist%
\\else%
\\end{list}%
\\fi}%
\\makeatother
%%%
%%% APPENDIX
%%%
% -----------------------------------------
% Abschnittsverzeichnisse (Anhang)
% -----------------------------------------
\\usepackage{appendix}
\\setcounter{tocdepth}{3}
\\setcounter{secnumdepth}{3}
% hyperref must be loaded before minitoc
\\makeatletter
\\ifthenelse{\\@scrartcl@loaded=1}{
\\usepackage[insection,nohints]{minitoc}
\\mtcsetdepth{secttoc}{3}
%\\setlength{\\stcindent}{-16.5pt}
\\setlength{\\stcindent}{0pt}
\\mtcsetformat{secttoc}{pagenumwidth}{2em} % more space for page numbers
%\\renewcommand{\\stctitle}{} % Leer: Keine Überschrift
\\renewcommand{\\stcfont}{\\normalfont\\rmfamily\\upshape\\mdseries}
}{
\\usepackage[nohints]{minitoc}
}
\\makeatother
\\makeatletter
\\def\\mtc@CkFile#1{%
\\@mtc@LItrue\\@mtc@FEtrue%
\\if@mtc@checkfiles%
\\IfFileExists{#1}{%
\\immediate\\openin\\@inputcheck #1\\relax
\\mtc@While{}{\\if@mtc@LI\\relax}{\\mtc@Body}\\mtc@EndWhile%
%
}%
{\\@mtc@FEtrue}%
\\else
\\@mtc@FEfalse%
\\fi
%moved in the definition
\\closein\\@inputcheck\\relax}%
\\makeatother
<<mtcselectlanguage>>
% \\sffamily
\\mtcsetfont{secttoc}{subsection}{\\normalfont\\rmfamily\\upshape\\mdseries}
\\mtcsetfont{secttoc}{subsubsection}{\\normalfont\\rmfamily\\upshape\\mdseries}
% local use: \\nostcrule
\\mtcsetrules{*}{off}
%\\mtcsetpagenumbers{mini-table|*}{on|off}
\\newcommand{\\pdfsection}[1]{
\\addtocounter{section}{1}
\\phantomsection\\addcontentsline{toc}{section}
{\\protect\\numberline{\\thesection}#1}
}
\\newcommand{\\pdfsubsection}[1]{
\\addtocounter{subsection}{1}
\\phantomsection\\addcontentsline{toc}{subsection}
{\\protect\\numberline{\\thesubsection}#1}
}
\\newcommand{\\pdfsubsubsection}[1]{
\\addtocounter{subsubsection}{1}
\\phantomsection\\addcontentsline{toc}{subsubsection}
{\\protect\\numberline{\\thesubsubsection}#1}
}
\\newcommand{\\pdfsectiona}[1]{
% Den folgenden Inhalt nicht im großen Inhaltsverzeichnis zeigen
\\begin{mtchideinmaintoc}[-1]
\\addtocounter{section}{1}
\\phantomsection\\addcontentsline{toc}{section}
{\\protect\\numberline{\\thesection}#1}
\\end{mtchideinmaintoc}
}
\\newcommand{\\pdfsubsectiona}[1]{
% Den folgenden Inhalt nicht im großen Inhaltsverzeichnis zeigen
\\begin{mtchideinmaintoc}[-1]
\\addtocounter{subsection}{1}
\\phantomsection\\addcontentsline{toc}{subsection}
{\\protect\\numberline{\\thesubsection}#1}
\\end{mtchideinmaintoc}
}
\\newcommand{\\pdfsubsubsectiona}[1]{
% Den folgenden Inhalt nicht im großen Inhaltsverzeichnis zeigen
\\begin{mtchideinmaintoc}[-1]
\\addtocounter{subsubsection}{1}
\\phantomsection\\addcontentsline{toc}{subsubsection}
{\\protect\\numberline{\\thesubsubsection}#1}
\\end{mtchideinmaintoc}
}
%%%
%%% INDEX
%%%
\\usepackage{imakeidx}
%\\usepackage{splitidx}
\\newcommand{\\Index}[1]{#1\\index{#1}}
% Formatiere Seitennummern im Index:
\\newcommand{\\indexpageno}[1]{%
{\\bfseries\\hyperpage{#1}}%
}
\\makeindex
%\\makeindex[%
%name=persons,
%title=Index of names,
%columns=3
%]
\\usepackage{idxlayout} % avoid LaTeX bug 3126 (\twocolumn interfering with \topskip)
\\usepackage{ragged2e} % avoid the automatic loading of the ragged2e package failure
%\\index[persons]{Einstein, Albert}
\\indexsetup{%
level=\\section*,
toclevel=section,
noclearpage,
%firstpagestyle=plain, % disabled when the package fancyhdr is loaded
%headers={\\indexname}{\\indexname} % Dont use these keys if you use fancyhdr
}
%save as <filename>.mst:
%headings_flag 1
%heading_prefix \"{\\\\bf ---~\"
%heading_suffix \"~---}\"
%delim_0 \"\\\\dotfill\\\\indexpageno{\"
%delim_1 \"\\\\dotfill\\\\indexpageno{\"
%delim_2 \"\\\\dotfill\\\\indexpageno{\"
%delim_t \"}\"
%delim_n \"}, \\\\indexpageno{\"
%delim_r \"} -- \\\\indexpageno{\"
%suffix_2p \"}f.{\"
%suffix_3p \"}ff.{\"
%symhead_negative \"Symbole\"
%symhead_positive \"Symbole\"
%numhead_negative \"Zahlen\"
%numhead_positive \"Zahlen\"
%quote '+'
%line_max 255
%%%
%%% FIGURES
%%%
% -----------------------------------------
% Abbildungen & Tabellen
% -----------------------------------------
\\usepackage{float}
\\usepackage{floatflt}
\\usepackage{subcaption}
\\usepackage{tablefootnote}
% -----------------------------------------
% Abbildungen
% -----------------------------------------
\\usepackage[%
%draft,
%dvips, % or dvipdfm, pdftex
]{graphicx}
%\\graphicspath{{path_to_images/}}
%\\graphicspath{{the/first/path/}{the/second/path/}}
\\graphicspath{{./figures/}}
% Grafik abschneiden (links unten rechts oben):
% \\includegraphics[trim=0 0 2cm 0,clip,width=\\textwidth]{Bild}
% with px units, where <dpi> is the resolution of the image:
% \\pdfpxdimen=\\dimexpr 1 in/<dpi>\\relax
% \\includegraphics[trim=0 0 20px 0,clip,width=\\textwidth]{Bild}
% or use defined dpi option:
\\makeatletter
\\define@key{Gin}{dpi}{%
\\pdfpxdimen=\\dimexpr 1in/(#1)\\relax }
\\makeatother
% \\includegraphics[dpi=600,clip,trim=0 100px 200px 100px]{Figure-a} % 600 dpi
% Diagramme
\\usepackage[all]{xy}
% -----------------------------------------
% Tabellen
% -----------------------------------------
%\\usepackage{rotating} % rotated text, vertical: \\begin{sideways} ... \\end{sideways}
% fuer mehrspaltigen Text auf einer Seite
\\usepackage{multicol}
% fuer mehrreihigen Text auf einer Seite
\\usepackage{multirow}
% Anzahl Zeilen, Weite, Inhalt
\\newcommand{\\multirowr}[3]{\\multirow{#1}{*}{\\parbox{#2}{\\raggedright #3}}}
\\usepackage{eqnarray}
\\usepackage{spreadtab} % Rechenmöglichkeit in Tabellen
%%%
%%% LISTINGS
%%%
% BEFORE loading tikz!?
\\lstdefinestyle{tex}{
language=[LaTeX]tex,
tabsize=4,
breaklines=true,
breakindent=0pt,
columns=fullflexible,
% otherwise copy-and-paste wont work
basicstyle=\\ttfamily
}
% not needed for lualatex?
\\lstset{literate=%
{Ö}{{\\\"O}}1
{Ä}{{\\\"A}}1
{Ü}{{\\\"U}}1
{ß}{{\\ss}}1
{ü}{{\\\"u}}1
{ä}{{\\\"a}}1
{ö}{{\\\"o}}1
}
%%%
%%% MATH
%%%
% another slanted fration below at tikz
\\usepackage{amsthm}
\\theoremstyle{definition}
% nummeriert
\\newtheorem{tDef}{Def}
\\newtheorem{tBsp}{Bsp}
% unnummeriert
\\newtheorem*{tDef*}{Def}
\\newtheorem*{tBsp*}{Bsp}
\\newcommand{\\undertab}[1]{\\clap{%
\\scriptsize\\begin{tabular}{@{}c@{}}#1\\end{tabular}}}
% underbrace, centered, space corrected
\\newcommand{\\ubspace}[2]{% Correct \\underbrace spacing
\\mathrlap{\\underbrace{\\phantom{\\scalebox{0.95}{$#1$}\\strut}}_{\\undertab{#2}}}#1}
% underbrace, left aligned, space corrected
\\newcommand{\\ubspacel}[2]{% Correct \\underbrace spacing
\\mathrlap{\\underbracket[0pt][0pt]{\\phantom{\\scalebox{0.95}{$#1$}\\strut}}_{\\vphantom{\\big\\mid}\\text{#2}}}\\underbrace{#1}}
% underbrace line, left aligned, space corrected
\\newcommand{\\ubspacell}[2]{
\\mathrlap{\\underbracket[0pt][0pt]{\\phantom{#1\\strut}}_{\\text{#2}}}\\underbracket[0.5pt][0pt]{#1}}
\\usepackage{cancel}
%\\begin{pmatrix}[1.5] -> \\arraystretch{1.5}
\\makeatletter
\\renewcommand*\\env@matrix[1][\\arraystretch]{%
\\edef\\arraystretch{0.8}%
\\edef\\arraystretch{#1}%
\\edef\\arraycolsep{2pt}%
\\hskip -\\arraycolsep%
\\let\\@ifnextchar\\new@ifnextchar%
\\array{*\\c@MaxMatrixCols c}}
\\makeatother
\\newenvironment{Array}[1]{
\\begingroup
\\arraycolsep=1pt\\def\\arraystretch{1}
\\begin{array}{@{}#1@{}}
}{\\end{array}\\endgroup}
%%%
%%% TIKZ
%%%
% -----------------------------------------
% Zeichnungen
% -----------------------------------------
\\usepackage{tabularx}
\\pgfplotsset{
% or newest,
compat=1.17,
% Komma statt Punkt als Dezimaltrennzeichen
x tick label style={/pgf/number format/use comma},
y tick label style={/pgf/number format/use comma},
every node near coord/.style={/pgf/number format/use comma},
/pgfplots/annot/js fillColor={[\"RGB\",1,1,1]},
every semilogy axis/.append style={/pgfplots/annot/point format={(\\%.1f,\\%.1e)}},
every semilogx axis/.append style={/pgfplots/annot/point format={(\\%.1e,\\%.1f)}},
every loglog axis/.append style={/pgfplots/annot/point format={(\\%.1e,\\%.1e)}}
}
\\usepackage{pgfplotstable}
\\colorlet{darkgreen}{green!50!black}
\\colorlet{lightgreen}{green!80!black}
\\colorlet{darkred}{red!50!black}
\\colorlet{lightred}{red!80!black}
% this must be under the configuration of x tick label
% legend position outer south
\\makeatletter
\\pgfplotsset{
every axis x label/.append style={
alias=current axis xlabel
},
legend pos/outer south/.style={
/pgfplots/legend style={
at={%
(%
\\@ifundefined{pgf@sh@ns@current axis xlabel}%
{xticklabel cs:0.5}%
{current axis xlabel.south}%
)%
},
anchor=north
}
}
}
\\makeatother
% !!!! in tikzset sind keine Leerzeilen erlaubt !!!!
\\tikzset{
%scale a tikzpicture including texts
global scale/.style={
scale=#1,
every node/.style={scale=#1}
},
%Define standard arrow tip
>=stealth',
%Define standard node
%every text node part/.style={align=left},
% Colors
}
% Funktionsstruktur
\\tikzset{
%Define style for boxes
punkt/.style={
rectangle,
%rounded corners,
%very thick,
draw=black,
% gray
left color=navyblue!0,
right color=navyblue!30,
text width=6em,
minimum height=4em,
text centered},
dummyPunkt/.style={
rectangle,
text width=6em,
minimum height=4em},
dummy/.style={
rectangle,
text width=0.1em,
minimum height=4em},
%
%Define style for node
aboveOf/.style={
above=0.75cm of #1},
belowOf/.style={
below=0.75cm of #1},
% node input
ni/.style={
above right,
xshift=2mm},
% node output
no/.style={
above left,
xshift=-2mm},
%
% Define arrow style
trans/.style={
->,
thick,
shorten >=0pt,
shorten <=0pt,
>=stealth},
classical/.style={
->,
% semithick
thick,
double distance=1pt,
shorten >=0pt,
shorten <=0pt,
>=stealth},
virtual/.style={
->,
thick,
densely dashed,
>=stealth},
}
% Linien
\\tikzset{
line1/.style={
line width = 3,
line cap=round,
NavyBlue},
line2/.style={
line width = 3,
line cap=round,
loosely dashed,
red},
axis/.style={thick, ->, >=stealth'},
graph1/.style={
thick,
line cap=round,
NavyBlue},
}
% Graphen
\\tikzset{
draw0/.style={
gray},
draw1/.style={
very thick,
NavyBlue},
draw2/.style={
very thick,
red},
draw3/.style={
very thick,
dkgreen},
draw4/.style={
very thick,
orange},
draw10/.style={
very thick,
black},
fill0/.style={
fill=gray!100,
draw=none,
very nearly transparent},
fill1/.style={
fill=MidnightBlue!20,
draw=none},
fill2/.style={
fill=red!20,
draw=none},
}
\\tikzset{
every pin/.style={fill=white,rectangle,rounded corners=3pt,font=\\small},
small dot/.style={fill=black,circle,scale=0.3},
}
\\tikzset{color0/.style={color=black}}
\\newcommand{\\FB}[7]{%
\\begin{tikzpicture}[auto, node distance=2cm,>=latex']
\\setstretch{0.8}
\\begin{scope}[xscale=1, yscale=1, xshift=7.8cm]\\small
\\ifthenelse{\\isempty{#2}}%
% if #2 is empty
{}%
% if #2 is not empty
{\\draw[trans] (0,0.85) node[above right,yshift=-1mm,text width=2.5cm] {#2\\(_{}\\)} --(2.5,0.85) ;}%
\\ifthenelse{\\isempty{#4}} {}
{\\draw[classical] (0,0) node[above right,yshift=-1mm,text width=2.5cm] {#4\\(_{}\\)}--(2.5,0);}
\\ifthenelse{\\isempty{#6}} {}
{\\draw[virtual] (0,-0.85) node[above right,yshift=-1mm,text width=2.5cm] {#6\\(_{}\\)}--(2.5,-0.85);}
\\ifthenelse{\\isempty{#3}} {}
{\\draw[trans] (6.25,0.85) node[above right,xshift=1mm,yshift=-1mm,text width=2.5cm] {#3\\(_{}\\)}--(8.75,0.85);}
\\ifthenelse{\\isempty{#5}} {}
{\\draw[classical] (6.25,0) node[above right,xshift=1mm,yshift=-1mm,text width=2.5cm] {#5\\(_{}\\)}--(8.75,0);}
\\ifthenelse{\\isempty{#7}} {}
{\\draw[virtual] (6.25,-0.85)node[above right,xshift=1mm,yshift=-1mm,text width=2.5cm] {#7\\(_{}\\)}--(8.75,-0.85) ;}
\\ifthenelse{\\isempty{#1}} {}
% gray!30
{\\node[draw=black,left color=navyblue!0,right color=navyblue!30,text width=3.5cm,minimum height=2.5cm,text centered,right=2.5cm] (f){\\normalsize#1};}
\\end{scope}
\\end{tikzpicture}
}
%%
% x axis and y axis in first quadrant
% x 0...1, 1 = 100%
% y 0...1, 1 = 100%
% \\tikzAxesQ1{x}{y}{labelX}{labelY}
\\newcommand{\\tikzAxesQi}[4]{
\\draw[axis] (-0.1,0) -- ($(#1+.1,0)$) node(xline)[right]
{$#3$};
\\draw[axis] (0,-0.1) -- ($(0,#2+.1)$) node(yline)[above] {$#4$};
}
%%
% x axis and y axis
% x 0...1, 1 = 100%
% y 0...1, 1 = 100%
% \\tikzAxes{x}{y}{labelX}{labelY}
\\newcommand{\\tikzAxes}[4]{
\\draw[axis] ($(-#1-.2,0)$) -- ($(#1+.2,0)$) node(xline)[below]
{$#3$};
\\draw[axis] ($(0,-#2-.2)$) -- ($(0,#2+.2)$) node(yline)[left] {$#4$};
}
%%
% x axis and y axis
% x 0...1, 1 = 100%
% y 0...1, 1 = 100%
% \\tikzAxes{x}{y}{delta x,y}{labelX}{labelY}
\\newcommand{\\tikzAxesD}[5]{
\\draw[axis] ($(-#1-#3,0)$) -- ($(#1+#3,0)$) node(xline)[below]
{$#4$};
\\draw[axis] ($(0,-#2-#3)$) -- ($(0,#2+#3)$) node(yline)[left] {$#5$};
}
%%
% at given position 'x,y' an x marker with a label 'text' in math mode
% \\tikzMarkerX{x,y}{text}
\\newcommand{\\tikzMarkerX}[2]{
\\draw($(#1)-(0,.025)$) node[below]{$#2$\\vphantom{b}} -- ($(#1)+(0,.025)$);
}
%%
% multiple x markers with labels
% \\tikzMarkersX{coordinate1/text1,coordinate2/text2,...}
\\newcommand{\\tikzMarkersX}[1]{
\\foreach \\pos/\\text in {#1} {
\\tikzMarkerX{\\pos}{\\text}
}
}
%%
% at given position 'x,y' an y marker with a label 'text' in math mode
% \\tikzMarkerY{x,y}{text}
\\newcommand{\\tikzMarkerY}[2]{
\\draw($(#1)-(.025,0)$) node[left]{$#2$\\vphantom{b}} -- ($(#1)+(.025,0)$);
}
%%
% multiple y markers with labels
% \\tikzMarkersY{coordinate1/text1,coordinate2/text2,...}
\\newcommand{\\tikzMarkersY}[1]{
\\foreach \\pos/\\text in {#1} {
\\tikzMarkerX{\\pos}{\\text}
}
}
%%
% point marker at given position
% \\tikzPoint{x,y}
\\newcommand{\\tikzPoint}[1]{
\\fill[red] (#1) circle (.4pt);
}
%%
% point markers at given positions
% \\tikzPoint{coordinate1,coordinate2,...}
\\newcommand{\\tikzPoints}[1]{
\\foreach \\pos in {#1} {
\\tikzPoint{\\pos}
}
}
\\def\\tikzoverlay{%
\\tikz[baseline,overlay]\\node[every overlay node]
}%
% usage:
%\\tikzoverlay[text width=6cm] at (9.3cm,5cm) {... content ...}
%%%
%%% HYPHENATION
%%%
% -----------------------------------------
% Silbentrennung
% -----------------------------------------
\\hyphenation{}
% wird nach \\selectlanguage{ngerman} zurückgesetzt
% \\allowhyphens setzen reicht?
% und \\allowbreak nach einem hyphen?
"
"Preamble options.
Text like <<...>>> will be replaced according to
`my-org-article-latex-template-plist'"
:group 'my-org-export-article)
(defcustom my-org-article-latex-header-extra ""
"Preamble extra options."
:group 'my-org-export-article)
(defcustom my-org-article-latex-hyperref-template
;; DON't let hyperref overload the format of index and glossary.
;; I want to do that on my own in the stylefiles for makeindex...
;; %pdfpagelabels,
;; pdfstartview=FitH, %% fit document to window width, {XYZ null null 1}
;; pdfpagemode=UseNone, %% do not display thumbnails
;; colorlinks=true, %% use true to enable colors below:
;; pdfborder=0 0 0, %% PDF display of links, if colorlinks=false. 0 0 0: nothing. 0 0 1: default.
;; %frenchlinks=false, %% small caps instead of colors
;; plainpages=false, %% false for Roman and Arabian numbers
;; hypertexnames=true, %% true for Roman and Arabian numbers; without hypertexnames it's just counting upwards; bei 4 -> iv
"\
\\makeatletter
\\let\\@old@wrindex=\\@wrindex
\\@ifpackageloaded{hyperref}{
\\hypersetup{%%
pdfauthor={%a},
pdftitle={%t},
pdfkeywords={%k},
pdfsubject={%d},
pdfcreator={%c},
pdflang={%L},
pdfproducer={LaTeX},
pdfstartview=FitH,
pdfpagemode=UseNone,
bookmarksopen=true,
bookmarksnumbered=true,
colorlinks=true,
linkcolor=black,
filecolor=darkblue,
menucolor=darkblue,
urlcolor=darkblue,
citecolor=black,
pdfborder=0 0 0,
plainpages=false,
hypertexnames=true,
}
}{}
\\let\\@wrindex=\\@old@wrindex
\\makeatother
"
"see `org-latex-hyperref-template'"
:group 'my-org-export-article
:type '(choice (const :tag "No template" nil)
(string :tag "Format string")))
(defcustom my-org-article-latex-default-packages-alist
;; additionals in `my-org-article-latex-header' babel, fontspec
'(
;; cell is of the format
;; ("options" "package" SNIPPET-FLAG COMPILERS)
;;; Font
("AUTO" "inputenc" t ("pdflatex"))
("utf8" "luainputenc" t ("lualatex"))
("T1" "fontenc" t ("pdflatex" "lualatex")) ;; font encoding: T1: latin modern, for ö etc. as single glyph
("" "kpfonts" t) ;; for lualatex it also needs fontenc
;;; page spacing
"\\special{papersize=210mm,297mm}"
"\\setlength{\\parskip}{6pt}" ;; half of the font size 12pt
"\\setlength{\\parindent}{0pt}" ;; no paragraph indentation
"\\setlength{\\textheight}{22.5cm}"
"\\setlength{\\marginparwidth}{1.5cm}" ;; space for margin notes"
;;; line spacing !before hyperref!
("" "setspace" nil) ;; !before hyperref! -> env spacing e.g. used for the list of ... sections
"\\onehalfspacing" ;; set line spacing to 1.5
"\\KOMAoptions{DIV=last}\\recalctypearea" ;; after changing font family update DIV settings
;; overful hboxes
"\\clubpenalty=10000"
"\\widowpenalty=10000"
"\\displaywidowpenalty=10000" ;; no single paragraph on a single page (either top or bottom)
"\\emergencystretch=6pt" ;; fix overful hboxes automatically: 10pt if needed, standard 0, better than \tolerance
;; "\\setlength{\\overfullrule}{5pt}" ;; like draft, show a black box at the end of a overfull hbox
;;; Abstract
"\\renewenvironment{abstract}{\\par\\noindent\\sffamily\\textbf{\\Large\\abstractname}\\\\[-1em]\\begin{spacing}{1.0}}{\\end{spacing}\\par\\medskip}"
;;; running title
;; "%\\pagestyle{headings}"
"\\usepackage{fancyhdr}"
"\\pagestyle{fancy}"
"\\fancyhead{}"
"\\fancyfoot{}"
;; "% for twoside option: LE,RO"
"\\fancyhead[RO]{\\slshape \\leftmark}%"
"\\fancyfoot[C]{--~\\thepage~--}"
;; "%\\fancyfoot[RO] {\\thepage}"
"\\renewcommand{\\headrulewidth}{0.4pt}"
"\\renewcommand{\\footrulewidth}{0pt}"
"\\newlength\\FHoffset%"
;; "% Offset des Headers 0: bündig mit text"
"\\setlength\\FHoffset{0cm}"
"\\addtolength\\headwidth{1\\FHoffset}"
"\\fancyheadoffset{\\FHoffset}"
;; "% these lengths will control the headrule trimming to the left and right"
"\\newlength\\FHleft%"
"\\newlength\\FHright%"
;; "% here the trimmings are controlled by the user"
"\\setlength\\FHleft{-1cm}"
"\\setlength\\FHright{-1cm}"
;; "% The new definition of headrule that will take into acount the trimming(s)"
"\\newbox\\FHline%"
"\\setbox\\FHline=\\hbox{\\hsize=\\paperwidth%"
" \\hspace*{\\FHleft}%"
" \\rule{\\dimexpr\\headwidth-\\FHleft-\\FHright\\relax}{\\headrulewidth}\\hspace*{\\FHright}%"
"}"
"\\renewcommand\\headrule{\\vskip-.7\\baselineskip\\copy\\FHline}"
""
;; "% keine Linien auf Bilderseiten!"
"\\renewcommand{\\headrulewidth}{\\iffloatpage{0pt}{0.4pt}}"
;; ""
"\\renewcommand{\\sectionmark}[1]{"
"\\markboth{\\thesection{} #1}{\\thesection{} #1}"
"}"
"\\renewcommand{\\subsectionmark}[1]{"
"\\markright{\\thesubsection{} #1}"
"}"
;; ""
"\\fancypagestyle{plain}{"
"\\fancyhead{}"
"\\fancyfoot{}"
"\\renewcommand{\\headrulewidth}{0.4pt}"
"\\fancyfoot[C]{--~\\thepage~--}"
;; "%\\fancyfoot[RO] {\\thepage}"
"}"
;; ""
;; "% must be set between an header and text, direct before the first paragraph, and must be compiled at least twice"
"\\newcommand{\\sectionheader}{%"
" \\thispagestyle{plain}%"
" \\begin{tikzpicture}[remember picture, overlay]%"
" \\node[shift={(0 cm,-2.8cm)}] at (current page.north west){%"
" \\begin{tikzpicture}[remember picture, overlay]%"
" \\node[shift={(2.8,0)},right] {\\TITLE\\ -- \\SUBTITLE};%"
" \\end{tikzpicture}%"
" };%"
" \\node[shift={(0 cm,-2.8cm)}] at (current page.north east){%"
" \\begin{tikzpicture}[remember picture, overlay]%"
" \\node[shift={(-2.8,0)},left] {\\AUTHOR};%"
" \\end{tikzpicture}%"
" };%"
;; " % Draw a page border"
;; " % \\draw (current page.north west) rectangle (current page.south east);%"
" \\end{tikzpicture}%"
"}"
;;; Lists
;; ("" "enumerate" nil) ;; already loaded?
"\\renewcommand{\\labelitemi}{--}" ;; 1st level dash instead of dot
"\\renewcommand{\\labelitemii}{\\(\\boldsymbol\\cdot\\)}" ;; 2nd level dot instead of dash
("inline" "enumitem" nil) ;; itemize option noitemsep
"\\setlist{nosep}" ;; set noitemsep as default
"\\setlist[1]{labelindent=\\parindent}" ;; start bullets at left margins
"\\setlist[itemize]{parsep=0pt,itemsep=0pt,leftmargin=*}"
"\\setlist[enumerate]{parsep=0pt,itemsep=0pt,leftmargin=*}"
;;; Figures and Tables and Listings
("" "float" nil) ;; adds placement H
;; "\restylefloat{table}" ;; not needed is seems
("\n font=small,\n labelfont={bf,up,sf},\n justification=raggedright,\n singlelinecheck=false,\n"
;; %textfont={it,up}, %format=plain, %indention=0cm,
"caption"
nil)
"\\captionsetup[table]{skip=.5em}"
"\\captionsetup[figure]{skip=10pt}"
"\\counterwithin{figure}{section}" ;; section-wise numbering
;;; - Tables
"\\counterwithin{table}{section}" ;; section-wise numbering
("" "booktabs" nil) ;; \toprule, \midrule, bottomrule
("" "longtable" nil) ;; multi-page tables
;; custom column types https://tex.stackexchange.com/a/12712
;; \let\newline\\ is to allow the use of \newline for manual line breaks within a cell
;; \arraybackslash is needed for the last column so the \\ is again correctly interpreted, otherwise we get: ! Extra alignment tab has been changed to \cr.
;; \hspace{0pt} is to allow the first word to be hyphenated
;; TODO: maybe package ragged2e for a better hyphenation?
("" "array" nil)
"\\newcolumntype{L}[1]{>{\\raggedright\\let\\newline\\\\\\arraybackslash\\hspace{0pt}}p{#1}<{}}" ;; fixed width column type (p) but left-aligned: L{width}
"\\newcolumntype{C}[1]{>{\\centering\\let\\newline\\\\\\arraybackslash\\hspace{0pt}}p{#1}<{}}" ;; fixed width column type (p) but center-aligned: C{width}
"\\newcolumntype{R}[1]{>{\\raggedleft\\let\\newline\\\\\\arraybackslash\\hspace{0pt}}p{#1}<{}}" ;; fixed width column type (p) but right-aligned: R{width}
("autolanguage" "numprint" nil) ;; alignment of numbers using column type n (numbers in math) and N (numbers in text)
;;; - Figures
("" "svg" nil) ;; uses Inkscape
;;; - Tikz
("" "tikz" nil)
("" "gnuplot-lua-tikz" nil)
("" "pgfplots" nil) ;; ,pgfmath ;; for \\begin{axis} !needs by tikz (backgrounds)
"\\usepgflibrary{shapes.geometric}"
"\\usepgfplotslibrary{patchplots}"
"\\usetikzlibrary{"
" arrows," ;; for arrow heads"
" backgrounds," ;; need package pgfplots
" calc," ;; % for manimulation of coordinates
" decorations.pathmorphing,"
" mindmap,"
" pgfplotsclickable," ;; %after pgfplots, for /pgfplots/annot/js fillColor
" positioning,"
;; " %shadings,"
" shadows,"
" shadows.blur,"
" shapes.multipart,"
" tikzmark," ;; \tikzmark{<name>} to define marker in e.g. tables for overlays like \tikz[remember picture] draw[overlay] (0,0) -- (pic cs:<name>);
"}"
;; highligh text
("" "soul" nil) ;; "% based on soul
;; % \\highlight[tikz-opts]{...} like:
;; % \\highlight{text}
;; % \\highlight[red]{text}
;; % \\highlight[green, draw=blue]{text}
"\\makeatletter
\\newcommand{\\defhighlighter}[3][]{%
\\tikzset{every highlighter/.style={color=#2, fill opacity=#3, #1}}%
}
\\defhighlighter{yellow}{.5}
\\newcommand{\\highlight@DoHighlight}{
\\fill [ decoration = {random steps, amplitude=1pt, segment length=15pt}
, outer sep = -15pt, inner sep = 0pt, decorate
, every highlighter, this highlighter ]
($(begin highlight)+(0,8pt)$) rectangle ($(end highlight)+(0,-3pt)$) ;
}
\\newcommand{\\highlight@BeginHighlight}{
\\coordinate (begin highlight) at (0,0) ;
}
\\newcommand{\\highlight@EndHighlight}{
\\coordinate (end highlight) at (0,0) ;
}
\\newdimen\\highlight@previous%
\\newdimen\\highlight@current%
\\DeclareRobustCommand*\\highlight[1][]{%
\\tikzset{this highlighter/.style={#1}}%
\\SOUL@setup%
%
\\def\\SOUL@preamble{%
\\begin{tikzpicture}[overlay, remember picture]
\\highlight@BeginHighlight
\\highlight@EndHighlight
\\end{tikzpicture}%
}%
%
\\def\\SOUL@postamble{%
\\begin{tikzpicture}[overlay, remember picture]
\\highlight@EndHighlight
\\highlight@DoHighlight
\\end{tikzpicture}%
}%
%
\\def\\SOUL@everyhyphen{%
\\discretionary{%
\\SOUL@setkern\\SOUL@hyphkern%
\\SOUL@sethyphenchar%
\\tikz[overlay, remember picture] \\highlight@EndHighlight ;%
}{%
}{%
\\SOUL@setkern\\SOUL@charkern%
}%
}%
%
\\def\\SOUL@everyexhyphen##1{%
\\SOUL@setkern\\SOUL@hyphkern%
\\hbox{##1}%
\\discretionary{%
\\tikz[overlay, remember picture] \\highlight@EndHighlight ;%
}{%
}{%
\\SOUL@setkern\\SOUL@charkern%
}%
}%
%
\\def\\SOUL@everysyllable{%
\\begin{tikzpicture}[overlay, remember picture]
\\path let \\p0 = (begin highlight), \\p1 = (0,0) in \\pgfextra
\\global\\highlight@previous=\\y0
\\global\\highlight@current =\\y1
\\endpgfextra (0,0) ;
\\ifdim\\highlight@current < \\highlight@previous
\\highlight@DoHighlight
\\highlight@BeginHighlight
\\fi
\\end{tikzpicture}%
\\the\\SOUL@syllable%
\\tikz[overlay, remember picture] \\highlight@EndHighlight ;%
}%
\\SOUL@%
}
\\makeatother
"
;;; - Lisitings
("" "listingsutf8" nil)
"\\AtBeginDocument{\\numberwithin{lstlisting}{section}}" ;; section-wise numbering
;; replacement of <<lstlistingname>> in `my-org-article-latex-header'
"\\lstdefinelanguage{conf}{}"
"\\lstdefinelanguage{org}{"
" morekeywords={:results, :session, :var, :noweb, :exports},"
" sensitive=false,"
" morestring=[b]\","
" morecomment=[l]{\\#},"
"}"
"\\lstset{" ;; fallback style
" extendedchars=\\true,"
" inputencoding=utf8/latin1," ;; if package listingsutf8 is used
;; " style=custom,"
;; " language=Matlab,"
" basicstyle=\\small\\ttfamily," ;; small, footnotesize, scriptsize
" keywordstyle=\\color{blue}," ;; \\bfseries
" commentstyle=\\color{dkgreen}," ;; \\itshape
" stringstyle=\\color{mauve},"
" numberstyle=\\tiny\\color{gray}," ;; \\ttfamily
" numbers=left,"
" numbersep=5pt,"
" breaklines=true,"
" breakatwhitespace=true,"
" tabsize=2,"
" xleftmargin=2em," ;; 2\parskip
" captionpos=t,"
" escapeinside={\\%*}{*)},"
" firstnumber=auto," ;; auto: Listings with identical names (case sensitive!) share a line counter / or number
;; " %identifierstyle=\\color{blue},"
;; " %stepnumber=2,
;; " %backgroundcolor=\\color{white},
;; " %frame=single,%trblTRBL,none|leftline|topline|bottomline|lines|single|shadowbox
;; " %frameround=ffff, % tf|rf|rf|rf NE,SE,SW,NW
;; " %rulecolor=\\color{black},
;; " %showspaces=false,
;; " %showstringspaces=false,
;; " %showtabs=false,
;; " %float,
;; " %breakindent=20pt,
;; " %title=\\lstname,
;; " %captionpos=b, % b: bottom
;; " %belowcaptionskip=1\\baselineskip,
;; " %texcl=true, % not with inputencoding utf/latin1 LATEX comment lines, for äöü...
;; " %escapebegin=\\begin{arab},escapeend=\\end{arab},
;; " %morekeywords={*,...},
;; " %deletekeywords={...},
"}"
;;; Glossaries
("\n automake=immediate,\n acronym,\n nonumberlist,\n nogroupskip,\n section=section,\n"
"glossaries" nil)
;; automake, % will run makeindex to create .gls, .acr files,
;; (? automake or automake=true will execute at the end of the document, for lualatex we need it before the command \makeglossaries, for this using automake=immediate (https://tex.stackexchange.com/a/468877))
;; to create .glo and .acn with latexmk see latexmkrc file
;; %nowarn,
;; %nomain,
;; %toc=true, % entry in toc
;; %style=altlist, % altlist: description beginns in new line
;; nonumberlist, % display no page number
;; nogroupskip, % no extra space for change of letter
;; acronym=true, % create a list of ancronyms
;; section=section, % in toc appears on a section level (subsection ...)
;; %description, % n changes the definition of \\newacronym to allow a description
;; %makeindex,
;; %xindy={language=german-duden,codepage=utf8} % mit makeglossaries.exe ?
;; %hyperfirst=false, %
;; % define an entry \\newglossary[⟨log-ext⟩]{⟨name⟩}{⟨in-ext⟩}{⟨out-ext⟩}{⟨title⟩}[⟨counter⟩]
"\\renewcommand*{\\glspostdescription}{}" ;; remove the dot at the end of every entry
"\\makeglossaries%"
;;; Glyphs & More
"\\DeclareUnicodeCharacter{2009}{\\,}" ;; convert unicode to latex command, thin-space
("" "eurosym" t)
"\\DeclareUnicodeCharacter{20AC}{\\euro{}}" ;; convert unicode character to latex command
("os=win" "menukeys" nil) ;; see also defined macro kbd using \keys
;; in math mode
"\\newcommand{\\ti}[1]{_\\mathrm{#1}}" ;; 'tiefstellen' as text with better spacing, Index
"\\newcommand{\\ho}[1]{^\\mathrm{#1}}" ;; 'hochstellen' as text with better spacing
"\\newcommand*{\\rom}[1]{\\mathrm{\\romannumeral #1}}" ;; \rom{2} -> ii
"\\makeatletter\\newcommand*{\\Rom}[1]{\\mathrm{\\expandafter\\@slowromancap\\romannumeral #1@}}\\makeatother" ;; \Rom{2} -> II
;;; - COLORS
("" "xcolor" t)
"\\definecolor{darkblue}{rgb}{0,0.15,0.35}" ;; used in hyperref, url links
"\\definecolor{dkgreen}{rgb}{0,0.6,0}" ;; used in listings
"\\definecolor{mauve}{rgb}{0.58,0,0.82}" ;; used in listings
;;; MATH custom symbols, math, chemistry
;; bold font, e.g. $\\boldsymbol{\\pi}$
;; negativ space: \\!, \\negmedspace, \\negthickspace
;; positive space: \\, \\: \\; ~ or \\quad and \\qquad
;; multiline limits, \\substack{...\\\\...}
;; \\overset{}{} and \\underset{}{} sets formula elements over or under each other
;; \\underbrace{a+b}_\\text{step 1}
;; \\overbrace{e^2 - \\pi}^\\text{step 2}
"\\numberwithin{equation}{section}"
;; manual numbering, z. B. 1.2 a
;; \\begin{equation*} \\tag{} \\end{equation*}
;; \\allowdisplaybreaks % global and local usable, e.g. for underful vboxes
;; ("" "fourier" nil)
("" "mathtools" t) ;; line underneath with text \\underbracket[1pt][0pt]{bla}_\\text{blo}
"\\newcommand\\Dfrac[2]{\\dfrac{\\displaystyle #1}{\\displaystyle #2}}"
"\\newcommand{\\slfrac}[2]{\\left.#1\\middle/#2\\right.}"
("" "xfrac" t) ;; defines \sfrac[<instance>]{<num>}[<sep>]{<denum>}
("" "nicefrac" t)
("" "faktor" t)
;; "% http://tex.stackexchange.com/questions/27591/extending-the-faktor-package/27735#27735"
;; "% \\newfaktor[*]{#2}[#3]{#4}[#5] -> #2/#4"
"\\DeclareDocumentCommand{\\Faktor}{s m O{0.5} m O{-0.5}}{%"
;; " % Store numerator"
" \\setbox0=\\hbox{\\scalebox{0.8}{\\ensuremath{#2\\vphantom{1}}}}%"
;; " % Store slash /"
" \\setbox1=\\hbox{\\ensuremath{\\diagup}}%"
;; " % Store denominator"
" \\setbox2=\\hbox{\\scalebox{0.8}{\\ensuremath{#4}}}%"
;; " % Numerator"
" \\raisebox{#3\\ht1}{\\usebox0}%"
;; " % Slash /"
" \\mkern-5mu\\ifthenelse{\\equal{#1}{\\BooleanTrue}}%"
;; " % regular \\faktor slash"
" {\\diagup}%"
;; " % tilted rule as a slash"
" {\\rotatebox{-44}{\\rule[#5\\ht2]{0.4pt}{-#5\\ht2+#3\\ht0+\\ht0}}}%"
" \\mkern-4mu%"
;; " % Denominator"
" \\raisebox{#5\\ht2}{\\usebox2}%"
"}"
;; units
("thinspace,thinqspace,squaren,Gray" "SIunits" nil) ;; cannot be used together with amssymb
;; thinspace,
;; thinqspace, % use of \, (thin math space) as spacing
;; %mediumqspace, % use of \: (medium math space) as spacing
;; %thickqspace, % use of \; (thick math space) as spacing
;; squaren, % defines a new command \squaren that can be used instead of the SIunits command \square, to prevent errors with the defined \square command of the amssymb package. Or use amssymb to redefine \sqare
;; Gray, % defines a new command \gray that can be used instead of the SIunits command \gray, to prevent errors with the defined \gray command of the amssymb package. Or use pstricks to redefine \gray
;; %textstyle,
;; ("" "siunitx" nil) ;; runs in: ! TeX capacity exceeded, sorry [input stack size=5000].
;;"\\DeclareSIUnit{\\EUR}{\\text{\\euro}}"
("" "dsfont" nil) ;; use \mathds{A} alternative zu mathbb
("" "MnSymbol" nil) ;; incompatible with the amssymb and amsfonts, automatically loads the amsmath and textcomp. used for tensors
;; symbols using dsfont MnSymbol
"\\newcommand{\\field}[1]{\\ensuremath{\\mathds{#1}}}" ;; \field{X} defined with mathds
"\\newcommand{\\fA}{\\field{A}}" ;; \fA Affine field A
"\\newcommand{\\fC}{\\field{C}}" ;; \fC Complex field C
"\\newcommand{\\fFp}{\\ensuremath{\\field{F}_{\\!p}}}" ;; \fFp Finite field F_p
"\\newcommand{\\fFq}{\\ensuremath{\\field{F}_{\\!q}}}" ;; \fFq Finite field F_q
"\\newcommand{\\fGa}{\\ensuremath{\\field{G}_{a}}}" ;; \fGa Group scheme G_a
"\\newcommand{\\fK}{\\field{K}}" ;; \fK Generic field K (Körper)
"\\newcommand{\\fN}{\\field{N}}" ;; \fN Natural numbers N
"\\newcommand{\\fPj}{\\field{P}}" ;; \fPj Projective field P
"\\newcommand{\\fR}{\\field{R}}" ;; \fR Real numbers R
"\\newcommand{\\fQ}{\\field{Q}}" ;; \fQ Rational numbers Q
"\\newcommand{\\fI}{\\field{I}}" ;; \fI Irrational numbers I
"\\newcommand{\\fZ}{\\field{Z}}" ;; \fZ Integers Z
"\\newcommand{\\Def}{\\field{D}}" ;; \Def Domain of a function (Definitionsbereich)
"\\newcommand{\\LM}{\\field{L}}" ;; \LM Solution set (Lösungsmenge)
"\\newcommand{\\fdg}{\\;|\\;}" ;; \fdg 'für die gilt'
"\\newcommand*{\\qed}{\\hfill\\ensuremath{\\blacksquare}}" ;; \qed Q.E.D. quod erat demonstrandum "what was to be shown" -> "which was to be demonstrated"
"\\newcommand*\\euler{\\mathrm{e}}" ;; \euler e
("" "xspace" nil) ;; for \deg
"\\renewcommand{\\deg}{\\ensuremath{^{\\circ}}\\xspace}" ;; for text \deg ° degree
"\\newcommand\\degC{{\\,^{\\circ}\\mathrm{C}}}" ;; \degC °C
"\\newcommand\\sins{{\\mathrm{s}}}" ;; \sins short sin: s
"\\newcommand\\coss{{\\mathrm{c}}}" ;; \coss short cos: c
;; matrix
"\\newcommand{\\T}{{\\mathrm{T}}\\!}" ;; \T Transpose operator
"\\newcommand{\\TF}{{\\raisebox{-0.5ex}{$\\sim$}}}" ;; \TF sign for transfomed values: low tilde
"\\newcommand{\\adj}{{\\mathrm{H}}}" ;; \adj Adjoint operator
"\\newcommand*\\dif{\\mathop{}\\!\\mathrm{d}}" ;; \dif
"\\newcommand*\\E{\\ensuremath{\\mathrm{E}}}" ;; \E
"\\providecommand{\\norm}[1]{\\lVert #1 \\rVert}" ;; \norm{x} ||x||
"\\providecommand{\\abs}[1]{\\lvert #1 \\rvert}" ;; \abs{x} |x|
"\\providecommand{\\innerProd}[2]{\\langle #1, #2\\rangle}" ;; \innerProd{x}{y} <x,y>
;; Operators
"\\DeclareMathOperator{\\Bild}{Bild}" ;; \Bild Map of a function (mapping, transformation)
"\\DeclareMathOperator{\\rank}{rank}" ;; \rank Rank of a matrix
"\\DeclareMathOperator{\\tr}{tr}" ;; \tr Matrix trace
"\\DeclareMathOperator{\\dev}{dev}" ;; \dev Matrix deviation
"\\DeclareMathOperator{\\var}{var}" ;; \var Variance
"\\DeclareMathOperator{\\grad}{grad}" ;; \(\grad u\) = grad u
"\\DeclareMathOperator{\\divergence}{div}" ;; \(\divergence u\) = div u
"\\DeclareMathOperator{\\rot}{rot}" ;; \(\rot u\) = rot u
"\\DeclareMathOperator{\\diag}{diag}" ;; \diag Diagonal matrix
"\\DeclareMathOperator{\\adjugate}{adj}" ;; \adjugate Classical adjoint (adjugate)
;; others
;; % old \newcommand{\corresponds}{\ensuremath{\stackrel{\wedge}{=} \hat{=} \mathop{\hat{=}} \substack{\wedge\\=} \mathrel{\widehat{=}} } \^{=} }
"\\newcommand*\\corresponds{\\mbox{\\kern0em\\raisebox{-.5ex}{\\Large\\^{}}\\kern-.55em\\raisebox{-.1ex}{=}}\\ }"
"\\newcommand*{\\dt}[1]{\\overset{\\mbox{\\large\\bfseries .}}{#1}}"
"\\newcommand*{\\ddt}[1]{\\overset{\\mbox{\\large\\bfseries .\\hspace{-0.1ex}.}}{#1}}"
"\\newcommand*{\\Eval}[3]{{\\left.#1\\phantom{\\Big|}\\!\\!\\right\\rvert_{#2}^{#3}}}"
;; tensors
("" "accents" nil)
("" "ushort" nil)
;; ("" "ulem" nil) ;; % not for math mode, too much space below with uuline; for tensor
;; under-line version
"\\newcommand{\\tensor}[1]{\\ensuremath{{\\boldsymbol{#1}}}}"
"\\newcommand{\\tensorI}[1]{\\ensuremath{\\ushort{{\\boldsymbol{#1}}}}}"
"\\newcommand{\\tensorII}[1]{\\ensuremath{\\ushortd{{\\boldsymbol{#1}}}}}"
"\\newcommand{\\tensorIII}[1]{\\ensuremath{\\underaccent{3}{\\underaccent{\\tilde}{{\\boldsymbol{#1}}}}}}"
"\\newcommand{\\tensorIV}[1]{\\ensuremath{\\underaccent{4}{\\underaccent{\\tilde}{{\\boldsymbol{#1}}}}}}"
;; bm version
;; ("" "bm" nil) ;; % load bm after amsmath and after your font packages!; for tensor
;; "%\\newcommand{\\tensorI}[1]{\\ensuremath{\\uline{\\bm{#1}}}}"
;; "%\\newcommand{\\tensorII}[1]{\\ensuremath{\\uuline{\\bm{#1}}}}"
;; "%\\newcommand{\\tensorIII}[1]{\\ensuremath{\\underaccent{3}{\\underaccent{\\tilde}{\\bm{#1}}}}}"
;; "%\\newcommand{\\tensorIV}[1]{\\ensuremath{\\underaccent{4}{\\underaccent{\\tilde}{\\bm{#1}}}}}"
;; arrow version needs MnSymbol
"\\newcommand{\\tensori}[1]{
\\tikz[baseline, anchor=base,inner sep=0pt]{
\\node{\\ensuremath{\\phantom{#1\\vphantom{\\overrightharpoon{b}}}}};
\\node[overlay]{ \\ensuremath{ \\overrightharpoon{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } };
}
}"
"\\newcommand{\\tensorii}[1]{
\\tikz[baseline, anchor=base,inner sep=0pt]{
\\node{\\ensuremath{\\phantom{#1\\vphantom{\\overrightharpoon{b}}}}};
\\node[overlay]{ \\ensuremath{ \\overrightharpoon{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } };
\\node[overlay]{ \\reflectbox{ \\ensuremath{ \\overrightharpoon{ \\phantom{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } } } };
}
}"
"\\newcommand{\\tensoriii}[1]{
\\tikz[baseline, anchor=base,inner sep=0pt]{
\\node{\\ensuremath{\\phantom{#1\\vphantom{\\overrightharpoon{b}}}}};
\\node[overlay]{ \\ensuremath{ \\overrightarrow{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } };
\\node[overlay]{ \\reflectbox{ \\ensuremath{ \\overrightharpoon{ \\phantom{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } } } };
}
}"
"\\newcommand{\\tensoriv}[1]{
\\tikz[baseline, anchor=base,inner sep=0pt]{
\\node{\\ensuremath{\\phantom{#1\\vphantom{\\overrightharpoon{b}}}}};
\\node[overlay]{ \\ensuremath{ \\overrightarrow{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } };
\\node[overlay]{ \\reflectbox{ \\ensuremath{ \\overrightarrow{ \\phantom{ \\mbox{\\ensuremath{\\boldsymbol{#1}}\\vphantom{b}} } } } } };
}
}"
;;; ToC
;; !do not wrap toc in env spacing (package setspace), this will overwrite defined skips!
;; e.g. in \\RedeclareSectionCommand[tocbeforeskip=2.25em plus 1pt, ...]{section}
;; ("" "tocbasic" nil)
"\\KOMAoptions{sectionentrydots=true}"
"\\DeclareTOCStyleEntry[beforeskip=.5em]{section}{section}" ;; set spacing between section entries inside toc
("" "scrwfile" nil ("pdflatex")) ;; avoid trouble with the limited number of write handles ('No room for new \\write')
;;; - Section ToC (especially for appendix)
"\\makeatletter"
"\\newif\\ifusesectiontoc%" ;; Switch to tell \\addtocentrydefault to not only make entries to the toc-file but also to the current section-toc-file
"\\newcommand*{\\sectiontoc}{%" ;; new command to generate and show a section toc
" \\usesectiontoctrue%" ;; switch on section-toc-entries
" \\edef\\ext@subtoc{toc\\thesection}%" ;; extension of the section-toc-file, e.g., toc1.1
" \\expandafter\\DeclareNewTOC\\expandafter{\\ext@subtoc}%" ;; declare a new toc file
" \\begin{minipage}{.9\\linewidth}"
" \\value{tocdepth}=\\subsectiontocdepth%" ;; we want entries down to subsection
" \\expandafter\\listoftoc\\expandafter*\\expandafter{\\ext@subtoc}%" ;; show the toc without any heading
" \\end{minipage}\\par"
" \\bigskip\\noindent%" ;; add some vertical space after the toc and do not indent the following text
"}"
("" "xpatch" nil)
"\\xapptocmd\\addtocentrydefault{%" ;; patch the KOMA-Script's generic toc entry generator
" \\ifusesectiontoc%" ;; if section toc entries should be generated
" \\expandafter\\tocbasic@addxcontentsline\\expandafter{\\ext@subtoc}{#1}{#2}{#3}%" ;; do it
" \\fi"
"}{}{}"
"\\xpretocmd\\section{\\usesectiontocfalse}{}{}%" ;; automatically switch of section toc entries at start of every \\section
"\\makeatother"
;;; - Appendix (main section unnumbered t and children unnumbered nil)
("" "minitoc" nil) ;; to hide toc elements in maon toc but have them in a section toc and keep them in hyperref
;; ("" "appendix" nil)
;; "\\PassOptionsToPackage{hyphens}{url}" ;; line break of long urls (url package with [hyphens] option, will be loaded by hyperref)
;;; pdf imports !before tocstyle/tocbasic!
("" "pdfpages" nil)
("" "pdflscape" nil)
;;; Other
("" "xurl" nil) ;; line break of long urls
("" "hyperref" nil)
;; ("" "graphicx" t)
;; ("" "grffile" t)
;; ("" "wrapfig" nil)
;; ("" "rotating" nil)
;; ("normalem" "ulem" t)
;; ("" "amsmath" t)
;; ("" "textcomp" t)
;; ("" "amssymb" t)
;; ("" "capt-of" nil)
)
"See `org-latex-default-packages-alist'."
:group 'my-org-export-article
;;:set 'org-set-packages-alist
;;:get 'org-get-packages-alist
:version "26.1"
:package-version '(Org . "8.3")
:type '(repeat
(choice
(list :tag "options/package pair"
(string :tag "options")
(string :tag "package")
(boolean :tag "Snippet")
(choice
(const :tag "For all compilers" nil)
(repeat :tag "Allowed compiler" string)))
(string :tag "A line of LaTeX"))))
(defcustom my-org-article-latex-packages-alist nil
"See `org-latex-packages-alist'."
:group 'my-org-export-article
;;:set 'org-set-packages-alist
;;:get 'org-get-packages-alist
:type '(repeat
(choice
(list :tag "options/package pair"
(string :tag "options")
(string :tag "package")
(boolean :tag "Snippet"))
(string :tag "A line of LaTeX"))))
;;;; Document
(defcustom my-org-article-latex-document-type
"Paper"
"Article opening."
:group 'my-org-export-article)
(defcustom my-org-article-latex-opening
""
"Article opening."
:group 'my-org-export-article)
(defcustom my-org-article-latex-closing
""
"Article closing."
:group 'my-org-export-article)
(defcustom my-org-article-latex-draft
nil
"Article closing."
:group 'my-org-export-article)
;;; Template
(defun my-org-article-latex-template-value (property &optional suffix)
"Return PROPERTY value defined in `my-org-article-latex-template-plist'.
If SUFFIX is a string and not empty (e.g. \"de\") it is concat to
property with - (i.e. \"-de\") and returned if found otherwise
will return the -en version.
Example:
(my-org-article-latex-template-value :documentclass-en)
\"english\"
(my-org-article-latex-template-value :documentclass \"de\")
\"ngerman\""
(if suffix
;; suffix (language) replacements
(let ((value (plist-get
my-org-article-latex-template-plist
(intern (concat (symbol-name property) "-" suffix)))))
(if value
value
(plist-get
my-org-article-latex-template-plist
(intern (concat (symbol-name property) "-en")))))
;; direct preplacements
(plist-get my-org-article-latex-template-plist property)))
;;;###autoload
(defun my-org-article-latex-make-preamble (info &optional template snippet?)
"See `org-latex-make-preamble'.
Uses also `my-org-article-latex-template-value' with
`my-org-article-latex-template-plist' to inserts placeholders."
(let* ((class (plist-get info :latex-class))
(lang (plist-get info :language))
(class-template
(or template
(let* (;; single replace
;; (class-options
;; (string-replace
;; "%<<documentclass>>"
;; (my-org-article-latex-template-value :documentclass lang)
;; (plist-get info :latex-class-options)))
;; multi replace
(class-options
(s-replace-all
(list (cons "%<<documentclass>>"
(my-org-article-latex-template-value :documentclass lang)))
(plist-get info :latex-class-options)))
(header (nth 1 (assoc class (plist-get info :latex-classes)))))
(and (stringp header)
(if (not class-options) header
(replace-regexp-in-string
"^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
class-options header t nil 1))))
(user-error "Unknown LaTeX class `%s'" class))))
(org-latex-guess-polyglossia-language
(org-latex-guess-babel-language
(org-latex-guess-inputenc
(org-element-normalize-string
(org-splice-latex-header
class-template
(org-latex--remove-packages my-org-article-latex-default-packages-alist info)
(org-latex--remove-packages my-org-article-latex-packages-alist info)
snippet?
(mapconcat #'org-element-normalize-string
(list (s-replace-all
(list (if (plist-get info :draft)
(cons "%<<draft>>"
(my-org-article-latex-template-value :draft))
(cons "%<<draft>>" ""))
(cons "%<<babel>>"
(my-org-article-latex-template-value :babel lang))
(cons "%<<fontspec>>"
(my-org-article-latex-template-value :fontspec lang))
(cons "%<<ruby>>"
(my-org-article-latex-template-value :ruby lang))
(cons "%<<biblatex>>"
(my-org-article-latex-template-value :biblatex lang))
(cons "%<<csquotes>>"
(my-org-article-latex-template-value :csquotes lang))
(cons "%<<mtcselectlanguage>>"
(my-org-article-latex-template-value :mtcselectlanguage lang))
(cons "%<<lstlistingname>>"
(my-org-article-latex-template-value :lstlistingname lang)))
(plist-get info :latex-header))
(and (not snippet?)
(plist-get info :latex-header-extra)))
""))))
info)
info)))
(defun my-org-article-latex-template (contents info)
"See `org-latex-template'"
(let ((title (org-export-data (plist-get info :title) info))
(spec (org-latex--format-spec info)))
(concat
;; Time-stamp.
(and (plist-get info :time-stamp-file)
(format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
;; LaTeX compiler.
(org-latex--insert-compiler info)
;; Document class and packages.
(my-org-article-latex-make-preamble info)
;; Possibly limit depth for headline numbering.
(let ((sec-num (plist-get info :section-numbers)))
(when (integerp sec-num)
(format "\\setcounter{secnumdepth}{%d}\n" sec-num)))
;; Author.
(let ((author (and (plist-get info :with-author)
(let ((auth (plist-get info :author)))
(and auth (org-export-data auth info)))))
(email (and (plist-get info :with-email)
(org-export-data (plist-get info :email) info))))
(cond ((and author email (not (string= "" email)))
(format "\\author{%s\\thanks{%s}}\n" author email))
((or author email) (format "\\author{%s}\n" (or author email)))))
;; Date.
(let ((date (and (plist-get info :with-date) (org-export-get-date info))))
(format "\\date{%s}\n" (org-export-data date info)))
;; Title and subtitle.
(let* ((subtitle (plist-get info :subtitle))
(formatted-subtitle
(when subtitle
(format (plist-get info :latex-subtitle-format)
(org-export-data subtitle info))))
(separate (plist-get info :latex-subtitle-separate)))
(concat
(format "\\title{%s%s}\n" title
(if separate "" (or formatted-subtitle "")))
(when (and separate subtitle)
(concat formatted-subtitle "\n"))))
;; Hyperref options.
(let ((template (plist-get info :latex-hyperref-template)))
(and (stringp template)
(format-spec template spec)))
;; custom variables
(let* ((language (plist-get info :language))
(document-type (if (string=
(plist-get info :article-document-type)
my-org-article-latex-document-type)
;; maybe not specified therefore check language
(cond ((string= "de" language) "Arbeit")
;; en version
(t my-org-article-latex-document-type))
(plist-get info :article-document-type)))
(titlename (cond ((string= "de" language)
(concat "Thema der " document-type))
;; en version
(t (concat document-type " title"))))
(keywordname (cond ((string= "de" language) "Stichworte")
;; en version
(t "Keywords")))
(descriptionname
(cond ((string= "de" language) "Kurzzusammenfassung")
;; en version
(t "Description"))))
(concat (format "\\def\\mytitlename{%s}\n" titlename)
(format "\\def\\mykeywordname{%s}\n" keywordname)
(format "\\def\\mydescriptionname{%s}\n" descriptionname)))
;; Document start.
"\\begin{document}\n\n"
;; Title command.
(let* ((title-command (plist-get info :latex-title-command))
(command (and (stringp title-command)
(format-spec title-command spec))))
(org-element-normalize-string
(cond ((not (plist-get info :with-title)) nil)
((string= "" title) nil)
((not (stringp command)) nil)
((string-match "\\(?:[^%]\\|^\\)%s" command)
(format command title))
(t command))))
;; Table of contents.
(let ((depth (plist-get info :with-toc)))
(when depth
(concat (when (integerp depth)
(format "\\setcounter{tocdepth}{%d}\n" depth))
(plist-get info :latex-toc-command))))
;; Document's body.
(concat (plist-get info :article-opening) "\n")
contents
(concat (plist-get info :article-closing) "\n")
;; references
;; Creator.
(and (plist-get info :with-creator)
(concat (plist-get info :creator) "\n"))
;; Document end.
"\\end{document}")))
;;;###autoload
(defun my-org-article-latex-export-to-latex
(&optional async subtreep visible-only body-only ext-plist)
"See `org-latex-export-to-latex'"
(interactive)
(let ((outfile (org-export-output-file-name ".tex" subtreep)))
(org-export-to-file 'article-latex outfile
async subtreep visible-only body-only ext-plist)))
;;;###autoload
(defun my-org-article-latex-export-to-pdf
(&optional async subtreep visible-only body-only ext-plist)
"See `org-latex-export-to-pdf'"
(interactive)
(let ((outfile (org-export-output-file-name ".tex" subtreep)))
(org-export-to-file 'article-latex outfile
async subtreep visible-only body-only ext-plist
(lambda (file) (org-latex-compile file)))))
;; HTML
(org-export-define-derived-backend 'article-html 'tufte-html
:menu-entry
'(?h ?a
((?a "To HTML-article file" my-org-article-html-export-to-html)
(?A "To HTML-article file and open"
(lambda (a s v b)
(if a (my-org-article-html-export-to-html t s v b)
(org-open-file (my-org-article-html-export-to-html nil s v b)))))))
:options-alist
'((:headline-levels nil "H" my-org-article-export-headline-levels)
(:with-sub-superscript nil "^" my-org-article-export-with-sub-superscripts)
(:with-toc nil "toc" my-org-article-export-with-toc)
(:html-doctype "HTML_DOCTYPE" nil my-org-article-html-doctype)
(:html-head "HTML_HEAD" nil my-org-article-html-head newline))
;;:translate-alist
;;'((template . my-org-article-html-template))
)
;;; User Configuration Variables
;;;; Template :: Generic
(defcustom my-org-article-html-doctype "html5"
"See `org-html-doctype'."
:group 'my-org-export-article
:version "24.4"
:package-version '(Org . "8.0")
:type (append
'(choice)
(mapcar (lambda (x) `(const ,(car x))) org-html-doctype-alist)
'((string :tag "Custom doctype" ))))
;;;; Template :: Styles
(defcustom my-org-article-html-head "
<style type=\"text/css\">
/*<![CDATA[*/
/*
/* HTML-STYLE
*/
/* use calc with spaces! */
body { /* default pixel size: 19px */
background: #292b2e;
color: #b2b2b2;
padding-left: 12.5%;
counter-reset: sidenote-counter;
}
h1, h2, h3 {
font-weight: 400;
}
.title {
text-align: left;
}
#content p, #content dl, .org-src-container, div>.MathJax_Display, #postamble {
width: 55%;
}
pre.example {
width: calc(55% - 4.2em);
}
div>.org-ul { /* total width 55% */
padding-left: 2.5%;
width: 52.5%;
}
div>.org-ul ul { /* total width 100% (nasted) */
padding-left: 5%;
width: 95%;
}
div .org-ol { /* all list blocks */
list-style: inside decimal;
text-indent: -1em;
padding-left: 1em;
}
div>.org-ol { /* only 1st list block, total width 55% */
padding-left: 1em;
width: calc(55% - 1em);
}
a:link { /* unvisited link */
color: #2aa1ae;
}
a:visited { /* visited link */
color: #4f97d7;
}
a:hover { /* mouse over link */
color: #ce537a;
}
a:active { /* selected link */
color: #ECEFF1;
}
/* strong {
color: #bc6ec5;
} */
#table-of-contents ul {
list-style: none;
}
#table-of-contents>div>ul {
padding-left: 0;
}
#table-of-contents>div>ul>li>ul {
padding-left: 1em; /* 0.8em #. + 0.4em space */
}
#table-of-contents>div>ul>li>ul>li>ul {
padding-left: 2em; /* 2*0.8em #.#. + 0.4em space */
}
.figure>p, pre.src, .MathJax_Display {
overflow-x: auto;
overflow-y: hidden;
}
pre.src::before {
background-color: #292b2e;
border: 1px solid #b2b2b2;
top: -5px;
}
#postamble {
border-top: 1px solid #b2b2b2;
}
@media (max-width: 760px) {
body {
padding-left: 0;
}
div>.org-ul, div>.org-ul ul {
padding-left: 1em;
width: auto;
}
div>.org-ol {
width: auto;
}
}
@media print {
body {
padding-left: 0;
}
#content p, .org-src-container, pre.example, #postamble {
width: auto;
}
div>.org-ul, div>.org-ul ul {
padding-left: 1em;
width: auto;
}
div>.org-ol {
width: auto;
}
h1, h2, h3, h4, h5 {
page-break-after: avoid;
page-break-inside: avoid;
}
h2 {
page-break-before: always;
}
#table-of-contents>h2, #list-of-tables>h2, #list-of-listings>h2, #list-of-symbols {
page-break-before: auto;
}
h2+div>p, h3+div>p, h4+div>p {
page-break-before: avoid;
}
h2+div>p~p, h3+div>p~p, h4+div>p~p {
page-break-before: auto;
}
a {
page-break-inside: avoid;
}
a[href^=http]:after {
page-break-inside: avoid;
content: \" <\" attr(href) \"> \";
}
}
/*
/* HTML-STYLE-TUFTE
*/
@charset \"UTF-8\";
/* Import ET Book styles
adapted from https://github.com/edwardtufte/et-book/blob/gh-pages/et-book.css */
/*
@font-face { font-family: \"et-book\";
src: url(\"et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot\");
src: url(\"et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot?#iefix\") format(\"embedded-opentype\"), url(\"et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff\") format(\"woff\"), url(\"et-book/et-book-roman-line-figures/et-book-roman-line-figures.ttf\") format(\"truetype\"), url(\"et-book/et-book-roman-line-figures/et-book-roman-line-figures.svg#etbookromanosf\") format(\"svg\");
font-weight: normal;
font-style: normal; }
@font-face { font-family: \"et-book\";
src: url(\"et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot\");
src: url(\"et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot?#iefix\") format(\"embedded-opentype\"), url(\"et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff\") format(\"woff\"), url(\"et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf\") format(\"truetype\"), url(\"et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.svg#etbookromanosf\") format(\"svg\");
font-weight: normal;
font-style: italic; }
@font-face { font-family: \"et-book\";
src: url(\"et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot\");
src: url(\"et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot?#iefix\") format(\"embedded-opentype\"), url(\"et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff\") format(\"woff\"), url(\"et-book/et-book-bold-line-figures/et-book-bold-line-figures.ttf\") format(\"truetype\"), url(\"et-book/et-book-bold-line-figures/et-book-bold-line-figures.svg#etbookromanosf\") format(\"svg\");
font-weight: bold;
font-style: normal; }
@font-face { font-family: \"et-book-roman-old-style\";
src: url(\"et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot\");
src: url(\"et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot?#iefix\") format(\"embedded-opentype\"), url(\"et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff\") format(\"woff\"), url(\"et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf\") format(\"truetype\"), url(\"et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.svg#etbookromanosf\") format(\"svg\");
font-weight: normal;
font-style: normal; }
*/
/* Tufte CSS styles */
html { font-size: 15px; }
body { width: 87.5%;
margin-left: auto;
margin-right: auto;
padding-left: 12.5%;
font-family: et-book, Palatino, \"Palatino Linotype\", \"Palatino LT STD\", \"Book Antiqua\", Georgia, serif;
background-color: #fffff8;
color: #111;
max-width: 1400px;
counter-reset: sidenote-counter; }
h1 { font-weight: 400;
margin-top: 4rem;
margin-bottom: 1.5rem;
font-size: 3.2rem;
line-height: 1; }
h2 { font-style: italic;
font-weight: 400;
margin-top: 2.1rem;
margin-bottom: 1.4rem;
font-size: 2.2rem;
line-height: 1; }
h3 { font-style: italic;
font-weight: 400;
font-size: 1.7rem;
margin-top: 2rem;
margin-bottom: 1.4rem;
line-height: 1; }
hr { display: block;
height: 1px;
width: 55%;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0; }
p.subtitle { font-style: italic;
margin-top: 1rem;
margin-bottom: 1rem;
font-size: 1.8rem;
display: block;
line-height: 1; }
.numeral { font-family: et-book-roman-old-style; }
.danger { color: red; }
article { position: relative;
padding: 5rem 0rem; }
section { padding-top: 1rem;
padding-bottom: 1rem; }
p, ol, ul { font-size: 1.4rem;
line-height: 2rem; }
p { margin-top: 1.4rem;
margin-bottom: 1.4rem;
padding-right: 0;
vertical-align: baseline; }
/* Chapter Epigraphs */
div.epigraph { margin: 5em 0; }
div.epigraph > blockquote { margin-top: 3em;
margin-bottom: 3em; }
div.epigraph > blockquote, div.epigraph > blockquote > p { font-style: italic; }
div.epigraph > blockquote > footer { font-style: normal; }
div.epigraph > blockquote > footer > cite { font-style: italic; }
/* end chapter epigraphs styles */
blockquote { font-size: 1.4rem; }
blockquote p { width: 55%;
margin-right: 40px; }
blockquote footer { width: 55%;
font-size: 1.1rem;
text-align: right; }
section > p, section > footer, section > table { width: 55%; }
/* 50 + 5 == 55, to be the same width as paragraph */
section > ol, section > ul { width: 50%;
-webkit-padding-start: 5%; }
li:not(:first-child) { margin-top: 0.25rem; }
figure { padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
max-width: 55%;
-webkit-margin-start: 0;
-webkit-margin-end: 0;
margin: 0 0 3em 0; }
figcaption { float: right;
clear: right;
margin-top: 0;
margin-bottom: 0;
font-size: 1.1rem;
line-height: 1.6;
vertical-align: baseline;
position: relative;
max-width: 40%; }
figure.fullwidth figcaption { margin-right: 24%; }
/* Links: replicate underline that clears descenders */
a:link, a:visited { color: inherit; }
a:link { text-decoration: none;
background: -webkit-linear-gradient(#fffff8, #fffff8), -webkit-linear-gradient(#fffff8, #fffff8), -webkit-linear-gradient(#333, #333);
background: linear-gradient(#fffff8, #fffff8), linear-gradient(#fffff8, #fffff8), linear-gradient(#333, #333);
-webkit-background-size: 0.05em 1px, 0.05em 1px, 1px 1px;
-moz-background-size: 0.05em 1px, 0.05em 1px, 1px 1px;
background-size: 0.05em 1px, 0.05em 1px, 1px 1px;
background-repeat: no-repeat, no-repeat, repeat-x;
text-shadow: 0.03em 0 #fffff8, -0.03em 0 #fffff8, 0 0.03em #fffff8, 0 -0.03em #fffff8, 0.06em 0 #fffff8, -0.06em 0 #fffff8, 0.09em 0 #fffff8, -0.09em 0 #fffff8, 0.12em 0 #fffff8, -0.12em 0 #fffff8, 0.15em 0 #fffff8, -0.15em 0 #fffff8;
background-position: 0% 93%, 100% 93%, 0% 93%; }
@media screen and (-webkit-min-device-pixel-ratio: 0) { a:link { background-position-y: 87%, 87%, 87%; } }
a:link::selection { text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe, 0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe, -0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe, -0.15em 0 #b4d5fe;
background: #b4d5fe; }
a:link::-moz-selection { text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe, 0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe, -0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe, -0.15em 0 #b4d5fe;
background: #b4d5fe; }
/* Sidenotes, margin notes, figures, captions */
img { max-width: 100%; }
.sidenote, .marginnote { float: right;
clear: right;
margin-right: -60%;
width: 50%;
margin-top: 0;
margin-bottom: 0;
font-size: 1.1rem;
line-height: 1.3;
vertical-align: baseline;
position: relative; }
.sidenote-number { counter-increment: sidenote-counter; }
.sidenote-number:after, .sidenote:before { font-family: et-book-roman-old-style;
position: relative;
vertical-align: baseline; }
.sidenote-number:after { content: counter(sidenote-counter);
font-size: 1rem;
top: -0.5rem;
left: 0.1rem; }
.sidenote:before { content: counter(sidenote-counter) \" \";
font-size: 1rem;
top: -0.5rem; }
blockquote .sidenote, blockquote .marginnote { margin-right: -82%;
min-width: 59%;
text-align: left; }
div.fullwidth, table.fullwidth { width: 100%; }
div.table-wrapper { overflow-x: auto;
font-family: \"Trebuchet MS\", \"Gill Sans\", \"Gill Sans MT\", sans-serif; }
.sans { font-family: \"Gill Sans\", \"Gill Sans MT\", Calibri, sans-serif;
letter-spacing: .03em; }
code { font-family: Consolas, \"Liberation Mono\", Menlo, Courier, monospace;
font-size: 1.0rem;
line-height: 1.42; }
.sans > code { font-size: 1.2rem; }
h1 > code, h2 > code, h3 > code { font-size: 0.80em; }
.marginnote > code, .sidenote > code { font-size: 1rem; }
pre.code { font-size: 0.9rem;
width: 52.5%;
margin-left: 2.5%;
overflow-x: auto; }
pre.code.fullwidth { width: 90%; }
.fullwidth { max-width: 90%;
clear:both; }
span.newthought { font-variant: small-caps;
font-size: 1.2em; }
input.margin-toggle { display: none; }
label.sidenote-number { display: inline; }
label.margin-toggle:not(.sidenote-number) { display: none; }
.iframe-wrapper { position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0; }
.iframe-wrapper iframe { position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%; }
@media (max-width: 760px) { body { width: 84%;
padding-left: 8%;
padding-right: 8%; }
hr, section > p, section > footer, section > table { width: 100%; }
pre.code { width: 97%; }
section > ol { width: 90%; }
section > ul { width: 90%; }
figure { max-width: 90%; }
figcaption, figure.fullwidth figcaption { margin-right: 0%;
max-width: none; }
blockquote { margin-left: 1.5em;
margin-right: 0em; }
blockquote p, blockquote footer { width: 100%; }
label.margin-toggle:not(.sidenote-number) { display: inline; }
.sidenote, .marginnote { display: none; }
.margin-toggle:checked + .sidenote,
.margin-toggle:checked + .marginnote { display: block;
float: left;
left: 1rem;
clear: both;
width: 95%;
margin: 1rem 2.5%;
vertical-align: baseline;
position: relative; }
label { cursor: pointer; }
div.table-wrapper, table { width: 85%; }
img { width: 100%; } }
/*
/* HTML-STYLE-MOD
*/
html {
font-size: 12px;
}
.subtitle {
text-align: left;
}
h4 {
font-style: italic;
font-weight: 400;
font-size: 1.45rem;
margin-top: 2rem;
margin-bottom: 1.4rem;
line-height: 1;
}
h5 {
font-style: italic;
font-weight: 400;
font-size: 1.2rem;
margin-top: 2rem;
margin-bottom: 1.4rem;
line-height: 1;
}
h6 {
font-style: italic;
font-weight: 400;
font-size: 1.1rem;
margin-top: 2rem;
margin-bottom: 1.4rem;
line-height: 1;
}
#content p {
text-align: justify;
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
#content table {
margin-bottom: 1.2rem;
}
#content table, dl, div>.MathJax_Display {
font-size: 1.4rem;
}
#content table colgroup {
border-top-width: 2px;
border-top-style: outset;
border-bottom-width: 2px;
border-bottom-style: inset;
}
#content table colgroup {
border-right-width: 1px;
border-right-style: inset;
}
#content table colgroup:last-of-type {
border-right-width: 0px;
border-right-style: unset;
}
#content thead {
border-bottom-width: 1px;
border-bottom-style: solid;
}
#content tbody:not(:last-child) {
border-bottom-width: 1px;
border-bottom-style: solid;
}
#content td {
padding-top: 0.1rem;
padding-bottom: 0.1rem;
}
#content td, #content th {
padding-right: 0.5rem;
}
#content td:last-child, #content th:last-child {
padding-right: 0;
}
#content table th {
vertical-align: text-bottom;
}
#content ul, #content ol {
line-height: 1.8rem;
}
#content li p {
width: unset;
}
caption.t-above, .figure p:nth-child(2), .org-src-name {
font-size: 1.1rem;
}
.table-number, .figure-number, .listing-number {
font-weight: bold;
}
#table-of-contents ul, #list-of-tables ul, #list-of-listings ul {
line-height: normal;
}
#content figure {
display: inline-table;
vertical-align: top;
max-width: unset;
margin: 0 0 2rem 0;
}
#content figcaption {
float: unset;
clear: unset;
max-width: unset;
display: table-caption;
caption-side: bottom;
}
.org-svg {
width: auto;
}
#text-list-of-tables .table-number {
display: none;
}
#text-list-of-tables ul {
list-style: decimal;
padding-left: 2rem;
}
#text-list-of-listings .listing-number {
display: none;
}
#text-list-of-listings ul {
list-style: decimal;
padding-left: 2rem;
}
#text-list-of-symbols table colgroup {
border: none;
}
.org-src-container {
margin: 1.2rem;
}
.org-src-container {
width: calc(55% - 2.4rem);
}
pre.src {
margin: 0;
}
div.epigraph {
margin: unset;
}
div.epigraph>blockquote {
margin-top: 1em;
margin-bottom: 1em;
}
.todo, .done {
font-size: 80%;
font-style: normal;
}
.tag {
float: right;
background-color: unset;
font-size: .7em;
font-style: normal;
line-height: 1;
}
.tag span {
background-color: #333;
border: 1px solid #bbb;
border-radius: 3px;
background-clip: padding-box;
padding: .2em;
margin-right: .5em;
}
#postamble p {
line-height: 1;
}
#bibliography {
margin-bottom: 1.4rem;
width: 55%;
}
/*
.org-ref-reference {
vertical-align: super;
font-size: .83em;
}
*/
.org-ref-reference::before {
content: \"[\";
}
.org-ref-reference::after {
content: \"]\";
}
@media (max-width: 760px) {
body {
padding-left: 0;
padding-right: 0;
width: 94%;
}
#content p, .org-src-container, pre.example, pre.code, #postamble {
width: auto;
}
#content table {
display: block;
overflow-x: auto;
}
.figure {
padding-left: 0;
padding-right: 0;
}
#content figure {
display: inline-block;
overflow-x: auto;
}
#content figcaption {
display: unset;
}
div.table-wrapper, table, #content dl {
width: auto;
}
div>.MathJax_Display {
width: auto;
}
#bibliography {
width: auto;
}
}
/* colors */
html {
background-color: #293b3e;
background-image: linear-gradient(to right, #292b2e, #293b3e);
background-repeat: repeat-y;
}
body {
/* background-color: #293b3e; */
/* background-image: linear-gradient(to right, #292b2e, #293b3e); */
/* background-repeat: no-repeat; */
background-color: transparent;
color: #b2b2b2;
}
.outline-2 a, #bibliography a, #table-of-contents a, #list-of-tables a, #list-of-listings a {
color: #5799b9;
}
a:link {
background: -webkit-linear-gradient(#292b2e, #292b2e), -webkit-linear-gradient(#292b2e, #292b2e), -webkit-linear-gradient(#333, #333);
background: linear-gradient(#292b2e, #292b2e), linear-gradient(#292b2e, #292b2e), linear-gradient(#333, #333);
/* delete the other to background entries? */
background: transparent;
text-shadow: 0.03em 0 #292b2e, -0.03em 0 #292b2e, 0 0.03em #292b2e, 0 -0.03em #292b2e, 0.06em 0 #292b2e, -0.06em 0 #292b2e, 0.09em 0 #292b2e, -0.09em 0 #292b2e, 0.12em 0 #292b2e, -0.12em 0 #292b2e, 0.15em 0 #292b2e, -0.15em 0 #292b2e;
}
a:link::selection, a:link::-moz-selection {
text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe, 0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe, -0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe, -0.15em 0 #b4d5fe;
background: #b4d5fe;
}
/*]]>*/
</style>
"
"See `org-html-head'."
:group 'my-org-export-article
:version "24.4"
:package-version '(Org . "8.0")
:type 'string)
;;;###autoload
(put 'org-html-head 'safe-local-variable 'stringp)
;;; Export functions
;;;###autoload
(defun my-org-article-html-export-to-html (&optional async subtreep visible-only body-only ext-plist)
"See `org-tufte-export-to-file' and `org-html-export-to-html'."
(interactive)
(let* ((extension (concat
(when (> (length org-html-extension) 0) ".")
(or (plist-get ext-plist :html-extension)
org-html-extension
"html")))
(file (org-export-output-file-name extension subtreep))
;; need to bind this because tufte treats footnotes specially, so we
;; don't want to display them at the bottom
(org-html-footnotes-section (if org-tufte-include-footnotes-at-bottom
org-html-footnotes-section
"<!-- %s --><!-- %s -->")))
(org-export-to-file 'article-html file async subtreep
visible-only body-only ext-plist)))
(provide 'my-org-article)
;;; my-org-article.el ends here