https://github.com/rrwen/cookiecutter-latex
Personal template for LaTeX documents with Python cookiecutter
https://github.com/rrwen/cookiecutter-latex
article aux cli command cookiecutter document interface latex line miktex pdf personal template tex texlive
Last synced: about 23 hours ago
JSON representation
Personal template for LaTeX documents with Python cookiecutter
- Host: GitHub
- URL: https://github.com/rrwen/cookiecutter-latex
- Owner: rrwen
- License: mit
- Created: 2017-11-10T06:01:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-16T03:27:11.000Z (about 6 years ago)
- Last Synced: 2025-03-30T10:33:39.260Z (about 1 month ago)
- Topics: article, aux, cli, command, cookiecutter, document, interface, latex, line, miktex, pdf, personal, template, tex, texlive
- Language: TeX
- Homepage:
- Size: 81.1 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cookiecutter-latex
Richard Wen
[email protected]Personal template for LaTeX documents with Python cookiecutter.
[](https://travis-ci.org/rrwen/cookiecutter-latex)
[](https://github.com/rrwen/cookiecutter-latex/blob/master/LICENSE)## Install
1. Install [Python](https://www.python.org/downloads/)
2. Install [cookiecutter](https://pypi.python.org/pypi/cookiecutter) via `pip`
3. Install [TeX Live](https://www.tug.org/texlive/acquire-netinstall.html) or [Miktex](https://miktex.org/download)```
pip install cookiecutter
```## Usage
1. Create the [LaTeX](https://www.latex-project.org/) template using [cookiecutter](https://pypi.python.org/pypi/cookiecutter)
2. Change the directory to the folder with the same name as the `template_name` input
3. Render a pdf of the main file named as the `tex_file` inputIn Windows:
```
cookiecutter gh:rrwen/cookiecutter-latex
cd
make
```In Linux/Mac:
```
cookiecutter gh:rrwen/cookiecutter-latex
cd
chmod +x make.sh
./make.sh
```See [Implementation](#implementation) for more details.
## Developer Notes
### Create Github Repository
1. Ensure [git](https://git-scm.com/) is installed
2. Change directory to the generated folder `cd `
3. Initialize the repository
4. Add the generated files to commit
5. Create an empty [Github repository](https://help.github.com/articles/create-a-repo/) with the same name as `template_name`
6. Pull any changes if the Github repository is not empty
7. Push the commit from `4.` to your created Github repository```
git init
git add .
git commit -a -m "Initial commit"
git remote add origin https://github.com//.git
git pull origin master --allow-unrelated-histories
git push -u origin master
```### Implementation
This code creates a latex template using [cookiecutter](https://pypi.python.org/pypi/cookiecutter).
* The main file is [cookiecutter.json](https://github.com/rrwen/cookiecutter-latex/blob/master/cookiecutter.json) which defines the inputs for the command line interface
* The inputs then replace any values surrounded with `{{}}` inside the folder [{{cookiecutter.template_name}}](https://github.com/rrwen/cookiecutter-latex/tree/master/%7B%7Bcookiecutter.template_name%7D%7D)```
cookiecutter <-- template tool
|
cookiecutter.json <-- template inputs
|
{{cookiecutter.template_name}} <-- generated template
```The following files will be created inside a folder with the same name as the `template_name` input:
File | Description
--- | ---
**LICENSE** | MIT [license file](https://help.github.com/articles/licensing-a-repository/) automatically created from github
**README.md** | a readme [Markdown](https://daringfireball.net/projects/markdown/) file with header section