org-roam / org-roam-bibtex

Org Roam integration with bibliography management software
GNU General Public License v3.0
571 stars 47 forks source link

cite note links forced to lowercase #69

Closed notuntoward closed 4 years ago

notuntoward commented 4 years ago

When I make a new paper citation note, org-roam (or org-roam-bibtex?) names the file after the bibtex citekey -- this is almost exactly what I want, except that the filename is all lower case.

For example, org-roam has made a note file named

hobbs19ramprsrvprobsolar.org

when the citekey was

Hobbs19rampRsrvProbSolar

This makes the filename hard to read when viewed in a dired buffer, and in other places. Can the citation case be preserved?

This is with org-roam-version 1.1.1 (updated today) and GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29.

Here are the note file contents:

#+TITLE: Hobbs19rampRsrvProbSolar: Coordinated Ramping Product and Regulation Reserve Procurements in CAISO and MISO using Multi-Scale Probabilistic Solar Power Forecasts (Pro2R)
#+ROAM_KEY: cite:Hobbs19rampRsrvProbSolar

- tags ::
- keywords :: 
* org-roam metadata
:PROPERTIES:
:NOTER_DOCUMENT: c:/Users/scott/papers/Hobbs19rampRsrvProbSolar.pdf
:NOTER_PAGE: 1
:END:
*** a note
    :PROPERTIES:
    :NOTER_PAGE: 1
    :NOTER_DOCUMENT: c:/Users/scott/papers/Hobbs19rampRsrvProbSolar.pdf
    :NOTER_AUTO_SAVE_LAST_LOCATION: nil
    :END:

* Notes
jethrokuan commented 4 years ago

This seems like something to bring up with org-roam-bibtex. @zaeph

zaeph commented 4 years ago

I thought we'd implemented a passthrough for the capitalisation of BibTeX keys, so that's weird. I'll look it up later today.

zaeph commented 4 years ago

The capitalisation is preserved on my end.

Can you make sure that you're running the latest version of ORB?

myshevchuk commented 4 years ago

@notuntoward Unfortunately, no one will be able to help you here with the information you provided or rather did not provide. I'm, however, quite positive it has something to do with your org-roam-capture-templates or orb-templates. It would be nice if you could share with us the values of those variables, and also other relevant variables set in you configuration file, those starting with org-roam- and orb- prefixes.

I personally use a lot of upper and mixed case and haven't had any problems ever.

Screenshot 2020-06-09 at 12 03 07
notuntoward commented 4 years ago

Thanks for the extremely fast responses, everybody. I just updated org-roam* to the latest on melpa, and now org-roam no longer starts on this machine. When I restarted emacs, I get this error message:

Error (use-package): org-roam/:config: Query timeout error: "Query timed out", 30

I deleted my .emacs.d and re-downloaded all melpa packages, to the same result. So, I went to a different machine with an identical .emacs, but that has not had its packages updated. org-roam still runs there, and here are those templates values:

org-roam-capture-templates:

(("d" "default" plain #'org-roam-capture--get-point "%?" :file-name "%<%Y%m%d%H%M%S>-${slug}" :head "#+TITLE: ${title}
" :unnarrowed t))

orb-preformat-keywords

(("citekey" . "=key=")
 "title" "url" "file" "author-or-editor" "keywords")

orb-templates:

(("r" "ref" plain #'org-roam-capture--get-point "" :file-name "${slug}" :head "#+TITLE: ${citekey}: ${title}\n#+ROAM_KEY: ${ref}\n\n- tags ::\n- keywords :: ${keywords}\n\n* Notes\n:PROPERTIES:\n:NOTER_DOCUMENT: %(orb-process-file-field \"${citekey}\")\n:NOTER_PAGE:\n:END:\n\n"))

And here is all of my org-roam config:

;; org-roam

(use-package emacsql-sqlite3)

(use-package org-roam
  :custom
  (org-roam-directory org_roam_dir)
  (org-roam-list-files-commands '(rg))
  :config (org-roam-mode)
  :bind (:map org-roam-mode-map
              (("C-c n l" . org-roam)
               ("C-c n f" . org-roam-find-file)
               ("C-c n j" . org-roam-jump-to-index)
               ("C-c n b" . org-roam-switch-to-buffer)
               ("C-c n g" . org-roam-graph))
              :map org-mode-map
              (("C-c n i" . org-roam-insert))))

;; helm-bibtex, used by org-roam

(use-package helm-bibtex)

(setq bibtex-completion-bibliography bibfile_list)
(setq bibtex-completion-library-path bibpdf_list)
(setq bibtex-completion-pdf-field "file")

(setq bibtex-completion-notes-path (expand-file-name "bib-notes" org_roam_dir))

;; org-roam-bibtex, used by org-roam

(use-package org-roam-bibtex
  :after org-roam
  :hook (org-roam-mode . org-roam-bibtex-mode)
  :bind (:map org-mode-map
              (("C-c n a" . orb-note-actions))))

(setq orb-preformat-keywords
   '(("citekey" . "=key=") "title" "url" "file" "author-or-editor" "keywords"))

(setq orb-templates
      '(("r" "ref" plain (function org-roam-capture--get-point)
         ""
         :file-name "${slug}"
         :head "#+TITLE: ${citekey}: ${title}\n#+ROAM_KEY: ${ref}

- tags ::
- keywords :: ${keywords}

* Notes
:PROPERTIES:
:NOTER_DOCUMENT: %(orb-process-file-field \"${citekey}\")
:NOTER_PAGE:
:END:

")))
zaeph commented 4 years ago

Have you installed emacsql-sqlite3? We've recently switched for compatibility with Windows.

myshevchuk commented 4 years ago

@notuntoward In your orb-templates change :file-name "${slug}" to :file-name "${citekey}". Sorry, it's our fault, that piece of documentation is outdated.

zaeph commented 4 years ago

Would you mind fixing it? Knee-deep in another PR right now.

myshevchuk commented 4 years ago

I deleted my .emacs.d and re-downloaded all melpa packages, to the same result. So, I went to a different machine with an identical .emacs, but that has not had its packages updated. org-roam still runs there, and here are those templates values:

That's absolutely irrelevant here. Please ask help on org-roam or, best of all, at https://org-roam.discourse.group

notuntoward commented 4 years ago

It's not irrelevant. Somebody asked if I'd updated to the most recent org-roam; I had to explain why I couldn't.

Thanks, though, for resolving this so quickly. I'm really impressed by the org-roam developers.

notuntoward commented 4 years ago

@zaeph yes, I did have emacsql-sqlite3 installed. Will have to look into the startup problem some more.

zaeph commented 4 years ago

It's not irrelevant. Somebody asked if I'd updated to the most recent org-roam; I had to explain why I couldn't.

I believe that @myshevchuk merely used 'irrelevant' to qualify your attempts to resolve the issues, meaning that you weren't going in the right direction, based on the error message you provided. But thanks for investigating!

Thanks, though, for resolving this so quickly. I'm really impressed by the org-roam developers.

Any time. :)

myshevchuk commented 4 years ago

@notuntoward Please excuse me, I am sometimes inappropriately straightforward, call me rude. I am glad that your issue is solved.

notuntoward commented 4 years ago

No problems! Thanks for your work.