-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Top level tags differ between XML/TeX flavors #508
Comments
The spaces added on these lines are unwanted side effects related to sile-typesetter#105. See also sile-typesetter#508 for discussion of whether top level tags should even be a thing in included files.
If, per my comment on #505, we didn't have to worry about guessing the markup flavor and could just assume it based on context, we could not require top level tags at all for the case of includes or other fragments: SILE.doTexlike = function (doc)
doc = "\\begin{document}" .. doc .. "\\end{document}"
SILE.process(SILE.inputs.TeXlike.docToTree(doc))
end Would become: SILE.doTexlike = function (doc)
SILE.process(SILE.inputs.TeXlike.docToTree(doc))
end And depending on the calling context the parsed tree would just make sense to matter what it started with. Basically it would be a tree appropriate to splice into the calling context. One of the issues with requiring a wrapping document tag is that it's not intuitive what extra space will come it. Really this should be fixed in #105, but as an example a TeX-like document for inclusion in another document will bring in leading and trailing space that would have been dropped had it been processed on it's own. See also 53807e6 for a case I had to work around this. |
XML flavour should allow arbitrary top-level tags, because SILE is fundamentally a typesetting system for arbitrary XML files. |
The spaces added on these lines are unwanted side effects related to sile-typesetter#105. See also sile-typesetter#508 for discussion of whether top level tags should even be a thing in included files.
Just a note that #1052 has significant examples and discussion about what use cases need this to be fixed. |
How about this for an idea:
|
Let's resurrect this old issue.
I have dabbled into supporting several XML schemas from the start of my using SILE (TEI dictionary subset, TEI critical apparatus subset, USX, USFX, to name a few) and it's pretty messy with the current XML inputter. Of course I can also replace that with my own inputter and address the above. Yet it feels the wrong way to go... |
I'm trying to sort out the mess I made with #465, #505 and also looking at #502 and one thing that's been bothering be for a while is....
<sile>
.\start{document}
.I don't see any reason these should be different. Am I missing some logic improved by this nomenclature?
If not I propose normalizing them over two stages.
The text was updated successfully, but these errors were encountered: