{"id":162,"date":"2010-03-01T14:50:00","date_gmt":"2010-03-01T14:50:00","guid":{"rendered":"https:\/\/www.root42.de\/blog\/?p=162"},"modified":"2010-03-01T14:50:00","modified_gmt":"2010-03-01T14:50:00","slug":"recursive-makefile-for-latex","status":"publish","type":"post","link":"https:\/\/www.root42.de\/blog\/?p=162","title":{"rendered":"Recursive Makefile for LaTeX"},"content":{"rendered":"<p>I wanted to make a Makefile for a seminar report. This report contains all the sub-reports of the students. So the Makefile needs to recurse into subdirectories to compile all the contained LaTeX files there. So, given a file reports.tex which will include some PDFs in subdirectories 00\/ to 10\/, we get a Makefile that looks like this:<\/p>\n<pre><br \/>#####################################################<br \/># A small LaTeX Makefile<br \/>#####################################################<br \/><br \/>PREFIX=reports<br \/><br \/>CHAPTERS=00 01 02 03 04 05 06 07 08 09 10<br \/><br \/>all: subdirs $(PREFIX).pdf<br \/><br \/>#####################################################<br \/><br \/>.PHONY: subdirs simple<br \/><br \/>subdirs:<br \/>        @for i in $(CHAPTERS); do <br \/>              (cd $$i; $(MAKE)); done<br \/><br \/>#####################################################<br \/><br \/>$(PREFIX).aux:  $(PREFIX).tex<br \/>        pdflatex $(PREFIX).tex<br \/><br \/>$(PREFIX).pdf: $(PREFIX).aux<br \/>        pdflatex $(PREFIX).tex<br \/><br \/>#####################################################<br \/><br \/>simple:<br \/>        pdflatex $(PREFIX).tex<br \/><br \/>#####################################################<br \/><br \/>clean:<br \/>        @for i in $(CHAPTERS); do <br \/>              (cd $$i; $(MAKE) clean); done<br \/>        rm -f $(PREFIX).aux $(PREFIX).bbl $(PREFIX).blg<br \/>          $(PREFIX).idx $(PREFIX).log $(PREFIX).out $(PREFIX).tcp<br \/>          $(PREFIX).toc $(PREFIX).tps $(PREFIX).prf $(PREFIX).lbl<br \/>        rm -f $(PDFFILES) *.aux<br \/><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to make a Makefile for a seminar report. This report contains all the sub-reports of the students. So the Makefile needs to recurse into subdirectories to compile all the contained LaTeX files there. So, given a file reports.tex which will include some PDFs in subdirectories 00\/ to 10\/, we get a Makefile that &hellip; <a href=\"https:\/\/www.root42.de\/blog\/?p=162\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Recursive Makefile for LaTeX&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,34],"tags":[],"_links":{"self":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/162"}],"collection":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=162"}],"version-history":[{"count":0,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/162\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}