Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat template to fit .tex compile #86

Closed
3 tasks done
ShiqiYang2022 opened this issue Sep 7, 2023 · 2 comments · Fixed by #88
Closed
3 tasks done

Reformat template to fit .tex compile #86

ShiqiYang2022 opened this issue Sep 7, 2023 · 2 comments · Fixed by #88
Assignees

Comments

@ShiqiYang2022
Copy link
Collaborator

ShiqiYang2022 commented Sep 7, 2023

In this issue we will reformat the template to substitute from .lyX to .tex compile for our standard paper development process.

Goals of this issue:

  • Switch the .lyx formats in paper_slides/code to .tex formats
  • Move the Lyx version of paper_slides into extensions/lyx.
  • Compare .tex compile locally vs. Overleaf compile. Investigate on how to manage differences.

This issue is originated from #84 (comment) and is related to #85.

cc: @gentzkow @jc-cisneros @snairdesai

@ShiqiYang2022 ShiqiYang2022 self-assigned this Sep 7, 2023
ShiqiYang2022 added a commit that referenced this issue Sep 18, 2023
ShiqiYang2022 added a commit that referenced this issue Sep 18, 2023
ShiqiYang2022 added a commit that referenced this issue Oct 13, 2023
ShiqiYang2022 added a commit that referenced this issue Oct 14, 2023
ShiqiYang2022 added a commit that referenced this issue Oct 14, 2023
ShiqiYang2022 added a commit that referenced this issue Oct 14, 2023
ShiqiYang2022 added a commit that referenced this issue Oct 14, 2023
ShiqiYang2022 added a commit that referenced this issue Oct 14, 2023
ShiqiYang2022 added a commit that referenced this issue Oct 14, 2023
ShiqiYang2022 added a commit that referenced this issue Oct 14, 2023
ShiqiYang2022 added a commit that referenced this issue Oct 17, 2023
ShiqiYang2022 added a commit that referenced this issue Oct 17, 2023
@ShiqiYang2022 ShiqiYang2022 linked a pull request Oct 18, 2023 that will close this issue
4 tasks
@ShiqiYang2022
Copy link
Collaborator Author

@gentzkow

I have completed the tasks listed per #86 (comment) reformatting template to fit .tex compile. The draftable diff between the .tex compile and the original one is here.

There are two notes worth mentioning:

  1. gs.run_latex() need to be upgraded.

Currently run_latex doesn't handle the compilation of nested .tex structures when make.py and paper.tex reside in different directories. Here's why:

  • gs.run_latex() executes a shell command from the directory where make.py is located.
  • If paper.tex is in a different directory, any nested .tex files it refers to will have their paths interpreted relative to make.py, not paper.tex.
  • This mismatch in relative paths leads to a "file not found" error when the command tries to access nested .tex files.

To solve this, I updated gs.run_latex() and metadata in this commit in gslab-econ/gslab_make#64, and opened a pull request to merge into gslab_make/master.

  1. Difference between .tex compile locally vs. Overleaf compile can be properly managed.

Overleaf uses the latest version of TexLive to compile, and we can always shift to old TexLive versions. For details please refer to the official blog here. Fortunately our lab-manual also request using TexLive. So theoretically if we set the TexLive version in Overleaf consistent with our local end, we should not see difference between the outputs. The version control for lab member should not be a big issue.

The draftable diff using template between local and Overleaf compile is here, no difference found.

The only potential risk is some collaborators might use a different TeX distribution (e.g., MiKTeX). To trying avoid this, we can(and we should) use the packages that only are part of the standard TeX distribution and specify old package versions. This general idea is specified in Gentzkow and Shapiro(2014) so lab member should know that. For collaborators not familiar with our style of coding, even if they very unfortunately failed compile on local end, they always have plan B, i.e. do it on Overleaf; and this is way better than lyx -- if you fail to compile lyx, you do not have alternatives.


I am opening a PR(#88) of this issue, and once we merge both issue branches of template and gslab_make to master, the switch from lyx to .tex compile is finished. Please let me know for any of your thoughts. Thanks!

ShiqiYang2022 added a commit that referenced this issue Oct 23, 2023
ShiqiYang2022 added a commit that referenced this issue Oct 24, 2023
* #86 Add .lyx code + make.py to /extension

* #86 Try to push figure.tex file

* #86 Update paper_slides/code

* #86 Delete /paper_slides/output/table_filled.lyx

* #86 Using \input{} in paper.tex

* #86 Update paper.tex

* #86 Use correct executable name

* #86 Update paper_slides/make.py

* #86 Update new complies

* #86 Update paper_slides/code/table.tex

* #86 Move code to paper_slides

* #86 Path adjustments

* #86 Update compile and logs

* #86 Update compile + log

* #86 Update paper_slides/code
@ShiqiYang2022
Copy link
Collaborator Author

Summary

In this issue we reformat the template to substitute from .lyX to .tex compile for our standard paper development process. We discussed how to manage the difference in #86 (comment).

This thread continued in the associated PR (#88). The errors are addressed in #89, #90, gslab-econ/gslab_make#64, and gslab-econ/gslab_make#65 as follow-up issues and PRs.

Merged to master in c5f5695.
Final state of issue branch here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant