diff --git a/config.org b/config.org index 74e4685..7392a7c 100644 --- a/config.org +++ b/config.org @@ -491,13 +491,32 @@ Export non-breaking spaces properly; from, believe it or not, [[https://orgmode. (when (org-export-derived-backend-p backend 'html) (replace-regexp-in-string " " " " text))) (add-to-list 'org-export-filter-plain-text-functions - 'my-html-filter-nobreaks)) + 'my-html-filter-nobreaks) + (defun my-latex-filter-nobreaks (text backend info) + (when (org-export-derived-backend-p backend 'latex) + (replace-regexp-in-string " " "~" text))) + (add-to-list 'org-export-filter-plain-text-functions + 'my-latex-filter-nobreaks)) #+END_SRC -Track when I complete todos. +Add the =memoir= class for LaTeX export. #+BEGIN_SRC emacs-lisp -(setq org-log-done 'time) + (unless (version< emacs-version "27") + (add-to-list 'org-latex-classes + '("memoir" + "\\documentclass{memoir} + [NO-DEFAULT-PACKAGES]" + ("\\chapter{%s}" . "\\chapter*{%s}") + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) +#+END_SRC + + Track when I complete todos. + + #+BEGIN_SRC emacs-lisp + (setq org-log-done 'time) #+END_SRC *** Packages diff --git a/custom/asal-clean.el b/custom/asal-clean.el new file mode 100644 index 0000000..bb38d80 --- /dev/null +++ b/custom/asal-clean.el @@ -0,0 +1,38 @@ +(defun asal-clean () + (interactive) + (goto-char (region-beginning)) + (while (re-search-forward "
\n
" nil t) + (replace-match "\n")) + (goto-char (region-beginning)) + (while (re-search-forward "
\n\n

" nil t) + (replace-match "\n

\n

")) + (goto-char (region-beginning)) + (while (re-search-forward "

" nil t) + (replace-match "")) + (goto-char (region-beginning)) + (while (re-search-forward "
" nil t) + (replace-match "")) + (goto-char (region-beginning)) + (while (re-search-forward "

Validate

" nil t) + (replace-match "")) + (goto-char (region-beginning)) + (while (re-search-forward "
" nil t) + (replace-match "")) + (goto-char (region-beginning)) + (while (re-search-forward "\\\\noindent\\\\rule{\\\\textwidth}{0.5pt}" nil t) + (replace-match "\\sephim" nil t)) + (goto-char (region-beginning)) + (while (re-search-forward "\\\\maketitle" nil t) + (replace-match "\\begin{titlingpage}\n\\titleGM\n\\end{titlingpage}" nil t))) + +(defun asal-note () + (interactive) + (setq footnotemark (read-string "Unique name: ")) + (setq footnotecontent (read-string "Content of note: ")) + (insert (concat "@@html:" footnotecontent "@@@@latex:\\footnote{" footnotecontent "}@@"))) diff --git a/custom/org-format.el b/custom/org-format.el index 0238648..c50c0c8 100644 --- a/custom/org-format.el +++ b/custom/org-format.el @@ -8,7 +8,7 @@ (replace-match " –")) (goto-char (region-beginning)) (while (re-search-forward "/ –" nil t) - (replace-match "/ –")) ;; italics won’t work otherwise + (replace-match " –/")) (goto-char (region-beginning)) (while (re-search-forward " \\.\\.\\." nil t) (replace-match " …"))