Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Org-mode as notebook for non-programmers

I'm a non-programmer (except of some Perl and R skills). I'm starting my Phd this year and considering to have org-mode as a laboratory notebook. However, before I spend time learning it, I have a bunch of questions..

Most importantly, at work I'm working on a different PC than I do at home, but I use both of them for work, so what I need is a seamless connectivity. So my idea was to store the org file on a cloud, but actually I will have files that are linked in my org-mode file, but those are actually on a server (at work) which I am not allowed to store on my cloud. This means, lets say I've got some data in a spreadsheet and want to link this spreadsheet in my org file. However, on my private PC this file does not exist. How does org-mode deal with that? Is it even possible? I mean, does it complain? Also, there are folder on my work PC that are locked for me, so installations and stuff is usually done by the IT service. Does emacs than even work? I tried with R and it works, even installing packages from within R, however, Perl does not as executing perl scripts from the terminal requires folders that are locked.

Also, If you can recommend me good sources for getting started I will be pleased :)

Thanks in advance!

like image 956
ic23oluk Avatar asked Feb 23 '26 01:02

ic23oluk


2 Answers

I use org-mode for lots of notes. I use different computers also. The most basic thing I do is have the most inexpensive Amazon AWS compute instance (10-15$ a month IIRC). Emacs has this great system called TRAMP mode that allows you to edit remote files as if they are local. So in my .emacs file I have:

(find-file "/ssh:[email protected]:~/logs/year/2018/may.org")

so when I startup emacs it grabs this month's org file. I also maintain a separate directory for tasks that span more than one day:

in the may.org file:
** [[../../tasks/something useful.org][something useful]]

then in the directory:
/ssh:[email protected]:/home/ec2-user/logs/tasks/something useful.org

This setup seems ok for my basic needs. for your second requirement you might be able to use tramp mode. You can use org-mode's link system and tramp mode together:

[[file+emacs:/ssh:someUser@otherMachine:~/someDir/TextFile.txt][TextFile.txt]]

you will need to have your ssh-keys setup so you don't have to login:

in ~/.bashrc
ssh-add ~/.ssh/my-aws-secret.pem 

ultimately to get emacs to do different things on different machines you may have to get down to conditional branching:

from my .emacs file (p is for predicate):

(defun p-is-windows-os ()
  (eq system-type 'windows-nt))

(defun p-is-mac-os ()
  (eq system-type 'darwin))

(if (p-is-windows-os)
  (setq-default ispell-program-name "C:\\Program Files (x86)\\Aspell\\bin\\aspell.exe"))

if its the same OS on both computers, you might be able to do the condition on the network IP or something.

I really like org-mode and emacs in general. But, I am hesitant to recommend them because they are so different/weird from everything else (I'm a programmer, so weird make sense). Whatever you do: backup your data! Let me know if you want more info.

like image 186
James Anderson Avatar answered Feb 26 '26 00:02

James Anderson


I strongly recommend you look at Dr. John Kitchin materials. He does computational chemistry, but a lot of his materials are generic enough to be useful (specially those related to paper writing).

http://kitchingroup.cheme.cmu.edu/blog/category/emacs/

he has a very informative youtube channel.

https://www.youtube.com/channel/UCQp2VLAOlvq142YN3JO3y8w

he has also created some packages to improve org. I consider John as the best source of material for a researcher wanting to use org.

I personally use org-mode all the time for my own research.

About using the cloud. Place your org-files in a common directory (e.g. Dropbox) and make sure that you enable

   (global-auto-revert-mode t)

This way if a file is changed in one machine, it will be updated automatically in any other emacs running. This will avoid conflicts.

Also, learn to use org-babel. It is absolutely amazing for R. It is the hacker's version of Jupyter Notebook. This is a good tutorial:

https://orgmode.org/worg/org-tutorials/org-R/org-R.html

--dmg

like image 26
dmg Avatar answered Feb 26 '26 00:02

dmg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!