use RTL to shift \llap content and fix \llap, \rlap extreme wrapping#2475
use RTL to shift \llap content and fix \llap, \rlap extreme wrapping#2475xworld21 wants to merge 1 commit intobrucemiller:masterfrom
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.
\byeand 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.
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
\@ADDCLASShere.Edit:
it's not enough ifNo, I was fooled by the mathtools test. The problem with mathtools is that the\llapis used at the beginning of a line. That requires something different.ltx_llapclass is lost when replacingltx:textwithmpadded, along with the inner wrapper. If you add the class manually, it works exactly as it should. Loss of classes is a separate bug.