Starting from:

$30

Economics7103- Homework 1 Solved

The goal of this homework is to get you to install and integrate Anaconda, Overleaf, and GitHub. Please follow these initial installation instructions that you will need to complete all of the homework assignments: 1. Register for free accounts with GitHub and Overleaf as specified in the homework guidelines.

2.   Download Python via the Anaconda distribution and GitHub desktop as specified in the homeworkguidelines.

3.   Complete the GitHub “hello world” exercise: https://guides.github.com/activities/hello-world/

4.   Complete the Overleaf “hello world” exercise: https://www.overleaf.com/learn/latex/Questions/ How_to_create_a_very_basic_hello_world_document_using_LaTeX

5.   Explore the Spyder introduction videos: http://docs.spyder-ide.org/develop/current/first-steps-with-spyde html

6.   On Overleaf, link your account with GitHub.

Setting up your homework repository
 

For this homework, you will create a homework repository in which you will save all of your homework code and output to turn in to me. To do this, you will exactly replicate the files in the sample_code folder in the repository I shared with you. This exercise will help you to integrate all of these tools into one automated workflow that is reproducible and able to be shared. To do this, follow these steps (there are other, arguably better ways to do these things, but I am just sharing what I have found most convenient so far—next year these processes will be updated as I learn more!): Set up a repository using GitHub desktop.

1.   In GitHub desktop, create a new repository using File, New repository. Name it phdee-2021-XX where you replace XX with your own initials. You can create this anywhere on your local system that you would like. Check the box to initialize the repository with a readme. This will create a folder called phdee-2021-XX on your computer.

2.   In your repository, create a subfolder called homework1. Within that subfolder, create two subfolders: one for code called code and one for TeX output called tex. In each subfolder, I like to copy and paste a readme file to get it started. For an example of the repository setup, refer to the sample_code folder.

Now, copy my sample.py Python script from the phdee-2021-homework/sample_code/code folder, run it, and push the script and output to GitHub:

1.   Open up Spyder in Anaconda. Create a new Python script copying the sample code contained insample.py in the repository I shared with you.

2.   Edit the directory path outputpath so that they match the path to the subfolders you created.

1

3.   Save your .py script in your code subfolder.

4.   Run the .py code (and fix any errors if necessary). In your output folder, you should have two .texfiles and two .eps files.

5.   In GitHub desktop, commit these changes to the main branch. Then publish your repository to GitHub.

You now have saved a record of your code and your output to GitHub. Next, you will replicate the main.tex and Homework_sample.pdf file using Overleaf:

1.   From the Overleaf main page, click new project and use the option to import from GitHub. Youshould be able to import your homework repository phdee-2021-XX. Pull any changes from GitHub to Overleaf if necessary.

2.   In Overleaf, create a new .tex file and copy and paste the text from my phdee-homework/sample_code/tex/main.tex file in the sample_code/tex folder. Click the green button to compile it.

3.   You will notice some errors or warnings in the paper icon next to the compile button. One of the errors isthat you need to include a bibliography file to use with natbib. Create in your output folder a file called sampleref.bib and copy and paste the content from phdee-2021-homework/sample_code/output/sampleref.bib to create the file.

4.   Recompile your main file and fix any errors or warnings until you have an error-free pdf. In Overleaf, usethe menu button, click GitHub, and push your changes to your GitHub repository. This synchronizes your Overleaf with the GitHub repository.

5.   Finally, from Overleaf, download the .pdf file you have created, save it in your homework 1 folder, andpush this change to GitHub.

More products