update-footer := cat footer-head > footer; date >> footer; cat footer-tail >> footer
mypandoc      := pandoc


all: html pdf

html: WhatToDo.html\
      AboutWhatToDo.html\
      Report1.html\
      ArticleIdeas.html\
      Articles.html\
      NorthThamesGasBoard.html\
      NPL.html\
      MITB.html\
      Backpropagation.html\
      LunchAtKings.html\
      ClassReunion.html\
      Anxiety.html\
      Coinduction.html\
      Semantics.html\
      CambridgeUndergraduate.html\
      Mohan.html\

pdf: WhatToDo.pdf\
     AboutWhatToDo.pdf\
     Report1.pdf\
     ArticleIdeas.pdf\
     Articles.pdf\
     NorthThamesGasBoard.pdf\
     NPL.pdf\
     MITB.pdf\
     Backpropagation.pdf\
     LunchAtKings.pdf\
     ClassReunion.pdf\
     Anxiety.pdf\
     Coinduction.pdf\
     Semantics.pdf\
     CambridgeUndergraduate.pdf\
     Mohan.pdf\

WhatToDo.html: WhatToDo.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               -A footer\
               --toc\
               --mathjax\
               WhatToDo.txt\
               -o WhatToDo.html

WhatToDo.pdf: WhatToDo.txt
	$(mypandoc) -s -S\
               --toc\
               WhatToDo.txt\
               -o WhatToDo.pdf 

AboutWhatToDo.html: AboutWhatToDo.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               -A footer\
               --mathjax\
               AboutWhatToDo.txt\
               -o AboutWhatToDo.html

AboutWhatToDo.pdf: AboutWhatToDo.txt
	$(mypandoc) -s -S\
               AboutWhatToDo.txt\
               -o AboutWhatToDo.pdf

Report1.html: Report1.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               -A footer\
               --mathjax\
               Report1.txt\
               -o Report1.html

Report1.pdf: Report1.txt
	$(mypandoc) -s -S\
               Report1.txt\
               -o Report1.pdf

ArticleIdeas.html: ArticleIdeas.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               --mathjax\
               ArticleIdeas.txt\
               -o ArticleIdeas.html 

ArticleIdeas.pdf: ArticleIdeas.txt
	$(mypandoc) -s -S\
               ArticleIdeas.txt\
               -o ArticleIdeas.pdf 

Articles.html: Articles.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               --mathjax\
               Articles.txt\
               -o Articles.html 

Articles.pdf: Articles.txt
	$(mypandoc) -s -S\
               Articles.txt\
               -o Articles.pdf 

# Articles

NorthThamesGasBoard.html: NorthThamesGasBoard.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               -A footer\
               --toc\
               --mathjax\
               NorthThamesGasBoard.txt\
               -o NorthThamesGasBoard.html 

NorthThamesGasBoard.pdf: NorthThamesGasBoard.txt
	$(mypandoc) -s -S\
               --toc\
               NorthThamesGasBoard.txt\
               -o NorthThamesGasBoard.pdf 

NPL.html: NPL.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               -A footer\
               --toc\
               --mathjax\
               NPL.txt\
               -o NPL.html 

NPL.pdf: NPL.txt
	$(mypandoc) -s -S\
               --toc\
               NPL.txt\
               -o NPL.pdf 

MITB.html: MITB.txt
	$(update-footer)
	$(mypandoc) -s -S\
               --toc\
               -c mypandoc.css\
               -A footer\
               --mathjax\
               MITB.txt\
               -o MITB.html 

MITB.pdf: MITB.txt
	$(mypandoc) -s -S\
               -B toc.tex\
               MITB.txt\
               -o MITB.pdf

Backpropagation.html: Backpropagation.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               -A footer\
               --toc\
               --toc-depth=6\
               --mathjax\
               Backpropagation.txt\
               -o Backpropagation.html 

Backpropagation.pdf: Backpropagation.txt
	$(mypandoc) -s -S\
               -B toc.tex\
               --latex-engine=xelatex\
               Backpropagation.txt\
               -o Backpropagation.pdf

