-
Notifications
You must be signed in to change notification settings - Fork 101
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
\unvbox and friends request a block unwrap #2459
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Three quick comments related to the originating issue:
- could there be any data in the wrapper box that gets lost in this way? in TeX, a box is merely a box, but is that true for LaTeXML?
\unvbox
and\unvcopy
must also switch to vertical mode, or it will cause other unintended side effects (per TeX book 'The vertical list inside that box is appended to the current vertical list, without changing it in any way')- the
\un.(copy|box)
commands should error out if the box is of the wrong horizontal/vertical type
@xworld21 I am not sure your questions apply to the level of emulation that is in latexml at present. Vertical mode has not been implemented in a "strict" sense, as matching the exact layout algorithm from TeX was never a main latexml goal. This could be contrasted to converters such as tex4ht and rustex, where the emulation follows TeX much more closely. All of this could evolve of course, but the PR here tries to minimally match the |
I meant to say it needs to introduce a newline or start a new paragraph. I applied your patch (or rather, a worse version I cooked up before your PR) and you get e.g. consecutive bits of text with no space between them. The I'll produce some examples to show the difference. |
I came up with this curious test, and indeed, the PR should add a vertical annotation of some kind to emulate it correctly: \documentclass{article}
\newbox\boxA
\newbox\boxB
\newbox\boxC
\newbox\boxD
\begin{document}
\setbox\boxA=\vbox spread 1cm{1cm Box}
\setbox\boxB=\vbox spread 2cm{2cm Box}
\setbox\boxC=\vbox spread 3cm{3cm Box}
\setbox\boxD=\vbox{\unvbox\boxA\unvbox\boxB\unvbox\boxC}
combined vbox: \fbox{\box\boxD}
\end{document} And actually, the master branch of latexml appears to create rather decent XML for it, as in: <p>combined vbox: <inline-block framed="rectangle" vattach="bottom">
<p vattach="bottom">1cm Box</p>
<p vattach="bottom">2cm Box</p>
<p vattach="bottom">3cm Box</p>
</inline-block></p> So I am also wondering if the lack of an unwrap isn't already handled reasonably enough... |
New approach ready for review. Studying a couple of examples more closely, I think the main issue is with having too much verbosity in the XML wrappers, especially as the Luckily, the So, I added a special property |
Fixes #2458 .