Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

picture environment supported? #632

Closed
ghost opened this issue Jun 25, 2015 · 10 comments · Fixed by #1657
Closed

picture environment supported? #632

ghost opened this issue Jun 25, 2015 · 10 comments · Fixed by #1657
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Jun 25, 2015

Is the picture environment supported? In the following code the text is not aligned properly with the graphics. Furthermore, changing the font size in my browser affects this alignment.

%% latexmlc --destination=picture.xml --format=XML --preload=LaTeX.pool picture.tex
%% latexmlpost --destination=picture.html picture.xml

\documentclass{article}
\usepackage{graphicx}

\begin{document}
Figure \ref{fg:kmap2} shows how all four minterms for two variables are mapped onto a four-cell Karnaugh map.
\begin{figure}[!ht] \centering
\begin{picture}(70,65)
\put(12,57){\makebox(0,0){$F(x,y)$}}

\put(30,40){\line(1,0){40}}
\put(30,20){\line(1,0){40}}
\put(30,0){\line(1,0){40}}

\put(30,0){\line(0,1){40}}
\put(50,0){\line(0,1){40}}
\put(70,0){\line(0,1){40}}

\put(50,57){\makebox(0,0){$y$}}
\put(40,47){\makebox(0,0){\footnotesize $0$}}
\put(60,47){\makebox(0,0){\footnotesize $1$}}

\put(14,20){\makebox(0,0){$x$}}
\put(22,30){\makebox(0,0){\footnotesize $0$}}
\put(22,10){\makebox(0,0){\footnotesize $1$}}

\put(40,30){\makebox(0,0){$m_0$}}
\put(60,30){\makebox(0,0){$m_1$}}
\put(40,10){\makebox(0,0){$m_2$}}
\put(60,10){\makebox(0,0){$m_3$}}
\end{picture}
\caption{Mapping of two-variable minterms on a Karnaugh map.}
\label{fg:kmap2}
\end{figure}

\end{document}

I'm finding that png graphics work best for my application. Most of my figures are circuit diagrams, where the alignment of text relative to the drawing is crucial. I wanted to use svg, but then the text in the drawing can be changed independently from the art work.

I think that I still have lots to learn about graphics for electronic viewing!

@dginev
Copy link
Collaborator

dginev commented Jun 25, 2015

Seems to mostly work when I try it in the editor here

@ghost
Copy link
Author

ghost commented Jun 25, 2015

The 2x2 grid is shifted one square to the left relative to the text. I've
attached a pdf showing what it's supposed to look like.

--Bob

On Thu, Jun 25, 2015 at 1:04 PM, Deyan Ginev notifications@github.com
wrote:

Seems to mostly work when I try it in the editor here


Reply to this email directly or view it on GitHub
#632 (comment)
.

@dginev
Copy link
Collaborator

dginev commented Jun 25, 2015

If you attach a PDF to an email it won't upload to GitHub, however. But thanks for pointing out the discrepancies!

@ghost
Copy link
Author

ghost commented Jun 25, 2015

Here's a png picture of what it's supposed to look like:
picture

@dginev
Copy link
Collaborator

dginev commented Jun 25, 2015

Awesome, we'll check it out!

@brucemiller
Copy link
Owner

nominally supported yes, but apparently not so well in this case. Will have to look into it.

@dginev dginev modified the milestones: LaTeXML-0.9, LaTeXML-0.8.2, LaTeXML-0.8.3 Jul 17, 2015
@dginev dginev modified the milestones: LaTeXML-0.8.3, LaTeXML-0.8.4 May 25, 2018
@dginev
Copy link
Collaborator

dginev commented May 25, 2018

Moving to next milestone (0.8.4), so that we roll out 0.8.3 asap. Apologies this issue didn't make the cut.

@bfirsh
Copy link
Contributor

bfirsh commented Oct 24, 2018

I was thinking of opening another issue about this, but this seems to be a reasonably good place to file it: the t/graphics/picture.tex test case is pretty broken, too. Compare the output of that with the PDF in the same directory to see the issues.

@dginev
Copy link
Collaborator

dginev commented Apr 9, 2019

For reference, here is the current Firefox rendering of the reported snippet in the issue description. Seems to be mostly related to spacing and alignments (visually). The test issues that Ben reported have additional problems with the rendering, e.g. missing letter from the input that never make it to the output.

pic

@brucemiller
Copy link
Owner

Yep, pretty silly. For further reference sake: I've partly debugged this (at least once) in the past, but couldn't quite figure out the fix. It comes down to some structure getting width=0, which (as I recall) svg sometimes requires and sometimes does something like the current situation. Sigh. Hate to leave something "almost fixed" dangling for so long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants