-
Notifications
You must be signed in to change notification settings - Fork 104
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 does not unbox the box #2458
Comments
This may have to do with latexml's still evolving model of how a But a thought that comes to mind is that if the box contents are in that property, we may want to upgrade the # in lib/LaTeXML/Core/Whatsit.pm
sub unlist {
my ($self) = @_;
if (my $box = $self->getProperty('content_box')) {
return $box->unlist; }
else {
return ($self); } } I am not quite confident that this is correct, so adding it as a comment for now. Edit: If this approach is deemed reasonable, I made PR #2459 for an easy resolution. Aside 1: latexml also stores the spread of a Aside 2: Interpreting beamer raw sounds a little bit too low-level @xworld21 . Are you starting a new beamer binding from scratch, or are you thinking of upgrading the |
I am not sure where I am going with this, yet. I thought I would read raw the TODO items of the existing binding, but I discovered that raw beamer is feasible (except it takes 30 seconds to load beamer! :( ). Also, I am strongly interested in visual accuracy over e.g. responsiveness, at least in the very short term. |
Studying the markup problem, I found an example: \documentclass{article}
\newbox\boxA\newbox\boxB\newbox\boxC\newbox\boxD\newbox\boxE
\begin{document}
\setbox\boxA=\vbox spread 1cm{1cm Box}
\setbox\boxB=\vbox spread 2cm{2cm Box}
\setbox\boxC=\vbox{\unvbox\boxA\unvbox\boxB}
\setbox\boxD=\copy\boxC
\setbox\boxE=\vbox{\unvbox\boxC\unvbox\boxD}
combined vbox: \fbox{\box\boxE}
\end{document} Which in the PDF simply has 4 lines (two pairs of two) on top of each other. <inline-block framed="rectangle" vattach="bottom">
<block vattach="bottom">
<p vattach="bottom">1cm Box</p>
<p vattach="bottom">2cm Box</p>
</block>
<block vattach="bottom">
<p vattach="bottom">1cm Box</p>
<p vattach="bottom">2cm Box</p>
</block>
</inline-block> Is the main request of this issue to reduce that to: <inline-block framed="rectangle" vattach="bottom">
<p vattach="bottom">1cm Box</p>
<p vattach="bottom">2cm Box</p>
<p vattach="bottom">1cm Box</p>
<p vattach="bottom">2cm Box</p>
</inline-block> If so, I can see how this could also be done as a |
Couldn't let it sit until after the bank holidays for obvious reasons.
The implementation of the
\un*box
commands is wrong atLaTeXML/lib/LaTeXML/Engine/TeX_Box.pool.ltxml
Lines 586 to 591 in 1301850
They should replace the boxes with their contexts, but
$stuff->unlist
is typically a one element list consisting of the<ltx:block>
wrapper. The difference is visible here:The XML output may look the same (LaTeXML won't save the height), but the
@vattach
attribute is the visible symptom that the box has not been unwrapped.A hasty workaround is to call
$whatsit->getArg(2)
instead of->unlist
, and to stick some kind of newline (\nointerlineskip
?). A proper solution should at least involve some error checking (TeX throws an error when the box types are mismatched, e.g.\mybox=\hbox{}\unvbox\mybox
) and some thinking about the type of newline required. I haven't checked the TeX book for the details.(Raw beamer uses a lot of
\unvbox
and it creates nested blocks like there's no tomorrow.->getArg(2)
flattens the output nicely which suggests I am generally right.)The text was updated successfully, but these errors were encountered: