diff options
Diffstat (limited to 'dot_emacs')
-rw-r--r-- | dot_emacs | 178 |
1 files changed, 103 insertions, 75 deletions
@@ -20,6 +20,7 @@ (put 'narrow-to-region 'disabled nil) :hook ; add functions onto hook; only basename needed ((text-mode . turn-on-auto-fill) + (text-mode . flyspell-mode) (before-save . whitespace-cleanup)) :bind ; key bindings (("C-x a r" . align-regexp)) @@ -31,8 +32,14 @@ align-regexp (around align-regexp-with-spaces activate) (let ((indent-tabs-mode nil)) ad-do-it)) + :custom + (face-font-family-alternatives + (append '(("Spleen 16x32" "Ubuntu Mono" "FreeMono" "Liberation Mono")) + face-font-family-alternatives)) :custom-face - (default ((t (:family "Inconsolata"))))) + (default ((t (:family "Spleen 16x32" + :height 130 ; unit is 1/10 pt + ))))) (if (string= (system-name) "demeter.rak.ac") (use-package leuven-theme ; nice theme for lecturing / projectors @@ -252,6 +259,12 @@ Extended Format date in the date field and return it as a string obeing (add-to-list 'company-backends 'company-math-symbols-unicode) (add-to-list 'company-backends 'company-latex-commands)) +(use-package company-org-block + :ensure t + :hook ((org-mode . (lambda () + (setq-local company-backends '(company-org-block)) + (company-mode +1))))) + (use-package cus-edit :custom (custom-file null-device "Don't store customizations")) @@ -471,6 +484,10 @@ Otherwise split the current paragraph into one sentence per line." :mode ("\\.m\'" . octave-mode)) (use-package org + :bind (:map org-mode-map + ("<tab>" . org-cycle)) + :hook + (org-mode . visual-line-mode) :custom (org-link-file-path-type 'relative)) @@ -536,81 +553,10 @@ Returns a formatted BibTeX entry." (use-package org-ref-bibtex :ensure org-ref - :config - (defun my/org-ref-format-url-if-doi () - "Override built-in function. Originally, this reformatted -the url to point to DOI. I would rather kill the URL field -entirely if it contains the DOI. bibtex-clean-entry will then -delete the field." - (interactive) - (save-excursion - (bibtex-beginning-of-entry) - (let ((doi (bibtex-autokey-get-field "doi"))) - (unless (string-empty-p doi) - (when (string-match-p (regexp-quote (org-ref-bibtex-entry-doi)) - (bibtex-autokey-get-field "url")) - (bibtex-set-field "url" "")))))) - (defun my/org-ref-biblatex-journaltitle () - "Rename journal to journaltitle" - (interactive) - (save-excursion - (bibtex-beginning-of-entry) - (let ((journal (bibtex-autokey-get-field "journal")) - (journaltitle (bibtex-autokey-get-field "journaltitle"))) - (when (and (string-empty-p journaltitle) - (not (string-empty-p journal))) - (bibtex-beginning-of-entry) - (bibtex-set-field "journal" "") - (bibtex-set-field "journaltitle" journal))))) - (defun my/biblatex-date () - "Convert 'year' + 'month' fields to 'date' field" - (interactive) - (save-excursion - (bibtex-beginning-of-entry) - (let* ((year (bibtex-autokey-get-field "year")) - (month (downcase (bibtex-autokey-get-field "month"))) - (nummonth (cond ((string= month "jan") "01") - ((string= month "feb") "02") - ((string= month "mar") "03") - ((string= month "apr") "04") - ((string= month "may") "05") - ((string= month "jun") "06") - ((string= month "jul") "07") - ((string= month "aug") "08") - ((string= month "sep") "09") - ((string= month "oct") "10") - ((string= month "nov") "11") - ((string= month "dec") "12") - (t ""))) - (olddate (bibtex-autokey-get-field "date")) - (newdate (cond ((string-empty-p year) nil) - ((string-empty-p nummonth) year) - (t (concat year "-" nummonth))))) - (when (and (string-empty-p olddate) - (not (string-empty-p newdate))) - (bibtex-beginning-of-entry) - (bibtex-set-field "date" newdate) - (bibtex-set-field "year" "") - (bibtex-set-field "month" ""))))) - (defun my/orcb-check-journal () - "Check entry at point to see if journal exists in `org-ref-bibtex-journal-abbreviations'. -If not, issue a warning." - (interactive) - (when - (string= "article" - (downcase - (cdr (assoc "=type=" (bibtex-parse-entry))))) - (save-excursion - (bibtex-beginning-of-entry) - (let* ((entry (bibtex-parse-entry t)) - (journal (replace-regexp-in-string "[[:space:]\n]+" " " (reftex-get-bib-field "journaltitle" entry)))) - (when (null journal) - (error "Unable to get journal for this entry.")) - (unless (member journal (-flatten org-ref-bibtex-journal-abbreviations)) - (message "Journal \"%s\" not found in org-ref-bibtex-journal-abbreviations." journal)))))) :custom (org-ref-title-case-types '(("article" "title") ("book" "booktitle" "title") + ("collection" "booktitle" "title") ("incollection" "booktitle" "title") ("inproceedings" "booktitle" "title") ("misc" "title") @@ -632,13 +578,14 @@ If not, issue a warning." ("MSCS" "Mathematical Structures in Computer Science" "Math. Struct. Comp. Sci.") ("Nordic Journal of Philosophical Logic") ("PACMPL" "Proceedings of the ACM on Programming Languages" "Proc. ACM Program. Lang.") + ("Philosophy Compass") ("Piping Today") ("Proceedings of the Aristotelian Society") ("Publications of the Research Institute for Mathematical Sciences" "Publ. RIMS") ("Reason Papers") ("Reprints in Theory and Applications of Categories") ("Rice University Studies") - ("Rice University Studies")) + ("Rice University Studies") ("SICOMP" "SIAM Journal on Computing") ("Science") ("TAC" "Theory and Applications of Categories") @@ -649,10 +596,15 @@ If not, issue a warning." ("The Voice") ("Topoi") ("Transactions of the American Mathematical Society") - ("{ACM} {SIGACT} News" "ACM SIGACT News"))) + ("{ACM} {SIGACT} News" "ACM SIGACT News")))) + +(use-package reftex-cite + :ensure t) (use-package org-ref-core :ensure org-ref + :after org-ref-bibtex + :after reftex-cite :after helm-bibtex :bind (:map bibtex-mode-map ("C-c C-c" . org-ref-clean-bibtex-entry) @@ -690,6 +642,77 @@ If not, issue a warning." ("′" . "'") ; PRIME ("”" . "''")) org-ref-nonascii-latex-replacements)) + (defun my/org-ref-format-url-if-doi () + "Override built-in function. Originally, this reformatted +the url to point to DOI. I would rather kill the URL field +entirely if it contains the DOI. bibtex-clean-entry will then +delete the field." + (interactive) + (save-excursion + (bibtex-beginning-of-entry) + (let ((doi (bibtex-autokey-get-field "doi"))) + (unless (string-empty-p doi) + (when (string-match-p (regexp-quote (org-ref-bibtex-entry-doi)) + (bibtex-autokey-get-field "url")) + (bibtex-set-field "url" "")))))) + (defun my/org-ref-biblatex-journaltitle () + "Rename journal to journaltitle" + (interactive) + (save-excursion + (bibtex-beginning-of-entry) + (let ((journal (bibtex-autokey-get-field "journal")) + (journaltitle (bibtex-autokey-get-field "journaltitle"))) + (when (and (string-empty-p journaltitle) + (not (string-empty-p journal))) + (bibtex-beginning-of-entry) + (bibtex-set-field "journal" "") + (bibtex-set-field "journaltitle" journal))))) + (defun my/biblatex-date () + "Convert 'year' + 'month' fields to 'date' field" + (interactive) + (save-excursion + (bibtex-beginning-of-entry) + (let* ((year (bibtex-autokey-get-field "year")) + (month (downcase (bibtex-autokey-get-field "month"))) + (nummonth (cond ((string= month "jan") "01") + ((string= month "feb") "02") + ((string= month "mar") "03") + ((string= month "apr") "04") + ((string= month "may") "05") + ((string= month "jun") "06") + ((string= month "jul") "07") + ((string= month "aug") "08") + ((string= month "sep") "09") + ((string= month "oct") "10") + ((string= month "nov") "11") + ((string= month "dec") "12") + (t ""))) + (olddate (bibtex-autokey-get-field "date")) + (newdate (cond ((string-empty-p year) nil) + ((string-empty-p nummonth) year) + (t (concat year "-" nummonth))))) + (when (and (string-empty-p olddate) + (not (string-empty-p newdate))) + (bibtex-beginning-of-entry) + (bibtex-set-field "date" newdate) + (bibtex-set-field "year" "") + (bibtex-set-field "month" ""))))) + (defun my/orcb-check-journal () + "Check entry at point to see if journal exists in `org-ref-bibtex-journal-abbreviations'. +If not, issue a warning." + (interactive) + (when + (string= "article" + (downcase + (cdr (assoc "=type=" (bibtex-parse-entry))))) + (save-excursion + (bibtex-beginning-of-entry) + (let* ((entry (bibtex-parse-entry t)) + (journal (replace-regexp-in-string "[[:space:]\n]+" " " (reftex-get-bib-field "journaltitle" entry)))) + (when (null journal) + (error "Unable to get journal for this entry.")) + (unless (member journal (-flatten org-ref-bibtex-journal-abbreviations)) + (message "Journal \"%s\" not found in org-ref-bibtex-journal-abbreviations." journal)))))) :custom (org-ref-default-bibliography '("~/Documents/papers/library.bib")) (org-ref-bibliography-notes "~/Documents/papers/notes.org") @@ -726,6 +749,11 @@ If not, issue a warning." (use-package org-ref-pdf :ensure org-ref) +(use-package ox-md + ;; org-mode to markdown exporter + :ensure org + :after (org)) + (use-package outline :ensure t :hook (LaTeX-mode . outline-minor-mode)) |