oist / LaTeX-templates

Graduate School LaTeX templates for Lab rotation proposal + report, OIST beamer and Thesis + thesis proposal
MIT License
61 stars 56 forks source link

Using Subfiles Instead of Input #4

Open tadashiK opened 5 years ago

tadashiK commented 5 years ago

This is not an issue, but how about using subfiles package and subfile command rather than input command?

Currently, a whole thesis is compiled. However, for a long thesis (hopefully with sparkling scientific findings), compiling a whole thesis takes a bit of time. Therefore, when writing a thesis, it would be nice if each chapter or section can be compiled separately.

leios commented 5 years ago

Having a feature like this would be incredibly useful for workflow. I am sure a PR would be welcome!

tadashiK commented 5 years ago

OK. Let me try.

jiegillet commented 5 years ago

How different would it be from using \include{chapter.tex}? I think \include compiles files separately (I should check), and also lets users use \includeonly{chap1, chap2} in the header so that you only include a subset of your chapters. It's been on my TODO list forever to switch to that :)

tadashiK commented 5 years ago

From this, \include seems to separately compile files inserted by the command. However, to compile them (if necessary), you need to compile the main file. As a result, you need to go back and forth between a file you are working on and the main file; when you write, you go to the former, and when you compile to check results, you go to the latter.

When subfiles package is used, each file is treated as one main tex file. You can directly compile it and check results. I think using subfiles is a better choice.

jiegillet commented 5 years ago

Right, that sounds like a better choice to me, as long as it's simple to use.

Also in my TODO was this link which is something similar but only works for some editors I think, so not great.

If you want to give it a shot, please do!