Overleaf is a nice website which allows collaborative writing and publishing of LATEX documents.
I am currently working on a document. I need to make some modifications to the file there. To give a simplified example, in the hyperlinked document here I would like to increment each number.
I can accomplish this first by doing the modification on the string obtained from the URLFetch-ed the online file:
text = StringCases[
URLFetch["https://www.overleaf.com/read/mzshmkjmkxxd"],
Longest[ "\\documentclass" ~~ ___ ~~ "\\end{document}"]][[1]];
where the url is the Read Only Link available from the Share button, in the menu;
And then, using the following code snippet:
refinedText = StringCases[text, Shortest["\\section{" ~~ ___ ~~ "}"]][[1]]
StringReplace[refinedText, a : DigitCharacter .. :> ToString[ToExpression[a] + 1]]
I do the incrementing which I can later replace in text
and ultimately (this is the task which I would like to automate) replace the document online with text
.
So, my question is: how to upload/export the changes directly to overleaf using Mathematica?
I have tried, without any success, to do that using the Read & Edit Link (also provided through the Share button). This link may come in handy to those interested in this question.