murattasdemir / create_project

This is a python script for building a directory structure and a "hello world" make'able version of a LaTeX paper.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

create_project

This script creates a reasonable directory structure and set of "stub" files for a new academic paper/project: it automatically creates:

  1. An R script that generates an image file
  2. A LaTeX and bibTeX file, with the LaTeX file including the PDF generated by the R script as a figure
  3. A Makefile that can compile the LaTeX/Bibtex into a PDF
  4. A bash script that can extract important information from the LaTeX file and create a markdown summarization of the file

What is this good for?

It helps you use the same file structure for all your projects and prevents you from having to writer a lot of boilerplate and file renaming to get a new project working.

To install

To set it up, download the package and symlink the create_project.py to /usr/local/bin e.g.,

git clone git@github.com:johnjosephhorton/create_project.git
cd create_project

Next, modify the settings.py with your name, school, preferred directory structure and so on. For example, my settings.py is:

author = "John J. Horton" 
school = "NYU Stern" 
footnote = """Author contact information, datasets and code are currently or will be available at \\href{http://www.john-joseph-horton.com/}{http://www.john-joseph-horton.com/}."""
bibliography_style = "aer" 

Once you have modified settings.py, run:

sudo python setup.py install 

Once you save your changes, you can simply run:

create_project PROJECTNAME 

The script will create a new directory PROJECTNAME with associated sub-directories. The script will also populate these folders with "stub" files, depending upon the files specified in the function created_stub_files and the templates in the ./templates folder. In this default configuration, the stub files created are a latex file, a bibtex file and a Makefile, all in the ./writeup folder.

Runnning make to build your PDF

create_project creates a simple R file that generates a PDF of a histogram, which it places in writeup/plots. By default, writeup/Makefile is set to have this histogram PDF as a dependency for the PROJECT_NAME.pdf and so running make from the writeup directory will cause R to run. The packages R will need are:

ggplot2 
testthat 
scales 

Getting a summary of your document

From the ./writeup directory, you can execute make summary.md which will generate a markdown file showing lists of important claims from the LaTeX document (those you have wrapped like so \important{Important claim}). It also does the same for lines wrapped in \quantclaim, which is a quantitative claim (I am always checking to see if these claims match the tables and figures and this simplifies the checking). Note that these tools require you to use one sentence per line in your LaTeX document. This summarization is done using a bash script called summary.sh in the writeup folder.

License

See the licence file.

About

This is a python script for building a directory structure and a "hello world" make'able version of a LaTeX paper.

License:GNU General Public License v2.0


Languages

Language:Python 80.3%Language:TeX 10.8%Language:Shell 6.0%Language:R 2.9%