Setting up and managing a LaTeX paper repository

You're planning on writing a paper. Neat! You'll need to set up a version controlled repository with git. Here is a set of guidelines to help you do that.

Start by creating a fresh private repository on GitHub and invite your collaborators to join it with write (push) permissions. Next, go to your journal / conference webpage and find their LaTeX style files (typically on an author instructions page). Once you've done that, try to mimic the following folder structure in your repository:

repository_name/
├── main.tex                         % your main tex file (this imports the sections below)
├── abstract.tex                     % your abstract
├── introduction.tex                 % your introduction section
├── background.tex                   % your background section
├── (other major section tex files)  % other sections in your paper
├── sources.bib                      % the bib file
├── venue_style.sty                  % the style file for your journal/conference
├── venue_class.cls                  % the class file for your journal/conference
├── venue_bib_style.bst              % the bibliography style file for your journal/conference
├── shortex.sty                      % shortex style file, from www.github.com/trevorcampbell/shortex
├── figures/                         % a folder for your figures
│   ├── your_figure.png
│   ├── your_other_figure.png
└──scripts/                          % a folder for simple scripts (no serious code here)
    ├── some_simple_code.py
    └── nothing_too_fancy.py

You should use the main LaTeX file provided by your venue, but try to fill it out in a manner similar to this one (I used the NeurIPS 2019 style file for this example). Note how each section is contained in its own .tex file: this prevents a lot of unnecessary merge conflicts when more than one person is working on the text together.

\documentclass{article}

% import your packages first

\PassOptionsToPackage{numbers, sort&compress}{natbib}
\usepackage[final]{neurips_2019}
\usepackage{shortex}

\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc}    % use 8-bit T1 fonts
\usepackage{hyperref}       % hyperlinks


% define any special commands you want just for this paper

\newcommand{\prox}[2]{\ensuremath{\operatorname{prox}_{#1}\left(#2\right)}}

\newdimen{\algindent}
\setlength\algindent{1.5em}
\makeatletter
\newcommand{\LineComment}[2][0]{\Statex \hspace{#1\algindent} \hskip\ALG@thistlm $\triangleright$ #2}
\makeatother


\newcommand{\distUnifSubset}{\distNamed{UnifSubset}}



\title{On Paper Writing}

\author{%
  Authorina Authorton\\
  Department of Authorship\\
  University of Authors\\
  Authorbrook, Authorzy\\
  \texttt{author@authors.edu} \\
\And
  Writer McWriterstein\\
  Department of Writing\\
  University of Written Things\\
  Writerville, Writergaria\\
  \texttt{writer@writtenthings.edu}
}

\begin{document}

\maketitle
\input{abstract}
\input{intro}
\input{background}
\input{writing_stuff}
\input{other_stuff}
\input{experiments}
\input{conclusion}

\input{acknowledgements}

\small
\bibliographystyle{unsrt}
\bibliography{sources}

\newpage
\appendix
\input{some_proofs}
\input{more_experiments}

\end{document}

Your section (and appendix section) files should look like the following. Note here that I provide two examples of a paragraph: one which is entered as a single, huge line with no linebreaks; and another with linebreaks to limit the width of the text. Please enter your text with frequent linebreaks; it makes version control work better and displays better in a wide range of editors.

\section{The Section}\label{sec:the_section}

This is a paragraph that is entered as one gigantic line. Depending on which text editor you use (I use vim), one long single line can render poorly. It is also a huge headache for proper version control, since version control does diffs on a per-line basis; if you make an edit to this paragraph, the entire paragraph will appear in the diff making it really hard to see where the changes were made.


In contrast, here is a nicely entered paragraph split over multiple lines.
LaTeX does not care about single newlines and will typeset this 
as a paragraph in your PDF. This is much easier to read for a wide range of editors.
It also works well with version control, since git does diffs on a per-line basis,
so only the edited lines get shown.
 Please enter your text with nice line breaks and do not write gigantic one-liners.

See my other post on creating a bibliography with BibTeX to see how to fill in the sources.bib file.