lamme2024-scientific-project/setup.org

2.6 KiB

Standalone Emacs Config file for my report

I can set a variable at startup!

Let's say I want this emacs-lisp code to be run at startup when I open my org file (say, for config purpose)

(setq lamme2024 "org powered")
org powered

To do so, add the following somewhere in your report.org file:

#+name: startup
#+begin_src emacs-lisp
(org-babel-load-file "./setup.org")

#+end_src

And add the following at the end of your report.org file:

#  Local Variables:
#  eval: (progn (org-babel-goto-named-src-block "startup") (org-babel-execute-src-block) (outline-hide-sublevels 1))
#  End:

The next time you will open your file, you will be asked twice if org-babel should run the startup cell.

See: https://emacs.stackexchange.com/a/41456/41374

Configure LaTeX template

(add-to-list 'org-latex-classes
          '("lamme2024"
             "\\documentclass{scrreprt}
             [NO-DEFAULT-PACKAGES]
             [EXTRA]
                \\makeindex
                \\makeglossaries          "
             ;("\\part{%s}" . "\\part*{%s}")
             ("\\chapter{%s}" . "\\chapter*{%s}")
             ("\\section{%s}" . "\\section*{%s}")
             ("\\subsection{%s}" . "\\subsection*{%s}")
             ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
             ("\\paragraph{%s}" . "\\paragraph*{%s}")
             ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
lamme2024 \documentclass{scrreprt}

Add latex: link for custom latex macro text wrapping

 (org-add-link-type
  "latex" nil
  (lambda (path desc format)
   (cond
    ((eq format 'html)
     (format "<span class=\"%s\">%s</span>" path desc))
    ((eq format 'latex)
     (format "\\%s{%s}" path desc)))))
Created latex link.
(org-add-link-type
  "latex" nil
  (lambda (path desc format)
   (cond
    ((eq format 'html)
     (format "<span class=\"%s\">%s</span>" path desc))
    ((eq format 'latex)
     (format "\\%s{%s}" path desc)))))
Created latex link.

Extend org reference system

(require 'org-ref)
(require 'org-ref-refproc)
(add-hook 'org-export-before-parsing-hook #'org-ref-acronyms-before-parsing)
(add-hook 'org-export-before-parsing-hook #'org-ref-glossary-before-parsing)
org-ref-glossary-before-parsing org-ref-acronyms-before-parsing org-attach-expand-links