Created
October 17, 2015 17:54
-
-
Save dnguyen85/37405bf85183bd5d59db to your computer and use it in GitHub Desktop.
Markdown to baretex conversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.phony: all | |
# SRC is a list of all .md files | |
SRC=$(wildcard *.md) | |
# OBJ is a list of all files in $(SRC), but replacing extension | |
OBJ=$(SRC:.md=.tex) | |
# Convert a.md to a.tex | |
%.tex: %.md | |
scholdoc --natbib --no-standalone -o $@ $< | |
# Run tex conversion for each target in OBJ | |
all: $(OBJ) | |
# replace `\citep` (in natbib) with regular `\cite` | |
sed -i -e 's/\\citep/\\cite/g' $^ | |
# remove the last line | |
sed -i '/\\section{References}/d' $^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment