tmalsburg / helm-bibtex

Search and manage bibliographies in Emacs
GNU General Public License v2.0
465 stars 74 forks source link

Syntax of JabRef comment field is markdown format #380

Closed hwiorn closed 3 years ago

hwiorn commented 3 years ago

JabRef comment field is Markdown format default. It supports limited LaTeX, but its formatter seems not working well like Zotero. So I'm trying to convert this comment field to org-mode using helm-bibtex and pandoc.

@Book{sonkeZetelkasten,
  author   = {Sönke Ahrens},
  title    = {How to Take Smart Notes: One Simple Technique to Boost Writing, Learning and Thinking – for Students, Academics and Nonfiction Book Writers},
  isbn     = {978-1542866507},
  comment = {# Annotation
## Test1
Hello world

this is test
## Test 2
Test strings
strings text

Ha
### test 2-1
## Test 3},
}

But helm-bibtex can't handle multi-line syntax. All spaces of comment field have gone after bibtex-completion-get-entry called.

(bibtex-completion-get-value  "comment" (bibtex-completion-get-entry "syonkeJetelkaseuten") "")

"# Annotation ## Test1 Hello world this is test ## Test 2 Test strings strings text Ha ### test 2-1 ## Test 3"

Is there an option to handle value without s-collapse-whitepase?

tmalsburg commented 3 years ago

bibtex-completion-get-value prepares the strings for visual presentation in the UI. If you'd just like to write a script for converting your entries, you may be better off using the package for BibTeX parsing directly. Parsebib gives you the raw BibTeX entries without any preprocessing. Alternattively you can just get the entries via bibtex-completion-candidates and then you can access fields directly via assoc-string.

hwiorn commented 3 years ago

Thank you for your reply.

I'll check both Parsebib and bibtex-completion-candidates with assoc-string.