Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mxpiotrowski's full-sized avatar

Michael Piotrowski mxpiotrowski

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mxpiotrowski on github.
  • I am mxpi (https://keybase.io/mxpi) on keybase.
  • I have a public key ASBRU27S0HyRzjOcDq9pIAbF6BaPbh0slm0Zv7qLR7f8ewo

To claim this, I am signing this object:

\documentclass[a4paper]{article}
\usepackage[ngerman, american]{babel}
\usepackage[autostyle=true, german=swiss]{csquotes}
\usepackage[backend=biber, style=authoryear, isbn=false, autolang=hyphen]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{Piotrowski2012a,
author = {Piotrowski, Michael},
title = {Natural Language Processing for Historical Texts},
;;; Markdown
(defun my-markdown-mode-hook ()
(visual-line-mode)
(setq markdown-use-pandoc-style-yaml-metadata t)
(define-key markdown-mode-map [(control c) (?\[)] 'helm-bibtex)
(define-key markdown-mode-map [(control c) (control v)] 'mxp-find-corresponding-pdf)
(when (package-installed-p 'bury-successful-compilation)
(bury-successful-compilation))
@mxpiotrowski
mxpiotrowski / mxp-copy-as-rich-text.el
Created June 2, 2021 20:30
Convert region to RTF (using pandoc) and copy to macOS clipboard.
(defun mxp-copy-as-rich-text (start end)
"Convert region to RTF (using pandoc) and copy to macOS clipboard.
Input format is “org” or “markdown” depending on the buffer's major mode."
(interactive "r")
(let ((coding-system-for-read 'utf-8)
(coding-system-for-write 'utf-8)
(src (cond ((eq major-mode 'org-mode) "org")
(t "markdown"))))
(shell-command-on-region start end
-- Time-stamp: <2024-04-20T21:07:41+0200 mpiotrow>
--[[ When converting from biblatex to bibtex, Pandoc only considers
URL fields: DOIs get lost in the conversion (see
<https://github.com/jgm/pandoc/blob/main/src/Text/Pandoc/Citeproc/BibTeX.hs>).
This filter copies the values of DOI fields to URL fields, so that
they are output to bibtex. ]]
function Pandoc(d)