A CLI tool to write scientific papers in Markdown.
Currently only designed to work on macOS, but should theoretically also work on Linux.
- Setup
- Writing
- PDF Generation
- Build Options
- Formatting Options
- Further Customisation
- Demo
- Reinstalling & Uninstalling
For those unfamiliar with the command line:
- Go to Applications
- Go to Utilities (inside Applications)
- Open Terminal.app (inside Utilities)
- Copy one of the below options and paste it into Terminal.
- With Homebrew:
brew install nico-bachner/md-paper/md-paper
- With
curl
:curl https://md-paper.nicob.dev/install.sh | sh
When installed, you can check which version you are on:
md-paper --version
Shorthand: -v
- Create a folder that will contain your project.
- Create your Markdown (
.md
) document inside that folder. - Check out the YAML Options section of this README for formatting options.
- Start writing
- Open a new terminal window.
- Create a folder for your project if you haven't already
and navigate into your project folder
mkdir FOLDER_NAME
Don't forget to replacecd FOLDER_NAME
FOLDER_NAME
with the actual name of your project folder - Now you can generate your pdf:
md-paper
This is the base command for pdf generation:
md-paper
This base command can be extended by adding one or more of the following arguments:
--log
: basic logs--aux
: auxiliary files (essentially logs for each small part of your document, e.g. table of contents)
For example, the following would keep all the logs generated while building the pdf, as well as the .
md-paper --log --aux
If you just want to generate a LaTeX file, for example when sending your paper off to a publication, you can use
md-paper tex
If you have a custom LaTeX file, you can process that and get back a PDF by using
md-paper pdf
There are quite a few options for customisation, so not all will be listed here.
Customisation can be done in a YAML (YAML Ain't Markup Language) header which is an extra section above the content of your document:
---
YAML HEADER # formatting
---
MARKDOWN # content
- For articles and short reports:
document-type: article
- For longer reports:
document-type: report
These are essential parts of any standalone document:
title: "YOUR DOCUMENT TITLE"
authors:
- "YOUR NAME"
- "CO-PUBLISHER'S NAME"
date: \today # or write out a specific date in parentheses
LaTeX defines margins that are quite generous by default. If you should want to customise the margins, you can override the default as follows:
margins:
top: 3cm
bottom: 1in
left: 20pt
right: 3em
Adjust values as needed.
For specialised functionality, external packages may need to be imported:
packages:
- package1
- package2
If your TeX distribution doesn't include the full CTAN archive, non-standard packages will have to be downloaded individually before building:
md-paper install PACKAGE_NAME # shorthand: `i`
For all those with basic TeX knowledge, it is really easy to customise the build output even further than just through the YAML header. All the YAML options are derived from the template.tex
file, located wherever you installed md-paper to, so feel free to check that out for the full customisation options)
WARNING:
All of your changes to template.tex
will be erased once you update md-paper, so edit the file at your own risk. (unless of course you save your file and replace the one installed on update)
However, this is good enough for a quick fix if you can't wait long enough the Github issue to be addressed.
---
document-type: article
title-page: true
paper-size: a4
margins:
top: 3cm
bottom: 2cm
left: 2cm
right: 2cm
font:
general: lmodern # kpfonts / fourier / tgtermes / dejavu / libertine
math: euler
size: 12pt # 10pt / 11pt / 12pt
height: double # "onehalf" / "double"
header:
center: My Awesome Paper
footer:
center: Page \thepage
table-of-contents:
list-of-figures: yes
bibliography:
file: 'bibliography' # file 'bibliography.bib'
style: unsrturl
image-sources:
- ./images/
- ./graphs/
packages:
- hyperref
- xcolor
title: |
**Paper Title** \
*Funky Subtitle*
authors:
- Me
- Myself
- I
date: |
\today # why over-complicate life?
other: | # create custom TeX commands in this field if necessary
---
# Introduction
*Hello, World!*
- Reinstalling
md-paper reinstall # shorthand: `r`
- Uninstalling
md-paper uninstall # shorthand: `u`