TransWikia.com

Axodraw drawings and .png images in the same document

TeX - LaTeX Asked on May 29, 2021

I want to be able to put .png images in my document and as well drawings with the package axodraw2. The problem is that to draw a picture and see it in the document I have to compile with LaTeX + dvips + ps2pdf + View Pdf and to see and ordinary .png image I have to compile with Pdf LaTeX + View Pdf.

For example, if I write the following things, which includes an image and a drawing with axodraw2

documentclass{article}
usepackage{amsmath}
usepackage{axodraw2}
usepackage{slashed}
usepackage{amsmath}

begin{document}

begin{figure}
includegraphics[scale=0.5]{lightcone}
end{figure}

begin{center}
begin{axopicture}(130,150)
SetColor{Black}
Text(70,130){begin{small}$Im{p^0}$end{small}}
Text(180,30){begin{small}$Re{p^0}$end{small}}
Text(45,40){$times$}
Text(95,20){$times$}
Text(130,90){$Gamma$}
Arc[arrow](70,27)(80,0,90)
Arc[arrow](70,27)(80,90,180)
Line[arrow](-10,27)(70,27)
Line[arrow](70,27)(150,27)
SetWidth{2}
LongArrow[arrowscale=0.8](70,20)(70,120)
LongArrow[arrowscale=0.8](-20,30)(160,30)
end{axopicture}
end{center}

end{document}

And try to compile with Pdf LaTeX + View Pdf I get (the drawing should appear below the image but only the letters that are in the drawing appear)

enter image description here

If I doesn’t include the image and I compile with LaTeX + dvips + ps2pdf + View Pdf I get the drawing with axodraw2 right

enter image description here

And including both and trying to compile with LaTeX + dvips + ps2pdf + View Pdf yields and error message

enter image description here

Is there a way to include .png images and use axodraw drawings in the same document? I would really appreciate some help. Thanks for the attention.

One Answer

Yes, see the axodraw manual section 4.3.3.

By running an auxiliary program, similar to the way you run BibTeX or Biber for bibliographies, you can use axodraw2 with pdflatex. The compilation sequence becomes

pdflatex filename
axohelp filename
pdflatex filename

I think it should be possible to run axohelp from Texmaker (User -> User commands), but I couldn't make it work. But running from a terminal should work.

Answered by Torbjørn T. on May 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP