Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Emacs' org-mode gets citation support (tecosaur.com)
234 points by NeutralForest on Aug 5, 2021 | hide | past | favorite | 64 comments


The stuff you can do with emacs, which is around 50 years old now, is still phenomenal, and it's still under active development to provide all manners of features that make emacs an immensely powerful and expressive lisp machine.

The only reason I haven't got into org-mode is because of the context switch and the fact that I'll spend more time figuring how to organise my thoughts.

But emacs is still my daily driver for everything I work with but typescript, so far. It's the most seductive technology I've ever had the pleasure of working with.


I’ve recently switched to org-mode, and the nice thing is you really don’t have to dive into the deep end. The full scope is enormous, but all you really need to use is basic markup, at least for typically notetaking. You can add more features over time if/when you need them.


All I really used with basic org-mode was the labelling stuff. I could press a key and cycle between todo/done/whatever.

Really worked well with my list of lists mentality :) that was mostly thanks to org-agenda.

To tell a lie: I also used org-mode to write my emacs config, through literate programming. I don't have it any more, but it's a common thing to try. org-babel will compile your literate codes in sequence, throughout a document.

Thing that turned me off was that I work in WSL2 on Windows and my emacs setup there is for programming, and I didn't want to get into that context for this other stuff. Which means, making a second emacs config. Maybe I'll do it sometime, but right now I'm just figuring out what I'm asking for.


If the problem is multiple Emacs configs, I had the same issue and have been very happy with chemacs2: https://github.com/plexus/chemacs2. Only caveat is it does not play nicely with the various pre-built Emacs configs, so if you're using those you'll likely struggle.


I use tide-mode for TS. It's great together with LSP!


Why not Typescript? I use it for that every day.


Because I don't want to deal with tide-mode, rjsx-mode, web-mode, ts2-mode, lsp, etc. etc. just to read a typescript file.

I'll make it work, eventually, but I'm not too invested in it. I want to be helpful to my team too, and I can't do that if I ignore their setups. That's why I've got VS Code open at the same time.


FWIW, Jupyter-book handles Citations and bibliographies with sphinxcontrib-bibtex: https://jupyterbook.org/content/citations.html

Some notes about Zotero and Schema.org RDFa for publishing [CSL with citeproc] citations: references of Linked Data resources in a graph, with URIs all: https://wrdrd.github.io/docs/tools/index#zotero-and-schema-o...

Compared to trying to parse beautifully typeset bibliographies in PDFs built from LaTeX with a Computer Modern font, search engines can more easily index e.g. https://schema.org/ScholarlyArticle linked data as RDFa, Microdata, or JSON-LD.

Scholarly search engines: Google Scholar, Semantic Scholar, Meta.org,


I keep everything in my life in plaintext, so I've been looking longingly at Org for several years now. There are three things standing in my way, from least to most important:

* I sometimes view on or want to share documents over sites like Github/Gitlab. If I share Markdown or even usually AsciiDoc, then the document is formatted appropriately even for people who are used to Word and rendered HTML. EDIT: Apparently this has changed since I last looked. Good news!

* I often edit from mobile devices, which almost certainly have no support for Org features. EDIT: There are apparently good org-specific editors.

* My desktop editor of choice is not and likely never will be emacs, so even with plugins that support Org it's always a hampered experience relative to what the format claims to offer.

It looks like it does everything I want and more, with all the little helpers you need overtop a plaintext format that's decent enough to read on its own. But I'm not changing my text editor just to use a single different format.

So instead I opt for the worst of all worlds and just use Markdown for everything because it's supported everywhere. It gets me headers, lists, code blocks, and sometimes checkboxes, and the rest I can handle ad-hoc.

EDIT: 5 responses in ~10 minutes, but 0 or neutral upvotes. I knew mentioning an editor preference was a mistake. Yes I have tried emacs for an extended period, yes I respect it, no I am not likely to use it myself.


Yeesh. Please don’t complain about your poorly-researched laundry list of preferences not being upvoted. Come on, nobody cares what editor you yourself do or don’t use.


