dginev / ar5iv

A web service offering HTML5 articles from arXiv.org as converted with latexml
https://ar5iv.org
MIT License
771 stars 20 forks source link

Improve article 2104.04040 #318

Closed dginev closed 6 months ago

dginev commented 1 year ago

Exact location of issue

Figure 1

Problem details

The SVG generated loses the textual content of the legend. Here are two screenshots:

HTML+SVG (in Firefox) image

PDF image

dginev commented 11 months ago

This reduces to:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{height=5.2cm}
\pgfplotsset{compat=1.7}
\makeatletter

\begin{document}
\begin{figure}
\begin{tikzpicture}[trim right=0cm]
\begin{loglogaxis}[
    xmax=200,ymax=100,xtick={100},ytick={10},legend style={at={(1.1,0.8)},anchor=north west},
    every axis plot/.append style={thick},legend cell align={left}]
\addplot[color=red,mark=*,]
    coordinates {(100,73.8)};
\def\plotnum{0}\def\plotnumofactualtype{0}%
\def\pgfplots@already@computed@legend@node{%
    \matrix[/pgfplots/every axis legend]{%
    \pgfplots@show@small@legendplots{}{/pgfplots/every axisplot except %
    legend/.code=,/pgfplots/every axis plot,/pgfplots/every axis plot except legend,%
    /pgfplots/every axis plot no 0/.try, color=red, mark=*,%
     ,/pgfplots/.cd,,/pgfplots/.cd,/pgfplots/every axis plot post}\pgfmatrixnextcell
     \node{legend panel};\\};}
\end{loglogaxis}
\end{tikzpicture}
\label{fig:running-time}
\end{figure}
\end{document}

And likely runs into one of the limitation comments in pgfsys-latexml.def.ltxml namely:

# But there are still some major problems:
# On top of that, we're somehow getting out-of-sync with the
# bgroup/egroup & begingroup/endgroup pairs that tikz/pgf is adding
# and the ones embedded in our alignment machinery.
# I _THINK_ we're running afoul of when the last item of \matrix ends with \\ ???

I think I will shave the issue until we return to align-related considerations, hopefully the minimal example helps troubleshoot further.

dginev commented 6 months ago

Resolved with the latest ar5iv update.