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

How to handle "sub-files"? #131

Open
sylvainhalle opened this issue Jun 19, 2020 · 4 comments
Open

How to handle "sub-files"? #131

sylvainhalle opened this issue Jun 19, 2020 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@sylvainhalle
Copy link
Owner

I've received multiple comments regarding the handling of (let's state it in this general way): "files included within a main document".

There are currently three distinct issues related to this notion: #81, #115, #129.

I chose to close these issues and redirect them here, so that we may have a broader discussion. First, let me thank you for bringing these issues; you made me discover ways of using LaTeX that I didn't know about. (I am a relatively basic LaTeX user, as it turns out.)

I made a few offhand remarks regarding my fear of doing #56 on this, so I'd like to know if we can converge on something. Basically:

  1. Would we be better of by having a separate script that extracts files to be analyzed by TeXtidote, rather than implementing this within TeXtidote itself?
  2. If not, given the broad variety of ways to include such "sub-files", should we agree on one specific way of doing so?

I won't hide my colors, and I think solution 1 would be closest to my (Unix) philosophy of "do only one thing, but do it right".

The mike is yours!

@shankari
Copy link

@sylvainhalle I also agree that a separate script is the right way to go. If the script would have a standard interface, it would make it easy to contribute new versions as people want to use them.

@samuelstjean
Copy link

There's already a few things left and right that do flatten the structure for you, perfect for submitting a single file instead of painfully uploading tons of stuff. For example this one is even bundled in texlive https://www.ctan.org/pkg/latexpand
Could be a starting point as it does not seem to do everything (but newer stuff since came out that can do it, didn't test them out yet though).

@sylvainhalle
Copy link
Owner Author

This thread on StackOverflow lists about half a dozen different ways of expanding sub-files in LaTeX, including latexpand. I think that in this light, it would not be wise to re-implement yet another one within TeXtidote --especially given that the inclusion mechanism turns out to be more complex than it looks.

So, here's my plan:

  • Leave the basic sub-file behavior as it is now
  • Add support for the !TEX root magic comment (Error with inputs and includes #81 (comment)) so that one can check sub-files individually
  • Add the --root file.tex command line option that does the same thing
  • In the Readme, refer users to the tools mentioned in the SO thread if this behavior is not enough for them

This way, we shall have consistent behavior for commands that are in core LaTeX, and we don't favor one sub-file package over another (as we support none).

@shankari
Copy link

FYI, I tried latexpand on a paper and it worked fine for the latex source. It did have some issues with the bibtex file, but hopefully people are using bibliography managers and will not need too much proofreading of the bibliography.

I suspect that it might be hard to correlate errors generated by textidote on the combined file to the individual subfiles. But I will try it out and let you know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants