\tag is expected to be always flushed at right when equation is overflowed
See original GitHub issueBefore reporting a bug
- Check common issues.
- Check the bug is reproducible in the demo. If not, check KaTeX is up-to-date and installed correctly.
- Search for existing issues.
Describe the pool rendering:
For a long equation set to overflow-x: auto, the right-end \tag{} will overlap and scroll with the equation.
You can use Eqs. 7.85 and 7.86 as a test case (with a narrow window), available here.
// allow katex equations scrolling horizontally, without vertical scrollbar
.katex-display > .katex {
height: auto;
overflow: hidden;
overflow-x: auto;
}
Expected behavior:
The \tag will be flush right no matter the equation is scrollable or not.
I’m not familiar with CSS. I tried to play around
.katex-display>.katex>.katex-html>.tag {
position: absolute;
right: 0;
}
A feature of position mixturing absolute and static should be perfect. sticky doesn’t fit in current setting, it is a mixturing of relative and fixed as I understand.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
flalign, leqno and equations left aligned. Overlapping of ...
How can I have automatic and consistent spacing for tags exactly as if they were set to the default position (right)?. Right tags...
Read more >Equation numbering in Jupyter notebooks - Stack Overflow
\tag : the label appearing next to the equationcan be a number or letters ... Go to your Jupyter Notebook editor (I am...
Read more >Specificity - CSS: Cascading Style Sheets - MDN Web Docs
The specificity for a required input nested in an element with attribute id="myApp" is 1-2-1 , based on one ID, two pseudo-classes, ...
Read more >Clustering 4000 Stack Overflow tags with BigQuery k-means
BigQuery ML does a good job of hot-encoding strings, but it doesn't handle arrays as I wish it did (stay tuned). So I'm...
Read more >Auto align left equations in Office Word 2013? - Super User
You can define defaults like this in Equation Options. Insert an equation (it will be centered, by default) and place the cursor anywhere...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Any update/process on this?
I’ve been able to ‘fix’ (i.e. hack my way out of) this problem with the following CSS (closely inspired by @martinpflaum’s suggestion):
On small screens (i.e. anything less than
1280pxin this example), this will position the tag relatively to the equation, shifting it over by5remto give it some space. However, on larger screens, this leads to the tags being all out of sync, which looks frankly awful, so the second part of this just makes them absolutely positioned again in such cases (therightpositioning there is just personal preference for me). It’s not perfect, especially not on tablet screens, but it’s better than the overlap.Would it be appropriate to submit a PR for this, at least until someone comes up with something better? The default behavior at the moment is hardly ideal…