arXiv / html_feedback

Supports a student project developing a UI for feedback on arXiv articles rendered as html.
MIT License
18 stars 3 forks source link

Problems with the boxes presentation #424

Open semenyakinms opened 8 months ago

semenyakinms commented 8 months ago

Description

Wrong alignment of boxed text.

(Optional:) Please add any files, screenshots, or other information here.

Screenshot from 2024-02-07 06-53-14

(Required) What is this issue most closely related to? Select one.

Formula

Internal issue ID

0475c96f-2340-48c0-9296-8e8c61420f98

Paper URL

https://arxiv.org/html/2402.00105v1

Browser

Firefox/122.0

Device Type

Desktop

github-actions[bot] commented 8 months ago

Hello @semenyakinms, thanks for the issue report! We are reviewing your report and will address it as soon as possible.

dginev commented 8 months ago

Thank you for the report! This issue requires new mdframed.sty support in latexml, which isn't currently available.

Diagnostic comment:

Looking at the source, the boxed text is realized via a custom environment that wraps over {mdframed}:

\newenvironment{claim}{%
  \begin{mdframed}%
  [linecolor=black!0,backgroundcolor=black!10]%
  \noindent\itshape\ignorespaces}%
{\end{mdframed}}

% Used as:
In other words, we have the following result, 
\begin{claim}
%...
\end{claim}
This is clearly...

The PDF rendering to aim for is:

One would wish this is as simple as identifying which framed constructs need a CSS display: block; instead of the current display: inline-block;. The "block" display directive achieves the PDF layout in the screenshot, avoiding the inline wrapping.

But that choice isn't obvious in documents written with PDF in mind, and may need to be auto-inferred during conversion - similarly to recent upgrades in latexml which auto-infer the layout of figures with many subfigure panels.

Edit: but looking at the mdframed manual, block display may be the general expectation here, so this could also be an easy fix.

semenyakinms commented 8 months ago

Hi Deyan! Thank you for the prompt and deep reply! I appreciate very much your efforts in developing LaTeXML and making the whole arXiv fully accessible in HTML.

Meanwhile, I found that the similar issue was already discussed here by you: https://github.com/brucemiller/LaTeXML/issues/1483 But as far as I understood it was an older version of mdframed, so the binding needs to be updated.