Skip to content

Instantly share code, notes, and snippets.

@port19x
Last active February 10, 2024 09:48
Show Gist options
  • Save port19x/5031936b132f479fdb6eb313da0d18c2 to your computer and use it in GitHub Desktop.
Save port19x/5031936b132f479fdb6eb313da0d18c2 to your computer and use it in GitHub Desktop.
Bibtex & Org Templates

I'm kinda annoyed with the emacs tempo library I currently use and don't want a separate config file that would be necessary to use emacs tempel. So I'm just publishing my templates here for copy pasta / macro bootstrapping for the next paper.

Online Reference

@online{,
  author = "",
  title = "",
  url = "",
  date = "",
}

Book Reference

@book{,
  author = "",
  title = "",
  year = "",
  publisher = "",
}

Figure

#+CAPTION: 
[[./assets/]]

Scaled Figure

#+CAPTION: 
#+ATTR_LATEX: :height 0.1\textwidth
[[./assets/]]

Pagebreak

#+LATEX:\newpage

Previous Solution - Emacs Tempo

(use-package tempo
  :config
  (tempo-define-template "today"  '((insert (format-time-string "%Y-%m-%d"))) "today")
  (tempo-define-template "online" '("@online{" p "," n "  author = \"" p "\"," n "  title = \"" p "\"," n "  url = \"" p "\"," n "  date = \"" p "\"," n "}") "online")
  (tempo-define-template "book"   '("@book{" p "," n "  author = \"" p "\"," n "  title = \"" p "\"," n "  year = \"" p "\"," n "  publisher = \"" p "\"," n "}") "book")
  (tempo-define-template "fig"    '("#+CAPTION: " p n "[[./assets/" p "]]" n) "fig")
  (tempo-define-template "sfig"   '("#+CAPTION: " p n "#+ATTR_LATEX: :height 0.1\\textwidth" n "[[./assets/" p "]]" n) "sfig")
  (tempo-define-template "np"     '("#+LATEX:\\newpage" n) "np"))```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment