├── extra ├── .keep ├── submissions │ └── .keep ├── workflow.png └── references │ └── library.bib ├── output ├── .keep ├── figures │ └── .keep └── tables │ └── .keep ├── products ├── paper │ ├── sub │ │ ├── conclusion.tex │ │ ├── section.tex │ │ ├── introduction.tex │ │ └── appendix.tex │ └── main_paper.tex ├── sub │ ├── .mystyle.sty.swp │ ├── mystyle_article.sty │ ├── mystyle_beamer.sty │ └── mystyle_general.sty ├── talk │ └── main_beamer.tex └── preliminary_results │ └── preliminary_results.tex ├── .gitignore ├── code ├── sub │ ├── build_merge.do │ ├── build_datasets.do │ ├── analysis_tables.do │ ├── analysis_figures.do │ ├── analysis_regressions.do │ └── build_covariates.do ├── get_input.py ├── analysis.do └── build.do ├── CITATION.cff ├── setup.sh ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── new_feature.md ├── run_paper.py └── README.md /extra/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /output/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /extra/submissions/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /output/figures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /output/tables/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /products/paper/sub/conclusion.tex: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /products/paper/sub/section.tex: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /products/paper/sub/introduction.tex: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /extra/workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdahis/paper_template/HEAD/extra/workflow.png -------------------------------------------------------------------------------- /products/sub/.mystyle.sty.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdahis/paper_template/HEAD/products/sub/.mystyle.sty.swp -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | input 4 | input/ 5 | output/data 6 | output/data/ 7 | output/logs 8 | output/logs/ 9 | tmp 10 | tmp/ -------------------------------------------------------------------------------- /extra/references/library.bib: -------------------------------------------------------------------------------- 1 | 2 | @unpublished{Gentzkow2014b, 3 | author = {Gentzkow, Matthew and Shapiro, Jesse M.}, 4 | title = {{Code and Data for the Social Sciences: A Practitioner's Guide}}, 5 | year = {2014} 6 | } 7 | -------------------------------------------------------------------------------- /code/sub/build_merge.do: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------// 2 | // 3 | // paper: 4 | // 5 | // do.file: build_merge 6 | // 7 | // author(s): 8 | // 9 | //----------------------------------------------------------------------------// 10 | -------------------------------------------------------------------------------- /code/sub/build_datasets.do: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------// 2 | // 3 | // paper: 4 | // 5 | // do.file: build_datasets 6 | // 7 | // author(s): 8 | // 9 | //----------------------------------------------------------------------------// 10 | -------------------------------------------------------------------------------- /code/sub/analysis_tables.do: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------// 2 | // 3 | // project: 4 | // 5 | // do.file: analysis_tables 6 | // 7 | // author(s): 8 | // 9 | //----------------------------------------------------------------------------// 10 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: "If you use this software, please cite it as below." 3 | authors: 4 | - family-names: "Dahis" 5 | given-names: "Ricardo" 6 | title: "Template Repository for Research Papers" 7 | date-released: 2021-11-10 8 | url: "https://github.com/rdahis/paper_template" 9 | -------------------------------------------------------------------------------- /code/sub/analysis_figures.do: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------// 2 | // 3 | // project: 4 | // 5 | // do.file: analysis_figures 6 | // 7 | // author(s): 8 | // 9 | //----------------------------------------------------------------------------// 10 | -------------------------------------------------------------------------------- /code/sub/analysis_regressions.do: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------// 2 | // 3 | // project: 4 | // 5 | // do.file: analysis_regressions 6 | // 7 | // author(s): 8 | // 9 | //----------------------------------------------------------------------------// 10 | 11 | -------------------------------------------------------------------------------- /code/sub/build_covariates.do: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------// 2 | // 3 | // project: 4 | // 5 | // do.file: build_covariates 6 | // 7 | // author(s): 8 | // 9 | //----------------------------------------------------------------------------// 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | NON_VERSIONED_PATH="" 4 | REPO_PATH="" 5 | 6 | ln -shF "${NON_VERSIONED_PATH}/input" "${REPO_PATH}/input" 7 | ln -shF "${NON_VERSIONED_PATH}/output/data" "${REPO_PATH}/output/data" 8 | ln -shF "${NON_VERSIONED_PATH}/output/logs" "${REPO_PATH}/output/logs" 9 | ln -shF "${NON_VERSIONED_PATH}/tmp" "${REPO_PATH}/tmp" 10 | -------------------------------------------------------------------------------- /products/talk/main_beamer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{beamer} 2 | 3 | % Packages and Formatting 4 | \usepackage{../sub/mystyle_general} 5 | \usepackage{../sub/mystyle_beamer} 6 | 7 | 8 | \title{Hello World!} 9 | \author{} 10 | \date{} 11 | %\affil{} 12 | 13 | 14 | \begin{document} 15 | 16 | \maketitle 17 | 18 | 19 | \begin{frame}{Frame Title} 20 | 21 | \end{frame} 22 | 23 | 24 | 25 | \end{document} -------------------------------------------------------------------------------- /products/sub/mystyle_article.sty: -------------------------------------------------------------------------------- 1 | 2 | \ProvidesPackage{mystyle_article} 3 | 4 | % Formatting 5 | \usepackage{setspace} 6 | \onehalfspacing 7 | 8 | % Font 9 | \usepackage{palatino} % many other options (eg. tgbonum, times, bookman, lmodern, etc) 10 | 11 | % Margins 12 | \usepackage{fullpage} 13 | 14 | % Math for article 15 | \newtheorem{definition}{Definition} 16 | \newtheorem{solution}{Solution} 17 | \newtheorem{theorem}{Theorem} -------------------------------------------------------------------------------- /products/paper/sub/appendix.tex: -------------------------------------------------------------------------------- 1 | 2 | % FIGURES 3 | \subsection{Figures} 4 | 5 | \begin{figure}[H] 6 | \caption{} 7 | \centering 8 | %\includegraphics[scale=1]{../../output/} 9 | \label{fig:} 10 | \end{figure} 11 | 12 | 13 | % TABLES 14 | \newpage 15 | \subsection{Tables} 16 | 17 | \begin{table}[H] 18 | \caption{} 19 | \centering 20 | \begin{threeparttable} 21 | %\input{../../output/} 22 | \end{threeparttable} 23 | \label{tab:} 24 | \end{table} 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Found an error in the repository? 4 | title: '' 5 | labels: bug 6 | assignees: 7 | --- 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To reproduce it** 13 | Steps to reproduce the behavior: 14 | 1. Go to '...' 15 | 2. Click on '....' 16 | 3. Scroll down to '....' 17 | 4. See error 18 | 19 | **Expected behavior** 20 | A clear and concise description of what you expected to happen. 21 | 22 | **Screenshots** 23 | If applicable, add screenshots to help explain your problem. 24 | 25 | **Additional context** 26 | Add any other context about the problem here. 27 | -------------------------------------------------------------------------------- /code/get_input.py: -------------------------------------------------------------------------------- 1 | 2 | from subprocess import call 3 | import platform 4 | import shutil, os 5 | 6 | system = platform.system() 7 | 8 | person = '' # use the person variable to keep paths in order with multiple machines being used 9 | 10 | if person == '': 11 | path = '/path/to/main_paper' 12 | dataSources = ['/path/to/data_sources/data_set_1', 13 | '/path/to/data_sources/data_set_2'] # list of data sets used as input to paper 14 | 15 | if system == 'Windows': 16 | pass 17 | 18 | else: 19 | # Clears Input 20 | folder = '/input' 21 | shutil.rmtree(path+folder) 22 | os.mkdir(path+folder) 23 | 24 | # Copies Data 25 | for file in dataSources: 26 | call(['cp', file, path+'/input']) 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new_feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: New feature 3 | about: How can the project be improved? 4 | title: '' 5 | labels: enhancement 6 | assignees: 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always confused when [...] 11 | 12 | **Describe the solution you would like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /products/preliminary_results/preliminary_results.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt,a4paper]{article} 2 | 3 | % Packages and Formatting 4 | \usepackage{../sub/mystyle_general} 5 | \usepackage{../sub/mystyle_article} 6 | 7 | 8 | \title{Preliminary Results} 9 | \author{} 10 | \date{} 11 | %\affil{} 12 | 13 | \begin{document} 14 | 15 | \maketitle 16 | 17 | 18 | 19 | 20 | \newpage 21 | \section{Figures} 22 | 23 | \begin{figure}[h] 24 | \caption{} 25 | \centering 26 | %\includegraphics[scale=0.5]{../../output/.png} 27 | \end{figure} 28 | 29 | 30 | 31 | \newpage 32 | \section{Tables} 33 | 34 | \begin{table}[h] 35 | \caption{} 36 | \centering 37 | %\input{../../output/.tex} 38 | %\label{tab:} 39 | \end{table} 40 | 41 | 42 | 43 | 44 | \end{document} 45 | 46 | -------------------------------------------------------------------------------- /products/sub/mystyle_beamer.sty: -------------------------------------------------------------------------------- 1 | 2 | \ProvidesPackage{mystyle_beamer} 3 | 4 | \usepackage{transparent} 5 | \setbeamercovered{transparent} 6 | 7 | % define wideitemize. 8 | \newenvironment{wideitemize}{\itemize\addtolength{\itemsep}{10pt}}{\enditemize} 9 | 10 | % themes 11 | \usetheme{default} % many options of themes, check others 12 | \usecolortheme{orchid} 13 | \usefonttheme{professionalfonts} 14 | \setbeamercolor{title}{fg=green!50!black} 15 | \setbeamercolor{subtitle}{fg=green!50!black} 16 | \setbeamercolor{frametitle}{fg=green!50!black} 17 | \setbeamercolor{caption name}{fg=green!50!black} 18 | \setbeamercolor{itemize item}{fg=green!50!black} 19 | \setbeamercolor{itemize subitem}{fg=green!50!black} 20 | \setbeamercolor{itemize subsubitem}{fg=green!50!black} 21 | \setbeamercolor{enumerate item}{fg=green!50!black} 22 | \setbeamercolor{enumerate subitem}{fg=green!50!black} 23 | \setbeamercolor{enumerate subsubitem}{fg=green!50!black} 24 | 25 | -------------------------------------------------------------------------------- /products/sub/mystyle_general.sty: -------------------------------------------------------------------------------- 1 | 2 | \ProvidesPackage{mystyle_general} 3 | 4 | % Input 5 | \usepackage[english, american]{babel} 6 | 7 | % References 8 | \usepackage{natbib} 9 | 10 | \usepackage{ebgaramond} 11 | \usepackage[T1]{fontenc} 12 | 13 | % Tables and Figures 14 | \usepackage{float} 15 | \usepackage{subcaption} 16 | \usepackage{booktabs} 17 | \usepackage{threeparttable} 18 | \usepackage{graphicx} 19 | \usepackage{tikz} 20 | \usetikzlibrary{snakes} 21 | 22 | % Math 23 | \usepackage{mathtools, amsthm, amsfonts} 24 | \theoremstyle{definition} 25 | \newtheorem{proposition}{Proposition} 26 | \newtheorem{remark}{Remark} 27 | \def\argmin{\operatorname*{arg\,min}} 28 | \def\argmax{\operatorname*{arg\,max}} 29 | \def\b{\mathbf} 30 | \def\bs{\boldsymbol} 31 | \def\bb{\mathbb} 32 | \def\cal{\mathcal} 33 | \newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}} 34 | \def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}} 35 | 36 | 37 | -------------------------------------------------------------------------------- /products/paper/main_paper.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt, a4paper]{article} 2 | 3 | % Packages and Formatting 4 | \usepackage{../sub/mystyle_general} 5 | \usepackage{../sub/mystyle_article} 6 | 7 | 8 | \title{Hello World!} 9 | \author{} 10 | \date{} 11 | %\affil{} 12 | 13 | 14 | \begin{document} 15 | 16 | % Title Page 17 | \begin{titlepage} 18 | \clearpage\maketitle 19 | \thispagestyle{empty} 20 | \begin{abstract} 21 | \end{abstract} 22 | \end{titlepage} 23 | 24 | % Introduction 25 | \section{Introduction} \label{sec:introduction} 26 | \input{./sub/introduction.tex} 27 | % Section 28 | \section{Section} \label{sec:} 29 | \input{./sub/section.tex} 30 | % Conclusion 31 | \section{Conclusion} \label{sec:conclusion} 32 | \input{./sub/conclusion.tex} 33 | % References 34 | \newpage 35 | \bibliographystyle{apa} 36 | \bibliography{} 37 | % Appendix 38 | \newpage 39 | \appendix 40 | \section{Appendix} \label{sec:appendix} 41 | \input{./sub/appendix.tex} 42 | 43 | \end{document} -------------------------------------------------------------------------------- /run_paper.py: -------------------------------------------------------------------------------- 1 | 2 | from subprocess import call 3 | import platform 4 | 5 | system = platform.system() 6 | 7 | person = '' # use the person variable to keep paths in order with multiple machines being used 8 | 9 | if person == '': 10 | path = '/path/to/main_paper' 11 | 12 | if system == 'Windows': 13 | pass 14 | 15 | else: 16 | print "Cleans Output and Temporary" 17 | for folder in ['/output', '/tmp']: 18 | shutil.rmtree(path+folder) 19 | os.mkdir(path+folder) 20 | 21 | print "//-- Gets Input --//" 22 | call(['python', path+'/code/get_input.py']) 23 | 24 | print "//-- Runs Build --//" 25 | call(['stata', '-b', 'do' + '\"' + path+'/code/build.do'+'\" &']) 26 | for file in glob.glob(path+'/*.log'): 27 | os.remove(file) 28 | 29 | print "//-- Runs Analysis --//" 30 | call(['stata', '-b', 'do' + '\"' + path+'/code/analysis.do'+'\" &']) 31 | for file in glob.glob(path+'/*.log'): 32 | os.remove(file) 33 | 34 | print "//-- Compiles TeX --//" 35 | call(['latexmk', path+'/products/paper/main_article.tex') 36 | 37 | print "Congratulations, you have a shiny new paper!" 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /code/analysis.do: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------// 2 | // 3 | // project: 4 | // 5 | // do.file: analysis 6 | // 7 | // author(s): 8 | // 9 | //----------------------------------------------------------------------------// 10 | 11 | 12 | //----------------------------------------------------------------------------// 13 | // preface 14 | //----------------------------------------------------------------------------// 15 | 16 | clear all 17 | clear programs 18 | set more off 19 | set varabbrev off 20 | cap log close 21 | 22 | if "c(username)" == "ricardodahis" global path /path/to/main_paper // c(username) is your computer's username 23 | 24 | cd "$path" 25 | 26 | log using "output/analysis.log", replace 27 | 28 | use "output/data/data.dta", clear 29 | 30 | 31 | //----------------------------------------------------------------------------// 32 | // main 33 | //----------------------------------------------------------------------------// 34 | 35 | // tables 36 | do "code/sub/analysis_tables.do" 37 | 38 | // figures 39 | do "code/sub/analysis_figures.do" 40 | 41 | // regressions 42 | do "code/sub/analysis_regressions.do" 43 | 44 | log close 45 | -------------------------------------------------------------------------------- /code/build.do: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------// 2 | // 3 | // project: 4 | // 5 | // do.file: build 6 | // 7 | // author(s): 8 | // 9 | //----------------------------------------------------------------------------// 10 | 11 | 12 | //----------------------------------------------------------------------------// 13 | // preface 14 | //----------------------------------------------------------------------------// 15 | 16 | clear all 17 | clear programs 18 | set more off 19 | set varabbrev off 20 | cap log close 21 | 22 | if "c(username)" == "ricardodahis" global path /path/to/main_paper // c(username) is your computer's username 23 | 24 | cd "$path" 25 | 26 | log using "output/build.log", replace 27 | 28 | 29 | //----------------------------------------------------------------------------// 30 | // main 31 | //----------------------------------------------------------------------------// 32 | 33 | // build 34 | do "code/sub/build_datasets.do" 35 | 36 | // merge 37 | do "code/sub/build_merge.do" 38 | 39 | // covariates 40 | do "code/sub/build_covariates.do" 41 | 42 | // compress and Save 43 | compress 44 | save "output/data/data.dta", replace 45 | 46 | log close 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | This folder provides an all-encompassing working structure for empirical papers. 3 | 4 | It organizes every step of the process: merging and cleaning (several) data sets, performing analyses (tables, figures, regressions), writing the paper and talks themselves, and submitting it to journals. 5 | 6 | **To use it**: follow the setup instructions below. 7 | 8 | ## Summary 9 | 0. Workflow 10 | 1. Requirements 11 | 2. Setup 12 | 3. Folders 13 | 4. Files 14 | 5. Leveraging on Github Capabilities 15 | 6. Writing 16 | 7. Journal Submissions 17 | 8. Principles 18 | 9. Further Reading 19 | 20 | ## 0. Workflow 21 | 22 | ![](extra/workflow.png) 23 | 24 | ## 1. Requirements 25 | 26 | This workflow requires: 27 | - [Bash](https://www.gnu.org/software/bash/) [Free] 28 | - [Python](https://www.python.org) [Free] 29 | - [LaTeX](https://www.latex-project.org) [Free] 30 | 31 | Other great languages and softwares may also be used. 32 | - [R](https://www.r-project.org) [Free] 33 | - [Stata](https://www.stata.com) [Licensed] 34 | - [Matlab](https://www.mathworks.com/products/matlab) [Licensed] 35 | 36 | For now it is only adapted for OSX (Apple) environments. But feel free to adapt it to Windows (and please share it with me!). 37 | 38 | ## 2. Setup 39 | 40 | 1. Create or join a cloud folder (e.g. on Dropbox or Drive) where large non-versioned files will reside. 41 | 2. Clone this repository to a local folder *outside* the cloud folder. 42 | 3. Fill out the correct environment paths in `setup.sh`. 43 | 4. Run `sh setup.sh` to create symbolic links to all non-versioned folders. 44 | 45 | You're good to go. This repository is now ready for the standard workflow described below. 46 | 47 | ## 3. Folders 48 | 49 | ##### `/code` 50 | 51 | - Versioned folder containing code that builds data and performs analyses. 52 | - All output data should be redirected into `/output/data/`, with one data file per observation level. 53 | - All output logs should be redirected into `/output/logs/`. 54 | - Other output files should be redirected into `/output/tables/` or `/output/figures/`. 55 | - Keep all code clean and modularized. 56 | 57 | `/sub` 58 | - Holds modularized code to implement subroutines for build and analysis code. 59 | 60 | ##### `/input` 61 | 62 | - Symbolic link to non-versioned folder with input data. 63 | - Any original data source should be included here in clean and normalized form. 64 | - Only include cleaned files. Raw external files should be cleaned in each data source specific folder. 65 | - These data sets will then be manipulated and merged by the files in `/code`. 66 | 67 | ##### `/output` 68 | 69 | - Symbolic link to non-versioned folder with output data. 70 | - Holds built data sets in `/output/data/`, to be then used in analysis code. 71 | - Contains all analysis objects generated by files in `/code`. 72 | - Will then serve as source for the generation of `.tex` files inside `/products/`. 73 | 74 | ##### `/tmp` 75 | 76 | - Symbolic link to non-versioned folder with temporary files. 77 | - Contains any temporary file created during the manipulation of input data sets or the analysis routine. 78 | 79 | ##### `/extra` 80 | 81 | - Contains any extra file relevant to the paper. 82 | - Examples: grant materials, previous analyses, submissions. 83 | 84 | ##### `/products` 85 | 86 | - Versioned folder containing files for preliminary results, papers, talks, and others. 87 | 88 | `/sub` 89 | - Curated set of packages and shortcuts commonly used in Social Science papers and presentations. 90 | ## 4. Files 91 | 92 | ##### `run_paper.py` 93 | 94 | - Automates the whole paper construction. 95 | - Runs everything in a pre-specified order, from beginning (building data sets) to end (compiling `.tex` files). 96 | - Keeps clear what should be run when. 97 | - Also cleans `/output` and `/tmp` folders before running other code. 98 | 99 | ##### `/code/get_input.py` 100 | 101 | - Erases any file inside `/input` and copies any original data set from outside sources. 102 | - Ensures consistency across original data generation and data building for paper. 103 | 104 | ## 5. Leveraging on Github capabilities 105 | 106 | - Use issues as tasks. Track it all on a project board named "Tasks". 107 | - Add tags to tasks to track progress by area. Some template tags included: `build`, `analysis`, `writing`, `review`, `enhancement`, `bug`. 108 | - Name commits following [conventional notation](https://www.conventionalcommits.org). 109 | - Add forward-looking tags and milestones to plan and version work. 110 | - These help marking relevant releases, such as a minimum viable product (MVP), a paper submission, or a talk. 111 | - Use [semantic versioning](https://semver.org/) for naming, e.g. `v0.1`, `v1.0.2`. 112 | - Only modify files via pull requests. Use closing keywords to close issues. 113 | 114 | ## 6. Writing 115 | 116 | All writing should be done within the repository to preserve versioning and consistency. 117 | 118 | - Keep a set of continuously-updated slides reflecting the current state and vision of the project. 119 | - Sync this repository with online LaTeX editing tools, such as [Overleaf](https://www.overleaf.com/), for simultaneous editing and comments. 120 | - Follow these instructions to [integrate Overleaf with Dropbox](https://www.overleaf.com/learn/how-to/Dropbox_Synchronization). 121 | - Sync Overleaf project to a folder `/products/paper`. 122 | - **Important**: the project's "true" state stays in Github. Thus, things always have to be committed on Github after edits. 123 | - Keep all `.bib` references organized in `/extra/references/library.bib`. See principle about reference manager systems below. 124 | 125 | ## 7. Journal Submissions 126 | 127 | Use this folder and Github for working on reviewing drafts (e.g. after a Revise and Resubmit request). 128 | 129 | Flow: 130 | 1. Centralize all numbered comments in one document uploaded to `/extra/submissions/journal/comments.txt`. 131 | 2. Assign comments to issues with clear tasks described in text. Assign issues to people, add tags, add milestone for "journal resubmission", etc. Add issue numbers below each review comment so that it can be tracked 1:1. 132 | 3. Work on issues, add sentences/paragraphs together with commit messages describing changes made to code and writing. 133 | 4. As issues start to be closed via PRs, put together a 'release' text, which will feed into letter to the editor and referees. 134 | 5. When all is done, set a tag for the release and send it off for the journal. 135 | 136 | Use tags: `review`, `build`, `analysis`, `writing`, `negative replies`. 137 | 138 | ## 8. Principles 139 | 140 | - For each new project, start (i) a structured versioned folder, (ii) a task manager project, and (iii) a set of slides. 141 | 1. Copy this folder and use a version control system (e.g. [Git](https://git-scm.com/)). 142 | * Keep track of multiple authors' edits. 143 | * No more `report_final_v3.2b_ST_toDelete.tex`. 144 | * Use branching to work simultaneously on code. 145 | 2. Use Github's issues and projects as a task management system. (For other tools, see [ClickUp](https://clickup.com/), [2Do](https://www.2doapp.com/), [Asana](https://asana.com), [Trello](https://trello.com/), and [JIRA](https://www.atlassian.com/software/jira)). 146 | * Your email inbox is not a task manager. 147 | * Tasks should be actionable atoms. 148 | * Set priorities, assignments, due dates, etc. 149 | * Only one person should be ultimately responsible for each task. 150 | * Do regular reviews and cleaning. 151 | 3. Slides 152 | * Containing the current (summarized) version of the paper. 153 | * Update it continuously. It will discipline your work. 154 | - Keep two folders: `/papers`, and `/data`, as shown in the workflow. 155 | 1. Data. 156 | * Each folder within `/data` is a data set. 157 | * Use the same structure for cleaning these datasets (e.g. `/code`, `/input`, `/output`, `/tmp`) 158 | 2. Papers. 159 | * Each folder within `/papers` is paper. 160 | * Use `/main_paper/code/get_input.py` to copy original datasets. 161 | - Use a good text editor (I recommend [Visual Studio Code](https://code.visualstudio.com/), [Sublime Text](https://www.sublimetext.com/), [Notepad ++](https://notepad-plus-plus.org/), or [vim](http://www.vim.org/)). 162 | - Use a modern and flexible communication tool (see [Discord](https://discord.com/) or [Slack](https://slack.com)). 163 | - Use a good reference/citation manager (I recommend [Mendeley](https://www.mendeley.com)). Let Mendeley (1) watch a downloads folder, (2) automatically organize every paper into a separate maintained folder in the cloud (Dropbox, Google Drive, etc.), and (3) keep a .bib file with all formatted citations in a `/references` folder. Let each paper be named "Author - Year - Title" (so you can search for PDFs efficiently). If you have a tablet to read and annotate papers, sync your reader (I recommend [PDF Expert](https://pdfexpert.com/)) to this folder. This way, all your annotations will automatically remain synced with Mendeley. 164 | - Keep documentation lean and clean. 165 | - Keep this folder organized. Your future self thanks your present effort. 166 | 167 | ## 9. Further Reading 168 | 169 | - [Gentzkow & Shapiro (2014) Code and Data for the Social Sciences](https://web.stanford.edu/~gentzkow/research/CodeAndData.pdf) 170 | - [Julian Reif's Stata Coding Guide](https://reifjulian.github.io/guide) 171 | - [Michael Stepner's Coding Style Guide](https://github.com/michaelstepner/healthinequality-code/blob/master/code/readme.md) 172 | - [Gentzkow & Shapiro Lab's Paper Template](https://github.com/gslab-econ/template) 173 | - [Tutorial on how to combine Git and Dropbox](https://github.com/kbjarkefur/GitHubDropBox) 174 | - [Guidelines on how to name git commits](https://www.conventionalcommits.org) 175 | --------------------------------------------------------------------------------