nickfaraco · 2022-09-21 16:11
Hello everybody! I'm really having a hard time trying to decide whether to learn vim or emacs. I'm not here to ask for suggestion or any kind of comparison between the two, don't worry. What I'd like to know is whether org-mode could be useful for a specific use case, which could make me lean towards doom emacs rather than neovim.
From time to time I have to write documentation for software packages at work. While doing so, we like to have both a pdf version (using latex) to hand to our customers and an html (or similar) version to be stored inside the git repository of the project. To avoid having to write two different docs, we initially used markdown and a custom pandoc filter (for headings, frontpages and whatnot). The problem is that this approach is very limiting when it comes to cross-referencing, captions, and tables with cells spanning multiple columns or rows. Hence we switched to RMarkdown, but having to write R code for the sole purpose of properly handling a few images and tables is very frustrating.
Do you think that org-mode could be used to solve the problem once and for all? I know that tables in org-mode are pretty powerful, but I don't know to which extent. Nor if the same syntax would be correctly translated both in latex and html as it is with simpler tables.
Also, if any of you uses org-mode to write scientific papers (hence using different latex templates from different journals) in the STEMs, I'd like to hear your impressions.
publicvoit · 2022-09-21 16:22
Sorry, I'm not using [org-ref](https://github.com/jkitchin/org-ref) myself yet. However, I think it pretty much addresses your use-case.
Independent from your use-case: IMHO Emacs is able to do everything neovim is able to do and millions of things that neovim will never be able to. As long as those millions of things are not in your way as you don't need them yet (which they aren't IMHO), learning Emacs is a safe bet to me.
Disclaimer: I'm using vim and Emacs since the 90s on a daily basis.
JohnathanDee · 2022-09-21 16:41
I use org mode for ALL our documentation at work, precisely because the export options are so powerful.
Combined with org babel, it's ridiculously powerful. For example API documentation... I write source blocks using restclient so that when I export to HTML with the ReadTheDocs template, Emacs actually calls each API endpoint, formats and includes the response... With syntax highlighting.
It's absurd how awesome org mode is for writing documentation.
And yep... LaTeX and PDF, too. I also write dev notes in org mode and then export to PDF to share with my non-emacs coworkers. I use it for slideshow presentations too
[deleted] · 2022-09-21 18:14
[deleted]
nnreddit-user · 2022-09-21 18:54
> To avoid having to write [both LaTeX and html] we use markdown [which limits] cross-referencing, captions, and tables...
Markdown for the reasons you state is obviously not a good lingua franca. Turing-complete LaTeX is. So write and version control your master doc in LaTeX, and use pandoc to reel off all other formats (e.g., html). Org-mode is really besides the point.
ftrx · 2022-09-21 20:31
Org-mode export to LaTeX and various others format, html included, all templates can be customized as you like. So the short answer is yes, org-mode have no issue in producing, even automatically on-save (with a hook) a pdf and an html and since org-mode is part of Emacs you can also automate more as you like.
In term of Vim vs Emacs, as an ex hardcore unixer and vimmer, who have discovered a new and more civilized world jumping the ship I can suggest to consider a thing: Vim does not exists *alone*, Vim is the missing bit, one of the many, of Unix. Unix to be "simple" at first decide to dich previous systems that feature various GUIs and powerful integration to a barebone CLI and quick&simple IPCs. When they face the fact that nothing, Unix itself included can be really done well in such setup they add something like a text editor and a step at a time from basic line editor Vi before Vim after born and grow. That means: Vim is meant to be used as a Unix CLI companion.
Emacs on contrary is meant to be used alone. Oh, you can wrap any Unix command, actually you have to since we are all on "modern" systems instead of more powerful and advanced LispM these middle-age days, but Emacs works best alone.
That means: in Emacs/org-mode you do not only write text. You execute live code, collecting results in useful textual form to be eventually plotted, processed with other languages etc, you integrate files (org-attach), todos (org-agenda), notes of various kind about anything, mails, ... Emacs is not a companion of your CLI who is a companion of your desktop environment but it's your desktop environment.
This again means: since you probably already know a bit of unix CLI and Vim the Emacs path will be longer and harder, frustrating if you try to use it as a Vim replacement, but if you understand it's power and have patience it will pay back FAR more to the point that you'll never feel at home anymore in *nix environments feeling their limits while in the past you have felt their power.
Try this as a simple showcase: https://youtu.be/B6jfrrwR10k
AuroraDraco · 2022-09-21 20:43
Yes, I am pretty sure it solves your problems. Org-mode is incredibly powerful and the fact that it can export so well to so many different formats is one of its killer features. I am pretty sure you can write an org document and have it export to both latex and html much more seamlessly than other file formats
nickfaraco · 2022-09-22 20:06
First things first, I'd like to thank you all for your answers!
I probably should have specified that I'm already aware of org babel and the possibility to convert org files into different formats. My concern was mainly on whether or not I can build more complex tables in org mode (e.g. with cells spanning multiple columns) and if they would be correctly tangled by org babel.
Nonetheless, your precious advice led me to find the table.el package, which supports columns and rows spanning. So, thank you again!
The only doubt now is due to the fact that it seems like the content of a table.el table cannot be formatted using the standard org syntax. Well, I guess I should make some tests and see how it goes.