sisl / tufte_algorithms_book

A template for textbooks in the same style as Algorithms for Optimization
350 stars 66 forks source link

add CHAPTER option to makefile #14

Closed BeastyBlacksmith closed 4 years ago

BeastyBlacksmith commented 4 years ago

This allows to compile only selected chapters via

make compile CHAPTER='<what-comes-after-"include|input{chapter|appendix/">'

note, that / has to be escaped as \/. Multiple chapters are separated by space. Depends on vim to be installed. A makefile implementation of https://github.com/sisl/tufte_algorithms_book/issues/5#issuecomment-517837084.

tawheeler commented 4 years ago

Cool!

I ran make compile CHAPTER='appendix' and ended up with a bunch of stuff still included (title page, acknowledgements, etc.) Is it possible only compile the chapter we want?

Also, could you update the README file with this documentation.

johnnychen94 commented 4 years ago

Curiously asking, I'm wondering if there's specific reason not using sed here. (Not familiar with both / of vim and sed though.)

BeastyBlacksmith commented 4 years ago

it only comments stuff between \mainmatter and \backmatter. Could be changed to check between e.g. \begin{document} and \end{document}. I had sed before, but found that it is hard to predict which of the many flavors is available on different machines. And vim seems to be more consistent in that regard.

BeastyBlacksmith commented 4 years ago

Changed the replace range. Give it a try and then I can update the README.

tawheeler commented 4 years ago

Great! Thanks.