LunchAtKings.html: LunchAtKings.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c kingspandoc.css\
               -A footer\
               --toc\
               --toc-depth=6\
               --mathjax\
               LunchAtKings.txt\
               -o LunchAtKings.html 

LunchAtKings.pdf: LunchAtKings.txt
	$(mypandoc) -s -S\
               -B toc.tex\
               --latex-engine=xelatex\
               LunchAtKings.txt\
               -o LunchAtKings.pdf

ClassReunion.html: ClassReunion.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c kingspandoc.css\
               -A footer\
               --toc\
               --toc-depth=6\
               --mathjax\
               ClassReunion.txt\
               -o ClassReunion.html 

ClassReunion.pdf: ClassReunion.txt
	$(mypandoc) -s -S\
               -B toc.tex\
               --latex-engine=xelatex\
               ClassReunion.txt\
               -o ClassReunion.pdf

Anxiety.html: Anxiety.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               -A footer\
               --toc\
               --toc-depth=6\
               --mathjax\
               Anxiety.txt\
               -o Anxiety.html 

Anxiety.pdf: Anxiety.txt
	$(mypandoc) -s -S\
               -B toc.tex\
               --latex-engine=xelatex\
               Anxiety.txt\
               -o Anxiety.pdf

Coinduction.html: Coinduction.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               -A footer\
               --toc\
               --toc-depth=6\
               --mathjax\
               Coinduction.txt\
               -o Coinduction.html 

Coinduction.pdf: Coinduction.txt
	$(mypandoc) -s -S\
               -B toc.tex\
               --latex-engine=xelatex\
               Coinduction.txt\
               -o Coinduction.pdf

Semantics.html: Semantics.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               -A footer\
               --toc\
               --toc-depth=6\
               --mathjax\
               Semantics.txt\
               -o Semantics.html 

Semantics.pdf: Semantics.txt
	$(mypandoc) -s -S\
               -B toc.tex\
               --latex-engine=xelatex\
               Semantics.txt\
               -o Semantics.pdf

CambridgeUndergraduate.html: CambridgeUndergraduate.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               -A footer\
               --toc\
               --toc-depth=6\
               --mathjax\
               CambridgeUndergraduate.txt\
               -o CambridgeUndergraduate.html 

CambridgeUndergraduate.pdf: CambridgeUndergraduate.txt
	$(mypandoc) -s -S\
               -B toc.tex\
               --latex-engine=xelatex\
               CambridgeUndergraduate.txt\
               -o CambridgeUndergraduate.pdf

Mohan.html: Mohan.txt
	$(update-footer)
	$(mypandoc) -s -S\
               -c mypandoc.css\
               -A footer\
               --toc\
               --toc-depth=6\
               --mathjax\
               Mohan.txt\
               -o Mohan.html 

Mohan.pdf: Mohan.txt
	$(mypandoc) -s -S\
               -B toc.tex\
               --latex-engine=xelatex\
               Mohan.txt\
               -o Mohan.pdf

# Delete HTML and PDF files

clean:
	rm -f WhatToDo.html
	rm -f WhatToDo.pdf
	rm -f AboutWhatToDo.html
	rm -f Report1.html
	rm -f AboutWhatToDo.pdf
	rm -f ArticleIdeas.html
	rm -f ArticleIdeas.pdf
	rm -f Articles.html
	rm -f Articles.pdf
        # Articles
	rm -f NorthThamesGasBoard.html
	rm -f NorthThamesGasBoard.pdf
	rm -f NPL.html
	rm -f NPL.pdf
	rm -f MITB.html
	rm -f MITB.pdf
	rm -f Backpropagation.html
	rm -f Backpropagation.pdf
	rm -f LunchAtKings.html
	rm -f LunchAtKings.pdf
	rm -f ClassReunion.html
	rm -f ClassReunion.pdf
	rm -f Anxiety.html
	rm -f Anxiety.pdf
	rm -f Coinduction.html
	rm -f Coinduction.pdf
	rm -f Semantics.html
	rm -f Semantics.pdf
	rm -f CambridgeUndergraduate.html
	rm -f CambridgeUndergraduate.pdf
	rm -f Mohan.html
	rm -f Mohan.pdf
