Open 128Mac opened 7 months ago
The main difference is that includeonly
is something that is already provided by LaTeX. So it is possible to manually specify include only this and that section. We simply make use of this mechanism by injecting this directive you otherwise would have to manually insert.
Therefore, while it might be possible to implement something like this also for input
, we don't have help from LaTeX and would have to do this on our own (use a custom conditional, modify the tex code or specifying a hook which returns an empty file for the other input
s (only with LuaLaTex) might be some ideas on that) -> more work.
I've been thinking about this again these days and there might be a way to implement this somehow. There are two caveats though.
main.tex
wouldn't be ignored). -> I still need to investigate how this plays out with nested \input
sOk it didn't work out as expected. I was trying to use the "new" hooking mechanism of latex for this. But simply placing a \if ...
in before
and \fi
in \after
didn't work out.
Another approach would be redefining \input
(\let\myInput\input \renewcomand\input[1]{\myInput{#1}}
) so that it can check if the provided filename shall be inputted.
But then this approach is predestined to break in the future or if some other package fiddles with the \input
directive. Thus, I'm not sure if it's wise to include this to cluttex
.
Is it possible to add an option similar to --includeonly called --inputonly?
cluttex supports \include with the "-includeonly" option, but this primitive(?) has the side effect of page breaks. To avoid this, I started to use 'source' instead of '\input'. At the same time, I am beginning to wish there was a similar option called "--iinputonly" as like as "--includeonly".
If possible, please consider it.