Skip to content

Commit

Permalink
Add version 0.1.0 of the document
Browse files Browse the repository at this point in the history
  • Loading branch information
susam committed Feb 17, 2018
0 parents commit 53830ee
Show file tree
Hide file tree
Showing 7 changed files with 776 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.sw?
*.bkp
/out/
*.aux
*.log
*.out
*.toc
.DS_Store
50 changes: 50 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
output:
# Create output directory.
mkdir -p out

# Pre-process Markdown file to:
#
# - Wrap version in \date{}.
# - Expose embedded LaTeX code.
sed -e 's/^Version.*/\\date{&}/' \
-e 's/<!-- :: *\(.*\) -->/\1/g' \
-e 's/<!-- :: *\(.*\) -->/\1/g' \
README.md > out/gitpr.md

# Convert Markdown to LaTeX.
pandoc --template=meta/template.tex -o out/gitpr.tmp.tex out/gitpr.md

# Post-process LaTeX output to:
#
# - Reduce header levels.
# - Use original Creative Commons license logo.
# - Reduce size of Creative Commons license logo.
sed -e 's/\\section/\\title/' \
-e 's/\\subsection/\\section/' \
-e 's/\\subsubsection/\\subsection/' \
-e 's/\\begin{verbatim}/\\begin{minipage}{\\linewidth}&/' \
-e 's/\\end{verbatim}/&\\end{minipage}/' \
-e 's/ccby\.svg/ccby.png/' \
-e 's/\\includegraphics/&[scale=0.75]/' \
out/gitpr.tmp.tex > out/gitpr.tex

# Generate PDF.
pdflatex out/gitpr.tex
pdflatex out/gitpr.tex
mv gitpr.pdf out/

# Generate TXT.
sed -e '/<!--/d' \
-e '/SHIELD_/d' \
-e '/DOWNLOAD_/d' \
-e '/CC BY 4.0 Logo/d' \
-e 's/&copy;/(c)/' \
README.md > out/gitpr.txt

install-tools-mac:
brew cask install basictex
brew install pandoc

clean:
rm -rf out
rm -f *.aux *.log *.out *.toc
Loading

0 comments on commit 53830ee

Please sign in to comment.