I was commenting on the snap responses, my goal was just to avoid an editor war.

I brought up post score relative to comment rate only because in my experience high engagement with no votes generally means I probably just started an argument.


* GitHub does render .org files just like Markdown!

* I've heard people of people being really happy with Orgzly on Android. I personally run Emacs on my Android phone through Termux. It works really well for me. Other solutions include using a SSH client to connect to a server running Emacs, or simply using GitHub directly on mobile web or their app if your notes are on GitHub.

* I've made the switch from Vim to Emacs (+ evil-mode) because of org-mode and have been extremely happy with it. It truly changed my life.


I've built an org mode editor that connects to git repo and works form the browser, it looks like this: https://demo.filestash.app/login?next=/view/org/emacs.org#ty...

Pages can be exported in a wiki that is rendered dynamically by emacs like this: https://demo.filestash.app/api/export/hn/text/html/emacs.org or if you prefer pdf: https://demo.filestash.app/api/export/hn/application/pdf/ema...

The code is on github: https://github.com/mickael-kerjean/filestash


This looks awesome! It mentions “full text search” but I wasn’t able to get it to work in the demo. Does it support searching though all your org files?


FTS is only available when you host your own as it relies on crawl + index and such operation can be expensive when used against a storage backend like S3 where API calls and bandwidth aren't free. On the demo server, the search is stateless and does recursive call with a timeout


sadly GitHub's version of org-mode parser haven't been updated for a while, there is a fair amount of very annoying issues :( https://github.com/novoid/github-orgmode-tests


> I personally run Emacs on my Android phone through Termux. It works really well for me.

Do you use a bluetooth keyboard? I can't imagine using Vim (my primary driver) over a phone.


It's unlikely I would ever move away from (Neo)Vim as my 'main' (i.e., programming) editor, as I find it much more intuitive and comfortable.

Instead, I think of Emacs + org-mode as a single, separate entity solely for to-do tracking and plain text hierarchical note taking. I find that the conveniences of org-mode for these specific tasks outweighs the otherwise unintuitive (from the perspective of my muscle memory) interface.


The good thing about NeoVim getting a real language for its plugins now is that it can start diving into and making uber complex and and uber awesome plugins like org-mode [0]

Another good thing is now that org-mode is likely to have a popular and maybe hopefully almost complete second implementation, it'll probably get a proper spec.

[0] https://github.com/kristijanhusak/orgmode.nvim


I do the same thing. I use Emacs solely for org-mode (that includes org-roam and org-journal)


Aside from editing on mobile devices, I think Emacs isn't as hard to pick up as it once was. It's certainly not easy but tools like Spacemacs or Doom make it much simpler to get started and really limit the need to create and edit a complicated little library of your Elisp code.

http://spacemacs.org

https://github.com/hlissner/doom-emacs


I'm not sure such Emacs "distributions" really convince people that don't like it on a fundamental level. I've tried it a few times, but it always feels like it gets in my way because a large part of its assumptions and settings go against my expectations. And changing that seems like a multi-year project because the whole program is just so huge and complex and still growing.

If Emacs was faster and much smaller I'd probably love it. But in its current state all I can do is slap more plugins and modes on it until it almost grinds to a halt.


The native compilation feature that is now in the development branch makes this experience much better.


That is a good point, it's still Emacs after all.

These distributions do provide the ability to add the features you might need (Org-Mode, python or ruby support, etc.) without having to download a bunch of files of Elisp and code up a configuration file from scratch. Many require some binaries to be installed (like ruby or python) but a lot of people will have them installed already.


At a fundamental level, emacs is difficult because the crowd says it is difficult.

Oddly, I am not even claiming it isn't true. But it is the same fear that folks have in avoiding computers entirely. Not wrong, but fairly easy to overcome.


I don't feel like it was hard to pick up* so much as it was just not the right tool for me.

*Relative to my expectations when trying a new editor for a short period


So I discovered recently that if you set up git-auto-commit mode with an org directory tree, then configure it to auto-push to gitlab on add/change, I get nicely formatted documents for free.

Later on I can convert them via pandoc to docx or markdown so they can end up in sharepoint/confluence and I only minimally have to touch either of those horror shows.

I was writing some docs yesterday, and my colleague who's always bagging me about my use of nothing but emacs and terminals complimented how nice it looked rendered in gitlab.


Could you share specifics on how to set this up?

I’m interested in having a “local” personal knowledge base (currently using Obsidian—>Hugo site —> GitHub —>AWS Amplify / Netlify)

Your setup sounds extremely useful. I haven’t tried Emacs / org-mode / org-roam, but the more I read about it, the more curious I am getting. If you have advice, I’d love to hear it.


I had to look it up but this lives in `.dir_locals.el` in the root of the git repo. Including the comments of what to put in .emacs I think that's everything needed:

    (
     ( nil .
           ((eval git-auto-commit-mode 1))
           )
     )

    ;; and chuck this in your .emacs
    ; (setq-default gac-ask-for-summary-p t)
    ; (setq-default gac-automatically-push-p t)


Mobile: “Organice” is by far my favorite org mode editor on a mobile device. And it’s not even a native app, it’s a PWA. https://github.com/200ok-ch/organice

Like others have mentioned, you don’t have to switch to Emacs. 99% of what I do in Emacs is in org mode. You don’t have to stick to one editor. I use NeoVim when in a shell, Jetbrains when I’m at work, VS Code when trying out other languages…


Awesome - I gotta check out that tool. 1E3 than for the info!


Not really for OP, but I've found a couple of really great iOS apps that work well with Emacs org-mode, Beorg[1] and FlatHabits[2]. They're actually both good apps in their own right, that use org-mode files as a backend for their features.

[1]: https://beorgapp.com/ [2]: https://flathabits.com/


Thanks, this is incredibly helpful!

I was looking into org-mode a few years ago but ditched it because the only iOS app I could find at that time couldn't really sync with other devices without a lot of effort, and automatic, reliable synchronization is a deal breaker for me. beorg OTOH seems to be designed with syncing in mind.


Nice to see Flat Habits mentioned.

I’m working on another org-based iOS app for quickly adding/searching tasks https://twitter.com/xenodium/status/1423397014646177792?s=21


It sounds like you are looking for an excuse to give org-mode a chance.

Github will render org-mode documents now, so there's that.

Don't be afraid to give emacs a test drive, it's very possible to avoid getting sucked into the ecosystem and configuration if you aren't interested.

Either you'll decide it's what you've been looking for, or you prefer your current approach. Win-Win.


> Github will render org-mode documents now, so there's that.

Is that actually working now, or just mostly kind of working? Last time I tried (maybe one year ago), I had so many issues that I just gave up and reverted to markdown.


If you had to suggest a “get started on Emacs org-mode” guide to a newbie, which would your recommend? Might kick the tires this weekend…


For the syntax, I'd recommend https://orgmode.org/quickstart.html :)


I’ve been a plain-text fiend for about the past 3 years: there is no other experience which can come near org-mode in emacs. Absolutely none. Markdown feels like a toy compared to org.


> I sometimes view on or want to share documents over sites like Github/Gitlab.

If nobody else edits the documents you could first export them to Markdown or HTML. Pandoc handles that reasonably well.

> My desktop editor of choice is not and likely never will be emacs

That only matters if you want to use the more interactive features of Emacs' org-mode. I only use Vim and still write everything in .org files. I just like how it's got a simple syntax and also enough flexibility to handle everything. I set up a keybinding that lets me convert the file to a PDF by calling Emacs in batch mode (unfortunately there's no other correct and complete parser).

In the end Markdown isn't bad, but I don't like how basically every platform and tool adds their own special flavor.


> That only matters if you want to use the more interactive features of Emacs' org-mode. I only use Vim and still write everything in .org files.

I did something similar for awhile but felt like I was net negative in effort to gains.

> In the end Markdown isn't bad, but I don't like how basically every platform and tool adds their own special flavor.

Yeah I stick to a known safe subset, including legacy newline behavior, and only a few extensions to that. (highlight and checkbox off the top of my head)


I think you'll always get a subpar experience if you try to use the org format without Emacs. I would not recommend org if Emacs is a deal breaker.


I'd love to see Org to be picked up as a universal format. The overlap with LaTeX is probably too big though.


But can you get the full org experience without emacs? I love the principles of org mode, but it seems to be too dependent on a particular editor. For it to be universal it should be 100% un-tied to emacs. As in, the most popular org mode tutorial should not mention emacs at all. So far this does not yet seem feasible.

EDIT: to clarify, there's nothing wrong with emacs. But if Org mode is tied to it, you cannot help interpreting promotion of Org as promotion of emacs. Which is alright, but it feels a bit sneaky. Just be upfront about it: promote emacs (plus some packages).


There's a strong effort to implement Org for Neovim (https://github.com/kristijanhusak/orgmode.nvim) and I'm thinking of trying to make an Org LSP server in the future.


GitHub does render Org-mode documents to an extent. I haven't done a comparison with its Markdown rendering though.

There do exist mobile apps for Org-mode, but it's been a while since I've used them.

I agree with your third point and wish that Org-mode support was better in non-Emacs editors.


> My desktop editor of choice is not and likely never will be emacs

That is a shame. Why?


I hesitate to answer because I sense an editor war incoming, but I'm going to assume your question was in earnest and not evangelical or judgemental.

Also to be clear, because I know people can be touchy about editor preferences: I say this only as an analogy for the feeling I get, not as an analogy for users who use emacs or other tools.

For whatever reason emacs just feels like I'm using left-handed scissors, and I'm not left handed.

It doesn't mean I don't think people should use emacs, it just doesn't feel right in my hands.


Nothing wrong with using emacs for just org-mode if you want to use more of the interactive features. You give up something vs someone who’s “all in” on emacs, but it’s workable.

I’m teaching my son to code and we use emacs only for magit. He may get more and more exposure down the road, but for now that’s enough to justify what little bare minimum learning curve is needed to get a great git porcelain.


> It doesn't mean I don't think people should use emacs, it just doesn't feel right in my hands.

There is absolutely nothing wrong with your opinion. Do you like to tinker with things in general? That is a common personality trait that I have seen amongst many of fellow Emacs users. I enjoy tinkering with all kinds of things, so Emacs fits my personality well.

Though, sometimes it's easy to get distracted tinkering instead of actually doing productive work (for me, at least). I still say that my Emacs config has been my single longest running "project."


No OP but I personally prefer the simplicity of VS Code's diff and conflict resolution point-and-click tooling to using ediff/smerge. I also work in a project with some very deep directory structures and like the VS Code sidebar much more.


I want to use org at work but the performace of emacs on windows is beyond unusable. also copy paste just doesn't work without pulling teath. its such a dissapointment.


I have been using emacs on windows for years. The only thing that is unusably slow for me is magit.

>also copy paste just doesn't work without pulling teath.

What do you mean?


I remember reading posts on the emacs-orgmode mailing list back in 2014 about what citations should look like, and what backend should be used. At the time I was picking software to organize notes for my PhD thesis. There was some discussion of adding link handlers and packing citation metadata into regular links, like [[cite:key][citation metadata which would normally be display text]]. That sort of worked, although citations with multiple citation keys didn't fit easily into that approach. The final outcome looks great: (1) terse syntax that's easy to type and read but very flexible, (2) clear delimiters, and (3) option to use CSL styles, which are numerous and very easy to modify.


Org-mode is amazing and has a lovely community. But I'm really not sure it's a good idea to use it for authoring LaTeX documents because that makes it impossible to work with others: however amazing org is, the fact is that it's Emacs and therefore only a small number of people use it. But if these citations are for personal blog posts etc I guess that's great, although personally I think I'd want to use the same tools for all my writing.


I found Orgmode was amazing for writing LaTeX documents - but I wasn't working with other people.

For a few classes I took recently, I used R-markdown. For one class's group paper we all collaborated with the same source file, I set up continuous integration on my server and hosted the result paper - which the other group members seemed to ignore, just looking at their local results, and at one point we had the numbers for numbered headings showing up twice in the document because one member didn't realize we were automatically adding them in.

For the other class, we had some group exams each over a weekend, and I found I had to organize everyone else's work, which was a lot of extra work. Some of them didn't understand they needed to give me a plain-text file with their contribution, and instead handed me MS Word with math, which caused some frustration for me. I emailed out the compiled document over and over, and we did essentially one-on-ones where they explained their work and I verified it, cleaned it up, and (re?)wrote most of it anyways.

If orgmode was my choice, I'd probably wind up doing the same, but you have to really behave like a type-A personality to lead the group, and stay type-A to get it done.

The takeaway I had is that if you take the lead and are willing to do most of the work you can use the tech you want to use and still be rather successful with a group.

But if you have to rely on them to do the work, they need to use technology they understand how to use.


> I found Orgmode was amazing for writing LaTeX documents - but I wasn't working with other people.

This is probably the best way to type notes (and diagrams!) in class. It also works awesome for pretty much everything else in life too, when it comes to taking notes, especially for STEM work. I hope this helps! :-)

* How I'm able to take notes in mathematics lectures using LaTeX and Vim: https://castel.dev/post/lecture-notes-1/

* GitHub repo for above: https://github.com/gillescastel/latex-snippets

* How I draw figures for my mathematical lecture notes using Inkscape: https://castel.dev/post/lecture-notes-2/

* GitHub repo for above: https://github.com/gillescastel/inkscape-figures

* How I manage my LaTeX lecture notes: https://castel.dev/post/lecture-notes-3/

* GitHub repo for above: https://github.com/gillescastel/university-setup


I love org mode and use it for almost everything (note taking, agenda, to-do list, contacts, teaching materials, protocols, documentation, ...). The boost in productivity that it gives me is amazing and I do not expect to switch to another system in this life. However, I agree that org is not a great tool for writing serious documents intended for publication. First, the issue about collaboration that you mentioned. Just about 10% of my collaborators use Emacs, and even those people aren't serious users of org mode. But even when I'm writing alone, I really do need the power of LaTeX in the vast majority of cases. Org allows embedding LaTeX (behind the scenes LaTeX is a stepping stone on the path to PDF), but if I end up littering my org document with LaTeX macros anyway, I can just as well use straight LaTeX and org doesn't really buy me anything. It just adds another level of complexity to common authoring workflows. I also often use literate programming techniques in my articles, and Knitr (LaTeX' solution) is considerably more powerful and reliable than org's Babel system.


I'm currently researching ways to integrate org-mode based citation structures with more commonly used tools such as Zotero, and apparently it's possible to make them talk nicely? The linked article states:

> Zotero is a good option, and if you’re using it it’s quite easy to use it with Org Cite. Out of the box, you can tell it to export your library, or parts of it, to a .bib file and automatically keep it in sync. I’d recommend installing the Better BibTeX extension though.

A non-technical friend and myself are looking into creating a blog for discussing issues related to health care, hence my interest on this front. Hopefully it's straightforward (famous last words)!


Does anyone know what software the author uses to prepare Figures 1 and 2 (the figures showing the syntax, with colored labels)?


The source code of these SVG images suggests https://inkscape.org/


I can confirm I used inkscape :)


Not 100% sure, but: (1) the arrow caps look like some that are available in Inkscape and (2) the SVG's XML has a bunch of inkscape-namespaced tags, so it was probably drawn in Inkscape.

Edit: Cross-posted with uallo. Leaving it up anyway.


Org Mode is able to spawn a separate Emacs process to do the job. I'm not smart enough to make that work. If the developers can lower the barrier to entry to that feature it would mean for me to not have to wait for the end of the export to pdf/html/etc run and keep on editing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: