reddit / emacs

Raw text bibliography in emacs

blind_envy · 2022-08-17 07:51
Hi, I want to do some scientific writing for fun, for which I want to be able to insert citations and bibliographies directly in org-mode. I don't want to use latex and/or render org files in any other format; what I want to achieve is something like: * Some text [1] [1] - Full reference from a global bib file where both the numbering and bibliography section are updated on a command/keystroke. I use citar to insert references into org files - that works great - but I have no idea how to generate bibliography and numbering. So far most of the advice I found online was related to rendering bibliography in latex / html, which is not what I need. I would be really grateful for some pointers. Thanks!
orgtre · 2022-08-17 11:01
[org-cite-csl-activate](https://github.com/andras-simonyi/org-cite-csl-activate) can be used to preview the citations inserted by org-cite/citar directly in org. It does only create previews of the citations themselves and not the bibliography. However, if you hover with the mouse over a citation if will show "a ‘mini bibliography’ of the items referred to" as a tooltip. To make it work and show numbers like you want to, you need to set the citation style to a numbered style (I'll use [ieee.csl](https://www.zotero.org/styles?q=ieee) as an example) either by`(setq org-cite-csl--fallback-style-file "path-to/ieee.csl")`, or by `(setq org-cite-csl-activate-use-document-style t)` and then adding `#+cite_export: csl path-to/ieee.csl` at the top of your org file. Since org-cite-csl-activate already implements most of what is required, it might not be unreasonable to open an issue requesting the feature to also preview `#+print_bibliography:`, or, even better, you could look at its source code and implement it yourself, then send a pull request. One would have to modify `org-cite-csl-activate--help-echo-fun` to instead loop over all citations, do its rendering for each, concatenate, and then `(put-text-property` over `#+print_bibliography:`.
bdarcus · 2022-08-17 11:45
Do note that activate processor previews the bibliography entries in a pop-up when one hovers over the citation reference. I think that's preferable to actually adding the bibliography, since really the only reason for these previews is to make sure you've selected the correct reference.
orgtre · 2022-08-17 12:18
I think I agree, mostly, but I suspect that many people (me included) actually spend almost all their time in org and don't just use it as a convenient format for producing html/pdf's. Hence, it would be desirable to have things looking nice in org too. Citar is fantastic btw!
attento_redaz · 2022-08-17 15:18
It wouldn't necessarily be difficult to implement but I don't really see the appeal within the context of a UI (as opposed to an exported, in theory printable, document). Especially in the case of a longer Org document with a considerable number of citations this would result in a lot of difficult to decipher entry numbers in the text and a long bibliography at the end. Why not provide entry information locally, say on hover or in the echo area? And if the information is available locally why is it useful to have a bibliography? Maybe I'm too much influenced by `org-cite-csl-activate`...
blind_envy · 2022-08-18 06:46
Thanks a lot - that really does look quite promising!