reddit / emacs

Working with overleaf and emacs?

pathemata · 2022-03-25 09:30
Does anyone have a good workflow for overleaf LaTeX editing inside emacs? I tried using ghostText with the package `atomic-chrome` but feels a bit shaky with losing connections.
badimtisch · 2022-03-25 10:14
I always clone the git repository behind overleaf, do my changes and push them. You might `pull --rebase` in case someone else works on it, but at least for all publications where people insisted on overleaf, this was the best way to go.
loskutak-the-ptak · 2022-03-25 10:36
I use overleaf over git. I usually write the paper locally in its own git repo. When it is time to share it with other people, I push this repo to overleaf. Here are my notes on how to do that (much simpler if you start directly from overleaf, but step 4) could still interest you): To create new overleaf project from existing paper repo, you have to: 1) create new empty overleaf project 2) go to menu/git to get the remote link 3) add the remote to the existing repo (=git remote add overleaf https://git.overleaf.com/5b98bffoobarfoobar=) 4) to not be asked for password every time, put a credential helper into ~.git/config~ [credential "https://git.overleaf.com"] username = blahblah@gmail.com helper = "!f() { test \"$1\" = get && echo \"password=$(gpg2 -q --for-your-eyes-only --no-tty -d ~/.authinfo.gpg | awk '/machine git.overleaf.com login blahblah/ {print $NF}')\"; }; f" (assuming you have a line in a gpg-encrypted ~/.authinfo.gpg that reads like: machine git.overleaf.com login blahblah@gmail.com password your-password1234 ) 5) pull from overleaf: =git pull overleaf master --allow-unrelated-histories --no-ff= 6) revert this merge: =git revert --mainline 1 HEAD= 7) and finally push: =git push overleaf master=
nanounanue · 2022-03-25 12:25
Thanks
badmaxton · 2022-03-25 13:32
One issue I encounter, especially closer to a deadline with many people doing online changes in parallel, is that pushing changes becomes hit and miss. The slightest change on overleaf means the push won't work, you have to fetch, rebase and try again. If only magit had a "fetch-rebase-and-if-all-is-well-immediately-push" command.
pathemata · 2022-03-25 13:52
Using with git is the way to go. I just realized that my new overleaf account does not have free support for the git workflow. Luckily I still have an old overleaf account with it.
badimtisch · 2022-03-25 15:25
For me, a `git pull --rebase && git push` usually worked (it's not magit but still better than overleaf) If it doesn't for you, there are two solutions: - be ready in time and don't have last-minute changes (we know how well that works, lol) - have a chat open and ask for a minute to push - do a loop in bash to try to `git pull --rebase && git push` until it succeeds - do last-minute changes with one person responsible for changes ("I will go over this in the next 15 minutes"). Depending on how you work this might also increase the coherence of the paper.
badmaxton · 2022-03-25 15:35
Thanks for the (meta-)suggestions :-), really great advice! Will put the git commands in a beat_overleaf.sh script :-)
XtremePocket · 2022-03-25 16:22
For a quicker (and potentially less safe) collaboration experience, you can use the new Dropbox integration in overleaf. I already sync all of my roan notes with it, so it was effortless to add to my workflow.
oantolin · 2022-03-25 16:22
So far I haven't been willing to pay for an Overleaf account to get access to the git features, but if you are willing to pay, git is definitely the way to go. What I do instead is use the vim emulation on Overleaf which is actually surprisingly decent. It even includes recording keyboard macros and somewhat obscure commands like `~` (which toggles case). The Emacs emulation is absolutely awful, I don't recommend it at all.