Skip to content

Instantly share code, notes, and snippets.

@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'."
View org-roam-configuration.el
;; See
;; http://takeonrules.com/2021/08/22/ever-further-refinements-of-org-roam-usage/
;; for details on this configuration.
;;
;; See https://takeonrules.com/2021/08/23/diving-into-the-implementation-of-subject-menus-for-org-roam/
;; for a walk through of the implementation.
;;
;; A Property List of my `org-roam' capture templates.
(setq jnf/org-roam-capture-templates-plist
(list
@bdarcus
bdarcus / bibliography.el
Last active Aug 13, 2021
setup for bibtex-actions and org-cite
View bibliography.el
(use-package bibtex-actions
:after (bibtex-completion)
:config
(setq bibtex-completion-bibliography '("~/references.bib")))
(use-package oc
:load-path "~/org-mode/lisp"
:after (org bibtex-completion)
:config
(setq org-cite-global-bibliography
@bdarcus
bdarcus / oc-csl.el
Created Jul 27, 2021 — forked from andras-simonyi/oc-csl.el
A patched version of oc-csl which supports a larger set of citation modes and variants plus adds biblatex support
View oc-csl.el
;;; oc-csl.el --- csl citation processor for Org -*- lexical-binding: t; -*-
;; Copyright (C) 2021 Free Software Foundation, Inc.
;; Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
@bdarcus
bdarcus / styles.el
Last active Jul 23, 2021
flatten org-cite-supported-styles
View styles.el
;; https://github.com/jkitchin/org-ref/issues/885#issuecomment-885682807
;; doesn't currently handle the nil style correctly
(defun oc-bibtex-actions--simple-styles (&optional targets)
(let ((styles (org-cite-supported-styles targets)))
(cl-loop for group in styles append
(let ((main (pop group)))
(when (string= "nil" (car main)) (setf (car main) ""))
(append (list (car main))
(cl-loop for rest in group collect
;; needs to remove "/nil"
View pretty-hyperref.md

Turn all links "MidnightBlue":

% https://tex.stackexchange.com/questions/100905/best-practice-for-hyperref-link-colours
\usepackage[dvipsnames]{xcolor}
\newcommand\myshade{85}

\hypersetup{
 colorlinks = true,
 allcolors = MidnightBlue!\myshade!black,
@bdarcus
bdarcus / crm.el
Created Jun 30, 2021
vertico crm experiments
View crm.el
; some experimental code from minad, to improve CRM experience
(defun vertico--crm-indicator (args)
"Add prompt indicator, modify ARGS passed to `completing-read-multiple'."
(cons (concat "[CRM] " (car args)) (cdr args)))
(defun vertico--crm-separator (&rest _)
"Add separator between selected items, when inserting."
(when (eq minibuffer-completion-table #'crm--collection-fn)
;; You may want to use something else than ", ".
(insert ", ")))
@bdarcus
bdarcus / cite-init.el
Last active Oct 3, 2021
org-cite testing init, instructions
View cite-init.el
;; to test org-cite-new branch:
;;
;; 1. run 'make' from the org-mode repo wip-cite-new branch root
;;
;; 2. run ...
;;
;; ... this for basic citation testing:
;;
;; emacs -Q -l cite-init.el
;;
View org-cite-examples.org

This provides a mapping from possible org-cite style names to different export formats.

For citeproc-org, the asterisk represents a suggested supported style.

org-cite styleorg-cite shortcutnatbibbiblatexciteproc-org
default (no style)\citep\autocitedefault
textt\citet\textcite*
authora\citeauthor\citeauthor*