-
Notifications
You must be signed in to change notification settings - Fork 103
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
use RTL to shift \llap content and fix \llap, \rlap extreme wrapping #2475
base: master
Are you sure you want to change the base?
Conversation
@xworld21 I am not sure the RTL trick doesn't stray a bit too far from its original CSS purpose. I have recently been playing around with the
This indeed works on all kinds of content, including tables and equations. I tried a simple TeX snippet: testing some \llap{llap} and \rlap{rlap} text here.
\bye and hand-crafted some HTML using <html>
<style>
.llap-container,
.rlap-container {
width: 0;
display: inline-block;
vertical-align: bottom;
}
.llap {
float: right;
}
.rlap {
float: left;
}
</style>
<body>
<p>testing some <span class="llap-container"><span class="llap">llap</span></span>
and <span class="rlap-container"><span class="rlap">rlap</span></span> text here.
</p>
</body>
</html> That said, I suspect the usual way of applying these macros will be really bad for accessible outcomes (especially screen readers), as the CSS trickery never carries to the accessibility tree. So I would also discourage basing any important new work on these macros... |
A related aside to my last comment: being able to deduce the context of |
That is infinitely better, thanks! I am wondering if we should just promote
The tests include a few legit cases about preserving alignment (and, well, I bumped into this with the raw beamer stuff) which should work fine with screen readers I think. I assume screen readers read floats in a sensible way. I'll check. As to using \llap for e.g. creating new symbols, yeah, the output won't make sense accessibility wise. |
Oh, I take that back. Vertical alignment changes with float, and if you add |
I am not sure I follow. Adding Maybe it wasn't obvious - I had added |
I... I did get two misaligned underlines before, but I can't reproduce it again! I guess I must have changed the inline block size accidentally (most likely with some debug border), and that would have the same effect on |
<xsl:with-param name="context" select="$innercontext"/> | ||
</xsl:apply-templates> | ||
</xsl:element> | ||
<xsl:variable name="content"> |
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.
Just proof of concept, this would have to be implemented for ltx:inline-block and ltx:p too (the other possible constructors from \hbox
).
Fix #2474 (?), unless you object to
\@ADDCLASS
here.Edit:
it's not enough ifNo, I was fooled by the mathtools test. The problem with mathtools is that the\llap
is used at the beginning of a line. That requires something different.ltx_llap
class is lost when replacingltx:text
withmpadded
, along with the inner wrapper. If you add the class manually, it works exactly as it should. Loss of classes is a separate bug.