Skip to content

Instantly share code, notes, and snippets.

View latex-cmd-oc-style.el
(require 'oc-biblatex)
(defcustom style-select-latex-commands t
"Whether to use latex commands for style selection."
:group 'style
:type '(boolean))
(defun style-latex-alist (&optional swap)
"Return org-cite-biblatex-styles as alist.
By default, each car is the latex command, and the cdr the
@bdarcus
bdarcus / latex-style.el
Last active Apr 20, 2022
experiment with an org-cite style select UI that optionally presents biblatex commands for completion instead
View latex-style.el
;; (org-cite-parse-objects "[cite:@doe]")
(require 'oc-biblatex)
(defcustom style-ui 'csl
"Style select UI; each with a preview."
:type '(choice (const :tag "CSL output" 'csl)
(const :tag "biblatex commands" 'biblatex)
(const :tag "natbib commands" 'natbib)))
View citar-one-file-for-notes.el
(require 'citar)
(defvar bibtex-note-org-property "Key"
"The org-mode property which BibTeX keys are attached to")
(defun get-first-citar-notes-path ()
"Return 'citar-notes-paths' if it is a string, or its car
if it is a list (as 'citar' normally expects)"
(cond ((stringp citar-notes-paths) citar-notes-paths)
((listp citar-notes-paths) (car citar-notes-paths))
@bdarcus
bdarcus / csl-recipe.yaml
Last active Dec 6, 2021
possible csl recipe format more distributed style development?
View csl-recipe.yaml
title: The ABC Journal Style
fields: [foo, bar]
repo: foo/style
url: htps://xyz.org/jabc.csl
@bdarcus
bdarcus / citar-hydra.el
Last active Jul 13, 2022
how to create a hydra for use with citar, and org-cite "follow processor" that uses it
View citar-hydra.el
(require 'org-element)
(require 'pretty-hydra)
(require 'oc)
(require 'citar)
(require 'citar-org)
(declare-function 'org-cite-register-processor "ext:oc")
;; define some interactive functions for the hydra
@bdarcus
bdarcus / academic.el
Created Nov 29, 2021 — forked from rka97/academic.el
Configuration I use in Doom Emacs as part of my academic reading/notetaking workflow
View academic.el
;; The following packages are needed:
;; 1. elfeed and elfeed-score (available from the rss doom module)
;; 2. citar
;; 3. org-ref
;; 4. org-roam and org-roam-bibtex
(defconst robo/bib-libraries (list "~/bib-lib/robo-lib.bib" "~/bib-lib/robo-temp-lib.bib")) ; All of my bib databases.
(defconst robo/main-bib-library (nth 0 robo/bib-libraries)) ; The main db is always the first
(defconst robo/main-pdfs-library-paths `("~/bib-lib/pdfs/" "/home/robo/bib-lib/temp-pdfs/")) ; PDFs directories in a list
View citar-hydra.el
;;; citar-hydra.el --- Description -*- lexical-binding: t; -*-
;;
;;; Code:
(require 'org-element)
(require 'hydra)
(require 'transient)
(require 'citar)
(require 'citar-org)
(defun citar-hydra-key-finder ()
@bdarcus
bdarcus / ..git-pr.md
Created Oct 26, 2021 — forked from gnarf/..git-pr.md
git pr - Global .gitconfig aliases for Pull Request Managment
View ..git-pr.md

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@bdarcus
bdarcus / csl-validate.sh
Created Oct 19, 2021
a simple wrapper script to validate CSL files using the very fast RNV XML parser
View csl-validate.sh
#!/usr/bin/env bash
# a simple wrapper script to validate CSL files using the very fast RNV XML parser
SCHEMA="~/Code/csl/schema/schemas/styles/csl.rnc"
STYLE=$1
rnv $SCHEMA $STYLE
@bdarcus
bdarcus / org-airmail.el
Last active Sep 2, 2021 — forked from ephsmith/org-airmail.el
org-airmail.el adds an org-hyperlink handler for Airmail email URLs
View org-airmail.el
;;; org-airmail.el - Support for links to Airmail 3 messages in Org
(require 'org)
(org-link-set-parameters "airmail" :follow 'org-airmail-open)
(defun org-airmail-open (url)
"Visit the Airmail message referenced by URL.
URL should be a vaid Airmail message url retrieved from Airmail with
'Copy Message Link'."