Closed snairdesai closed 1 year ago
@ShiqiYang2022; @simonepandit; and @Erick11293: To increase familiarity with template
, and get a sense of how we revamp lab development/workflow procedures, @jc-cisneros and I thought it might be a good idea to have you three support us with this task. Please see a description of the proposed deliverable in the comment above. A few notes:
template
and gslab-make
. Within any issues related to template
and gslab-make
, we should prioritize wrapping this one first (@jc-cisneros and I will also be working on this and other issues here).gentzkow/template
.
84_shift_overleaf
). If not, you may need to fork this branch and make edits separately, commenting your proposals in this thread.Thanks for the help!
Thanks, @snairdesai! I invested in this issue and I suggest this issue can be broken into three tasks as listed:
Task List
.lyx
formats in paper_slides/code to .tex
formats.tex
outputs, as proposed in #85..tex
formats to ensure their compatibility in overleaf.@snairdesai @jc-cisneros Feel free to edit and comment your thoughts!
cc: @simonepandit @Erick11293
Thanks @ShiqiYang2022! The main purpose of this issue is simply to switch our compiler from LyX
to Overleaf
. Right now, Overleaf
allows integration/synchronization with GitHub
for premium accounts, but only for the master
branch of repositories. Our goal would be to find a way to enable integration for development branches as well. To specify further: in LyX
, we can run paper_slides
for any branch, and see the outputs immediately populate in that branch. In Overleaf, we currently need to merge back to master
before seeing edits populate on any shared Overleaf files.
This is not something that we need to touch code in template
yet for (i.e., the bullets you have provided above are not relevant for now). We simply want to investigate the Overleaf
to GitHub
synchronization further, and see if there are any potential avenues to facilitate development edits. After we have a sense of what can be done, we can test this with template
.
Thanks @snairdesai for the clarification!
I am posting notes and updates on to-do list here, per meeting with @simonepandit @Erick11293 we agreed on the following proposal, listed by priorities:
Investigate on Overleaf-GitHub synchronization. Currently there's four proposals:
Pros and Cons with respect to these four proposals, are briefly discussed as follows:
Switch the .lyx
formats in paper_slides/code to .tex
formats
Edit and test the output .tex
formats to ensure their compatibility in overleaf.
We decide to investigate on 1 primarily and @snairdesai @jc-cisneros Please let us know what's your thoughts for that, thanks! cc: @simonepandit @Erick11293
Updates of Proposal (1)
I tested the feasibility of implement (1) using my template
. When there's an overleaf issue, the actions can be broken down into the following parts:
new repository
template_overleaf_sync
.development branch
to the new repository
(so it becomes a master
branch)
7-link-the-issue-related-branch-to-other-repository
of repository template
to template_overleaf_sync
by running the following codes:
- First switch to the branch you want to sync with:
git checkout 7-link-the-issue-related-branch-to-other-repository
- Add
template_overleaf_sync
as a new remote repository in local repository:git remote add https://github.com/ShiqiYang2022/template_overleaf_sync
- Push the branch to
template_overleaf_sync
git push template_overleaf_sync 7-link-the-issue-related-branch-to-other-repository
master
branch into overleaf, make edits and push back
template_overleaf_sync
".README.md
from "README" to "README(Edited By Shiqi)".master
branch in new repository
back to development branch
master
branch in new repository
(7-link-the-issue-related-branch-to-other-repository
in template_overleaf_sync
in my case) back to the development branch 7-link-the-issue-related-branch-to-other-repository
of repository template
by running the following codes:
- Pull the
7-link-the-issue-related-branch-to-other-repository
intemplate_overleaf_sync
into local environmentgit fetch template 7-link-the-issue-related-branch-to-other-repository
- Create a new local branch called
my-temp-branch
and set it to the recently pulled remote branch:git checkout -b my-temp-branch template_overleaf_sync/7-link-the-issue-related-branch-to-other-repository
- Shift to the development branch and merge the content of
my-temp-branch
into it, and push back:git checkout 7-link-the-issue-related-branch-to-other-repository
git merge my-temp-branch
git push origin 7-link-the-issue-related-branch-to-other-repository
- And then you can view the commit in the development branch here.
By implement (1), it addressed the issue of Overleaf-GitHub synchronization by adding a new parallel repository and correspondingly a new parallel overleaf project.
@simonepandit @Erick11293 please feel free to test this proposal on your end and comment/discuss on that! @snairdesai @jc-cisneros any suggestions with respect to this proposal are highly welcomed!
@ShiqiYang2022 as I see you didn't need to fork the repository, right? You make a local copy of the repository and created a new one from the branch that you copy. So, I this approach is more close to (2) than (1).
@ShiqiYang2022 as I see you didn't need to fork the repository, right? You make a local copy of the repository and created a new one from the branch that you copy. So, I this approach is more close to (2) than (1).
Thanks @Erick11293! I understand your point. Currently it is not feasible to directly fork a branch other than the master
branch on github, and given that we have our local copy of the repository almost the time, so I make the copy of the local side of development branch
to create the remote new repository
.
@ShiqiYang2022 Thanks for the great work here so far. I'm really interested to see where this goes. A couple of thoughts to throw in.
In terms of the broader goals of this issue, we will want to maintain both Lyx and .tex versions of the template. I think the best way to do that will be to move the Lyx version of paper_slides
into extensions/lyx
.
Your proposal (1)/(2) involving creating a new repository is interesting. Just to make sure I understand the proposed workflow, is the idea that the extra repository would be created by an individual user on their individual Github account and be used solely as a pipeline to Overleaf? I.e., these extra repositories would never show up on the lab Github and they would be invisible to everyone other than the lab user that created them? If so, I like that in principle.
A question is how we handle things on the Overleaf side. My understanding is that a given Overleaf project only has a single branch. So if we have two issues open in parallel, with two associated development branches in Github, it won't be possible to be using a single shared project tin Overleaf for both of them simultaneously. Is the idea that we'd need to create a separate Overleaf project for each issue/dev branch?
@gentzkow Thanks! Replies to your thoughts:
- In terms of the broader goals of this issue, we will want to maintain both Lyx and .tex versions of the template. I think the best way to do that will be to move the Lyx version of
paper_slides
intoextensions/lyx
.
Agree! Will investigate on that.
- Your proposal (1)/(2) involving creating a new repository is interesting. Just to make sure I understand the proposed workflow, is the idea that the extra repository would be created by an individual user on their individual Github account and be used solely as a pipeline to Overleaf? I.e., these extra repositories would never show up on the lab Github and they would be invisible to everyone other than the lab user that created them? If so, I like that in principle.
Yes. This extra repository only appears on individual Github account and only used as a pipeline to overleaf. I think we can set repository visibility to "private" and only invite collaborators, to make sure this is used solely a pipeline.
Will test its feasibility on my end!
- A question is how we handle things on the Overleaf side. My understanding is that a given Overleaf project only has a single branch. So if we have two issues open in parallel, with two associated development branches in Github, it won't be possible to be using a single shared project tin Overleaf for both of them simultaneously. Is the idea that we'd need to create a separate Overleaf project for each issue/dev branch?
Yes. Your understanding is correct. Currently Overleaf do not support synchronization across projects. It would indeed be challenging to sync development branches of multiple parallel issues all simultaneously with a single Overleaf project. One workaround, as you mentioned, would be to create a separate Overleaf project for each issue/development branch.
Some challenges that might come with this approach. (1) We need to manage multiple Overleaf projects concurrently, each potentially with its issue-collaborators. This might introduce additional errors/confusions. (2) It may also involve merging conflicts when trying to integrate the changes from the separate Overleaf projects/branches back into a single main branch on GitHub.
For (1), we cannot solve this due to the limitation of overleaf itself. For (2), since Overleaf (and LaTeX in general) allows to split your document into multiple independent .tex
files, and combine them together when compiling the final document. Then for most cases, we might be able to have each issue worked on in its own .tex
file, to ensure changes don't conflict when they are eventually merged.
Updates of Proposal (2)
I tested the feasibility of implement (2) using my template
. When there's an overleaf issue, the actions can be broken down into the following parts:
Clone the master
branch of the repository into a new folder at local end, and follow the setup instructions.
Create an parallel Overleaf project from the local master
branch, following the instructions in Overleaf's Git integration.
master
branch.lib/gslab_make
in template
, so we cannot directly push the whole project to overleaf. Instead, we need to move the submodule lib/gslab_make
somewhere else when integrating to overleaf.Make edits on overleaf, and pull the edits to master
branch.
Merge the edits in master
branch to development branch
locally, and push to the development branch
to github.
By implement (2), it addressed the issue of Overleaf-GitHub synchronization by creating a new parallel folder containing master
branch locally and correspondingly a new parallel overleaf project.
@simonepandit @Erick11293 FYI.
Discussion of Proposal (1) and (2)
Proposal (1) require creating parallel repositories and parallel overleaf projects; and sync by GitHub Synchronization.
Proposal (2) require creating new parallel folders containing master
branch locally and parallel overleaf projects; and sync by Git integration.
Some thoughts on the two proposals:
Hi @ShiqiYang2022. Sorry for the slow reply on this thread. Thanks for the great work!
On balance given the factors you note above, I think we should set aside option (2). I would also vote we set aside option (3) from the original list.
I continue to think option (1) is worth considering.
The additional thing I'm most keen to explore is option (4) -- i.e., what is the easiest way to sync a local working directory without using Github integration on Overleaf at all. I've played around with Overleaf's Dropbox sync and found it pretty clunky, so I'm thinking that may not be the best option. Curious what other options might be available.
Thanks @gentzkow! What a coincidence because I also want to update the current process on this issue.
On balance given the factors you note above, I think we should set aside option (2). I would also vote we set aside option (3) from the original list.
I agree and will set aside options (2) and (3) for now!
I continue to think option (1) is worth considering.
Yes will continue explore on that with @Erick11293 @simonepandit! Currently we have two remaining tests on (1) to complete:
template
and share among collaborators.The additional thing I'm most keen to explore is option (4) -- i.e., what is the easiest way to sync a local working directory without using Github integration on Overleaf at all. I've played around with Overleaf's Dropbox sync and found it pretty clunky, so I'm thinking that may not be the best option. Curious what other options might be available.
Yes will explore further on (4) in the original list with @Erick11293 @simonepandit!
For the Overleaf's Dropbox sync, we had a group meeting @snairdesai @jc-cisneros @Erick11293 @simonepandit last Friday to discuss the proposal of Overleaf Dropbox sync issues(also thank @Erick11293 for initial discussion and contribution). We discussed together and found that Dropbox sync has its own strength, mainly for it enables switch across branches and sync to overleaf; but Dropbox sync can be a bit cumbersome and risky in (1) Inconvenience in collaboration of multi-parallel-issues; (2) Introducing an extra layer of complexity; (3) Risk of dropbox sync failures and losing files. I agree to set it aside but just taking notes here in case we need to reconsider this option.
By the way, would it be convenient for you to give me the permission of pushing edits on our template, in case we finished 1 in the three big bullets above and would like to investigate on 2 and 3, thanks!
cc: @snairdesai @jc-cisneros @Erick11293 @simonepandit
Great. Thanks!
I added you to template
.
Feel free to keep Dropbox sync in the mix if you all feel it is promising.
Update: Per RA meet, tasks are listed below by priority:
[x] @ShiqiYang2022 will explore ways to sync a local working directory without using Github, following the comments here.
We will work on shifting Lyx to .tex version of the template
once preceding steps are finished.
Note to Self:
Consider using Github Actions for two-way synchronization in (1): the original repository with multiple branches and a secondary "Overleaf-Sync" repository mirroring a specific dev branch.
One workflow can be designed to push changes from a development branch in the original repo to the Overleaf-Sync repo. Conversely, another workflow in the Overleaf-Sync repo can be configured to push its updates back to the appropriate branch in the original repo. Proper git configuration and appropriate permissions using the GITHUB_TOKEN might be crucial for safe and seamless synchronization between the repositories.
Note to Self on ways to sync without using Github:
One way to sync without using git/github might be use python tools. There are some already developed tools available. "Overleaf-Sync" currently is the most-used one for bidirectional synchronization between local files and Overleaf projects. It enables easy sync, PDF downloads, and project listing without requiring Git or Dropbox. (Sep. 5th note: it in essence is a package that make the manual-upload/download steps easier)
I have tested it on my end but unfortunately encountered some unsolved errors. I think maybe we can design a Overleaf-Sync package in our gslab_make
if needed.
Hi gslab 👋 dropping in here with a fun little idea on an alternative to both lyx
and Overleaf. I’ve been using the pdflatex
command to locally compile .tex
deliverables into .pdf
s for the Commit Flex project. My idea:
.tex
files locally by having make.py
run the shell command pdflatex
Comparison with Overleaf:
Live collaboration: Overleaf would allow for live collaboration on editing the .tex
file; if we compile .tex
files locally, then we could achieve live editing with a variety of other tools (for example, if most collaborators use VS Code as their text editor, it is very easy to collaborate using VS Code’s Live Share)
Control over .tex
distribution: with Overleaf, we rely on Overleaf's TeXLive distribution, which gives us less control over its version and specific customizations. This is potentially a concern w.r.t. replicability, since Overleaf updates its TeX Live distribution periodically, so occasionally it may be the case that a document that compiled successfully in the past may run into issues if there are breaking changes in newer package versions. We could avoid this by being explicit about package versions or by keeping an archived version of the TeX Live distribution, but these options are more feasible on a local system than on Overleaf.
Offline compilation: not a huge deal, but if we rely on Overleaf, we give this up.
I asked our friend GPT-4 about their thoughts on this comparison, and here is their summary:
If your focus is on replicability, control, and independence from external platforms, local compilation might be the better choice. If collaboration, ease of use, and platform independence are more important, and you're okay with some level of dependency on an external service, the Overleaf-GitHub integration could be beneficial.
Bonus idea:
While I like how clean and organized our .tex
deliverables are on Commit Flex, I worry about the space each versioned .pdf
takes from Git LFS (expensive 💸). Instead, we could employ a cheaper storage solution for the compiled .pdf
s. If this is of interest, I have implemented a basic version of a tool that uses Git Hooks to upload deliverables with the associated commit SHA1 hash to an AWS S3 bucket right before each git push
. We would need to figure out how to make the S3 bucket pdf urls public to collaborators only, but I think this is something we may want to do eventually.
cc @ShiqiYang2022 @snairdesai
@arjunsrini Thanks! Great to have your input here.
We definitely want to support local compiling of .tex
. That is supported in the run_latex
command in gslab_make, which can be called by make.py
. What run_latex
does is essentially issue the pdflatex
shell command, while doing some logging/housekeeping things at the same time.
@snairdesai I know we'd been debugging some issues w/ run_latex
a while back. Can you remind me status on that?
In terms of workflow, I think we want to use run_latex
for any compile that is going to be merged back to main
at the end of an issue. But I also think we want to be able to use Overleaf for editing / compiling / collaborating during work on an issue. There are many different editors, but Overleaf seems to be the one that people have converged on liking as a default, so it's good to support it.
The issue w/ different tex
installations is real and annoying. I don't know of a great solution. Even when we're doing local compiling we're depended on the particular tex
installations people have on their local machines.
As far as the PDFs go, we are not concerned about the incremental storage costs on LFS
. I think sticking to LFS
is going to be more robust than trying to roll our own.
Thanks @arjunsrini @gentzkow! Re this query:
@snairdesai I know we'd been debugging some issues w/
run_latex
a while back. Can you remind me status on that?
At least on projects which I've worked on (and @jc-cisneros reports a similar experience) we have not utilized the run_latex
command directly, as we tend to use either Overleaf
or LyX
(which requires run_lyx
instead). We did/do have issues rendering PDFs using run_lyx
, and the root of the problem is one you flagged: local TeX
distributions.
LyX
and TeXLive
are not always in alignment, and this has created issues when compiling documents due to incompatibilities. The workaround solution we implemented was for all of @ShiqiYang2022, @Erick11293, and @simonepandit to install the 2022 version, as the 2023 version was not compatible with the latest version of LyX
(@jc-cisneros and I both had the 2022 version as well from when we arrived, which continues to work as expected).
We have not found a solution to overcome this issue with the local TeX
distributions, and that is part of why this shift to development in Overleaf
might help. It is true (as @arjunsrini notes) that we would rely on Overleaf's native TeXLive
distribution rather than our own -- but at least this would enable stability across machines in versioning.
@gentzkow
I have explored more on proposal (1) of two-way Github-Overleaf synchronization. To be specific, I made progress in the following 3 aspects:
I suggest since currently we have produced a relatively complete framework on synchronizing the development branch to Overleaf, maybe we can consider putting our deliverable somewhere? Maybe the appendix of lab-manual/wiki is a suitable place. If this is reasonable to you, I can open a issue and pull request in lab-manual, also let Jesse know and ask for his advice.
I have also explored other ways to sync without using Github. If we need to synchronize to Overleaf without GitHub, we can consider using python tools(maybe design a command in gslab_make), details can be referred in this thread. If we need to collaborate outside overleaf(locally), then achieving live editing with VS Code’s Live Share is a decent idea as @arjunsrini suggested. Also huge thanks @arjunsrini for contributing our lab!
For Next step:
We nearly complete step 1 and currently have step 2 and 3 in this thread to be finished. This issue which started with manageable scope expanded as some new questions arise. At this point maybe it is a good idea to carve off step 2 and 3, those two subparts of upgrading paper_slides
from .lyx
compile to .tex
compile, into a separate issue?
Please let us know your thoughts, thanks!
cc: @snairdesai @jc-cisneros @Erick11293 @simonepandit
@ShiqiYang2022 Excellent work here! Definitely looks like a feasible option.
My main concerns are (1) the Github integration steps are still fairly elaborate and might be confusing to some coauthors; (2) the automation, while very cool, creates additional failure points that could end up being frustrating for users to debug.
One way or another, I think we can agree that this is the right high-level model:
What would you think about the following alternative?
In terms of next steps, I agree carving off (2) and (3) to separate issues is a good idea. On (2), I think we want to keep Lyx in the template but create a separate .tex
version in /extensions/
.
@gentzkow Thanks very much! Below are the replies:
To your concerns:
(1) the Github integration steps are still fairly elaborate and might be confusing to some coauthors
(2) the automation, while very cool, creates additional failure points that could end up being frustrating for users to debug.
Admittedly, ideally we should make the development branch directly synchronized to Overleaf. But this is not technically applicable unfortunately, and this version of approach might be one of the resonable solutions till now.
One way or another, I think we can agree that this is the right high-level model:
- Each Github development branch corresponds to a separate project in Overleaf
- The assignee of the relevant issue creates that Overleaf project at the same time they create the development branch and then invites other collaborators to join
- When the issue is completed (or at major milestones along the way) the content is exported back from Overleaf and committed to Git
- Once the issue is closed, the Overleaf project is archived
Agree!
What would you think about the following alternative?
- User imports the relevant /paper_slides/ directory to Overleaf manually (using New Project -> Upload Project)
- When ready to commit, User exports the content from Overleaf to the local clone of the development branch manually (using Download -> Source) and then commits
This is also what I have considered before. Let me analyze in detail about its pros and cons compared to the proposal we suggested previously:
In terms of next steps, I agree carving off (2) and (3) to separate issues is a good idea.
Perfect! Will open a new issue once this is closed.
On (2), I think we want to keep Lyx in the template but create a separate .tex version in /extensions/.
One small note: I noticed that there's some inconsistency related to your previous https://github.com/gentzkow/template/issues/84#issuecomment-1655752652 No. 1. Could you please let me know which one of those two you prefer now? My idea is that since we want to replace .lyx
to Overleaf, we had better to move .lyx
to /extensions/
.
There are many thoughts that I want to convey in this thread(so it's a bit long) and thanks for your patience for reading it!
@ShiqiYang2022 Thanks! This is all very clear and I agree very much.
I have one question on this
(1) Downloading the entire project as a single compressed folder and then decompressing it over your existing local files would mark all files as changed, even if you only modified a single file on Overleaf.
Are you sure about that? My understanding is that Git will recognize two files as the same if they have the same hash, regardless of metadata like date modified on the local system. So I would have thought if we download the entire project as a zip archive and then paste it over the existing local files Git would correctly see unchanged files as unchanged. (At least for text files -- there can be some trickier issues w/ binary files.)
On this
One small note: I noticed that there's some inconsistency related to your previous https://github.com/gentzkow/template/issues/84#issuecomment-1655752652 No. 1. Could you please let me know which one of those two you prefer now? My idea is that since we want to replace .lyx to Overleaf, we had better to move .lyx to /extensions/.
Good point. Mea culpa! Let's defer to my previous self over my current self -- i.e., stick to what I'd said originally.
@gentzkow Thanks! Replies are below:
I have one question on this
(1) Downloading the entire project as a single compressed folder and then decompressing it over your existing local files would mark all files as changed, even if you only modified a single file on Overleaf.
Are you sure about that? My understanding is that Git will recognize two files as the same if they have the same hash, regardless of metadata like date modified on the local system. So I would have thought if we download the entire project as a zip archive and then paste it over the existing local files Git would correctly see unchanged files as unchanged. (At least for text files -- there can be some trickier issues w/ binary files.)
That's my bad -- sorry! I should make it clearer. What I wanted to convey is: such compress and de-compress will make some files(instead all, that's a mistake) status changed, even you did not modify them.
I test the manual procedure on Newsworthy
project, which compiles .tex
files, the only edit in .tex
file is that, I replaced the author in paper_slides/source/ondeck/condstate.tex
from "Luis Armona" to "GSLab Boy". Then I decompressed the project to /paper_slides/
and run git status
, the procedure and results are shown below:
I found that apart from condstate.tex
, newsworthy.bib
also shown to be modified, though I made no edits on that file.
I also "Download -> Source"ed the edited files to windows(since some coauthor use Windows), and run git status
again. Attached is what I found -- the number of "modified" status files increased a lot.
To summarize, the point I want to convey is that some files, though unchanged, can still shown as "modified" in this procedure. Thanks for the great catch and sorry for the confusion caused!
One small note: I noticed that there's some inconsistency related to your previous https://github.com/gentzkow/template/issues/84#issuecomment-1655752652 No. 1. Could you please let me know which one of those two you prefer now? My idea is that since we want to replace .lyx to Overleaf, we had better to move .lyx to /extensions/.
Good point. Mea culpa! Let's defer to my previous self over my current self -- i.e., stick to what I'd said originally.
Got it! I will then move .lyx
to /extension/
.
Fascinating.
On the first instance of git status
: What do you get if you git diff
the file newsworthy.bib
? Maybe it has something to do with a difference in encoding?
I wonder if it might be different once the files have all been exported from Overleaf at least once. Maybe fewer would show as changed when we re-export from Overleaf a second time?
Do any of these files register as changed if you sync them to Github via Overleaf (a la the automated method)?
@gentzkow Thanks!
On the first instance of
git status
: What do you get if yougit diff
the filenewsworthy.bib
? Maybe it has something to do with a difference in encoding?I wonder if it might be different once the files have all been exported from Overleaf at least once. Maybe fewer would show as changed when we re-export from Overleaf a second time?
The result showed below. The implication of this output is that it compared two files, the file mode changed from executable permissions (100755
, original one) to regular read-write permissions (100644
, downloaded from Overleaf). If I re-export from Overleaf, the permission still did not change, see the details below.
I also tried to find the difference on Windows, the main difference is line endings, instead of permissions.
Do any of these files register as changed if you sync them to Github via Overleaf (a la the automated method)?
For the automated method, I add the exact same newsworthy.bib
file to the my local template, pushed it to my Github template, and tested automate sync between Overleaf and Github with simple text edits. The result turned out to be: only the edited .tex
file changed, not the .bib
file.
The specific commit of pushing new edits from Overleaf to the mirror repo can be tracked here. The commit pushing new edits from mirror repo back to the original repository can be tracked here. The two-sided automation process can be tracked here(origin -> mirror), and here(mirror -> origin).
One small note, I added newsworthy.bib
, instead of other .bib
file to ensure all others feature of the .bib
file are same. But it in essence is a private .bib
file. I will use git reset
to delete this after you have checked the automated process, to ensure no history recorded.
Interesting. Do we have a sense of why that .bib
file had executable permissions in the first place? If we set it to read-write from the start would that solve the problem (on Mac)?
@gentzkow Thanks!
Do we have a sense of why that .bib file had executable permissions in the first place?
I traced the history of that .bib
file in newsworthy
project. In commit 9c16b4d
made by previous RA Molly Wharton, the file permission changed(see the change here) from regular read-write permissions (100644
) to executable permissions (100755
). It seems like she deleted the .bib
file by mistake(see the comment here), and when she added it back, the permission changed.
An extra and deeper question is: why permission changed at that specific time at that specific RA in that certain commit? I’m also curious about that, and I did some further research. It's very hard to give a 100% correct answer, because I cannot know what happened to her computer 4 years ago, but I attached some thoughts below that might help.
If we set it to read-write from the start would that solve the problem (on Mac)?
Yes, if we git clone
files which initially have read-write permission, then upload to Overleaf, edit and download -> source, this problem is solved, i.e, the permissions are always read&write(100644
) and the file will not be showed to be edited.
One note to be added to revert one of my claim in this thread:
Do any of these files register as changed if you sync them to Github via Overleaf (a la the automated method)?
For the automated method, I add the exact same
newsworthy.bib
file to the my local template, pushed it to my Github template, and tested automate sync between Overleaf and Github with simple text edits. The result turned out to be: only the edited.tex
file changed, not the.bib
file.
I would like to revert my claim here. Such Github-Overleaf sync do change file permissions. This is specified by Overleaf in Known Limitations. I found the newsworthy.bib
file I used to sync then do not have executable permission(it's my mistake!).
From my knowledge, we currently do not have easy ways to solve this limitation automatically. This is because, the executable permission change is committed together with other edits. When we commit from Overleaf to Github, those files which lost their executable permission, together with the edited .tex
files, are in one single commit already made by Overleaf. I tried some simple approaches but none of them helped. One way for us to solve this is to set this aside, and check and revert permission changes when we trying to merge the dev branch
to the master
branch.
@ShiqiYang2022 Thanks!
This is very thorough. As a small note of feedback, I'd say maybe even too thorough -- good to run this down, but you may not have needed to put that much time into analyzing the historical change. All I'd meant to ask was whether we had reason to expect many files would have executable permissions in the future that would lead this issue to recur. Sorry that wasn't clear. But very helpful in any case!
So it sounds like the bottom line is that the permission issue is not a strong reason to prefer Github<>Overleaf sync over the manual method I mention here. Do you agree?
If so, does that mean we can cross off (1) in your list of cons for the manual method here?
@gentzkow Thanks!
As a small note of feedback, I'd say maybe even too thorough -- good to run this down, but you may not have needed to put that much time into analyzing the historical change.
Thanks! I will be more concise, I investigated further just for fun and curiosity. Thanks for the reminder!
So it sounds like the bottom line is that the permission issue is not a strong reason to prefer Github<>Overleaf sync over the manual method I mention here. Do you agree?
Agreed! Both required manual checks.
If so, does that mean we can cross off (1) in your list of cons for the manual method here?
Yes. Permission worries can be set aside. One reminder: for different OS systems, issues of line endings in manual method may generate.
Based on discussions, I suggest it might be time for decision. Some reference listed below for review:
General Framework we argeed: ref link.
Options we still considering: Mirror repo option(with/without automation, ref link), manual option(ref link)
Comparison between two methods: ref link.
Potential deliverables: Mirror repo option ref link, Manual option(not yet, but happy to write one if needed)
Place to put deliverable suggested: ref link.
Some other options but not investigated much(Dropbox, ref link; python packages, ref link)
Great. Thanks! I agree it's time for a decision.
The ideal from my perspective is that we offer both the Manual option and the Mirror option, allowing lab members to pick whichever they prefer on a case-by-case basis.
Am I correct that which option I choose when I am the assignee of an issue should not change the workflow for other lab members in any way?
I.e.,
I agree that we should put what we agree on in the lab-manual appendix.
One open loop is how to manage differences in the Tex installation on Overleaf vs. our local machines. We definitely want to make sure the PDFs compile locally. Can you remind me the status of that issue?
@gentzkow Thanks! Replies are below:
The ideal from my perspective is that we offer both the Manual option and the Mirror option, allowing lab members to pick whichever they prefer on a case-by-case basis.
Am I correct that which option I choose when I am the assignee of an issue should not change the workflow for other lab members in any way?
Yes! I agree with all. Let's keep both.
I agree that we should put what we agree on in the lab-manual appendix.
Great! Then I will open a issue and PR there.
One open loop is how to manage differences in the Tex installation on Overleaf vs. our local machines. We definitely want to make sure the PDFs compile locally. Can you remind me the status of that issue?
I think we currently do not have one issue directly compare .tex
compile locally vs. Overleaf. But definitely we should compare that. I will investigate into that in the process of adding local .tex
compile into /paper_slides
, as part of template
.
I guess you were referring the issue of the dis-alignment between LyX and TeXLive. We currently use Lyx as complier. And Lyx currently do not support MacTex 2023, details could be referred per https://github.com/gentzkow/template/issues/84#issuecomment-1690353462.
Excellent.
I'll leave you to open a new issue for the .tex
compiles. For that, we need not worry about the Lyx issues. We should just aim to have a robust system where we can be confident local compilation and compilation on Overleaf will (almost aways) produce the same result.
Per RA meet, @Erick11293 @simonepandit have bandwidth to test current options for Overleaf <> Github sync. This is the last task to complete before wrap up this issue.
The purpose of this test is to:
(1) Test the reproducibility the two options we proposed between lab users; (2) Point out any places that make you feel confused in the deliverables of mirror repo option (ref link); (3) Ensure the privacy and security of the sync process.
The detailed process is described below:
template
(see here), and create an issue + issue branch
.paper_slides/tex_files_for_test/main.tex
, and sync back. Please try both options:
issue branch
to master
, but make sure you do not merge the .yml
file in automation workflow into master
.issue branch
, but use the same mirror repository, change the name of the mirror repo
and modify the automation .yml
code correspondingly. Repeat the steps 2-4.This is not urgent, and please let me know for any questions. Huge thanks in advance for your time here!
Note to self: When applying mirror option in my personal project, I found: contrast to 2nd reply, 3th bullet in https://github.com/gentzkow/template/issues/84#issuecomment-1700372329, the reuse of mirror repository in a different issue is not very smooth. Will investigate on this.
Update Sep 18th: per https://github.com/gentzkow/template/issues/84#issuecomment-1724716114, if the setup of automation can be simplified, reusing the mirror repo or not does not matter much. Thus this is not worth worrying.
Per meet with @Erick11293, main progress and to-dos:
The test of options is almost completed and goes well. @Erick11293 will comment his test experience in the thread.
Main new finding: The setup of automation in mirror option can be simplified. Previously, we need to manually fill the name of repos and branches, and username + email(in the black boxes of figure below), which is per comment might be one potential sync failure points. We can add commands within same Github Action to retrieve those info.
Hi @gentzkow @ShiqiYang2022 :
Here the progress on the test:
@gentzkow
Following https://github.com/gentzkow/template/issues/84#issuecomment-1710862838, we have tested the reproducibility the two options(mirror and manual) for several rounds between lab users. Below is a short summary:
.yml
file provided follow the instructions, to establish automation process. Details ref: these two comments.manual option
; add workflow
, notice
and known limitation
to make it user-friendly. The updated version ref: here.Since the test is completed, I will close this issue if the recent edits is reasonable to you. I will then open an issue and put the instructions into the lab-manual as we agreed in https://github.com/gentzkow/template/issues/84#issuecomment-1706974686. Thanks!
Acknowledgements: Thanks very much @Erick11293 for the joint work in the "test -> improve -> test" loop, and many thanks @jc-cisneros for the test as an "outside user"!
@ShiqiYang2022 Sounds great!
I'd suggest that you wrap this issue up then open a separate issue for me to test the final procedure myself. Once that's done we can incorporate any suggestions I have then add to the lab manual.
In this issue we tried to shift template complies from lyx
to Overleaf
. We mainly focused on exploring the option to allow Overleaf workflow on development branches.
The decisions could be found at https://github.com/gentzkow/template/issues/84#issuecomment-1705924532 and https://github.com/gentzkow/template/issues/84#issuecomment-1706974686.
The deliverable is this instruction of Github-Overleaf workflow.
Issue #86 follows this issue, focusing on shifting lyx
compile to .tex
compile in /paper_slides/
.
Issue #87 follows this issue, and it's for Matt to test the final deliverable.
cc: @gentzkow @jc-cisneros @snairdesai @Erick11293 @simonepandit.
Follow up: We added our workflow in lab-manual/wiki. The final state of mirror option is mirror-repo-workflow.pdf.
The purpose of this issue (#84) is to address a request from @gentzkow following ongoing discussions around our approach to compiling
.tex
and.lyx
documents in thetemplate
structure. Currently, we build the~/paper_slides
module using theLyX
document processor and a localTeX
interpreter, by converting.lyx
files to.pdf
files.The
LyX
program is now infrequently updated and has presented frequent roadblocks as othertemplate
dependencies have evolved. To address, this, @jc-cisneros and I will investigate the possibility of substituting fromLyX
toOverleaf
for our standard paper development process. Ideally, this would include the ability to split our Overleaf workflow with pull requests and development branches.