You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using \useasboundingbox does not achieve the desired result. In TikZ, that command sets a bounding box (\pgf@picminx etc) and stops updating it to accommodate new paths that go past the boundary. Strangely enough, LaTeXML keeps enlarging the bounding box anyway. For now, the only (?) way to get the correct bounding box is to run \pgfresetboundingbox at the end, followed by the desired \useasboundingbox.
(This has actual consequences. For example, if a figure is clipped to a small bounding box, LaTeXML will clip correctly but leave a big bounding box, resulting in lots of empty space.)
Ugly example where the two figures should be identical:
\documentclass{article}
\usepackage{tikz}
\begin{document}
text before:
\begin{tikzpicture}
\pgfresetboundingbox\useasboundingbox (0,0) rectangle (3,2);
\draw[blue, very thick] (0,0) rectangle (3,2);
\draw[green, very thick] (-2,-2) rectangle (4,3);
\end{tikzpicture}
:text after
text before:
\begin{tikzpicture}
\draw[blue, very thick] (0,0) rectangle (3,2);
\draw[green, very thick] (-2,-2) rectangle (4,3);
\pgfresetboundingbox\useasboundingbox (0,0) rectangle (3,2);
\end{tikzpicture}
:text after
\end{document}
HTML:
PDF:
The text was updated successfully, but these errors were encountered:
Using
\useasboundingbox
does not achieve the desired result. In TikZ, that command sets a bounding box (\pgf@picminx
etc) and stops updating it to accommodate new paths that go past the boundary. Strangely enough, LaTeXML keeps enlarging the bounding box anyway. For now, the only (?) way to get the correct bounding box is to run\pgfresetboundingbox
at the end, followed by the desired\useasboundingbox
.(This has actual consequences. For example, if a figure is clipped to a small bounding box, LaTeXML will clip correctly but leave a big bounding box, resulting in lots of empty space.)
Ugly example where the two figures should be identical:
HTML:
PDF:
The text was updated successfully, but these errors were encountered: