Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

available create option '--inputonly' as like as '--includeonly' ? #18

Open
128Mac opened this issue Jan 21, 2024 · 3 comments
Open

available create option '--inputonly' as like as '--includeonly' ? #18

128Mac opened this issue Jan 21, 2024 · 3 comments

Comments

@128Mac
Copy link

128Mac commented Jan 21, 2024

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.

@atticus-sullivan
Copy link
Contributor

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 inputs (only with LuaLaTex) might be some ideas on that) -> more work.

@atticus-sullivan
Copy link
Contributor

I've been thinking about this again these days and there might be a way to implement this somehow.
There are two caveats though.

  • The approach would only allow to ignore all other includes (so content from the main.tex wouldn't be ignored). -> I still need to investigate how this plays out with nested \inputs
  • I'm not sure what tex(-live) version the approach needs. Might be a more recent one.

@atticus-sullivan
Copy link
Contributor

Ok 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 \fiin \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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants