3

I'm using a program that exports images in a .tex format and I was wondering if anyone know how I should include this in my main TeX file?

\fcolorbox{white}{white}{%
\begin{picture}(162,306)(271,-175) 
\SetWidth{1.0} 
\SetColor{Black}
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](272,-174)(35‌2,-94)
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](352,-94)(432,-174) 
\Photon(352,-94)(352,50){7.5}{7} \Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](352,50)(432,‌130)
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](272,130)(352‌,50) 
\Text(368,-14)[lb]{\Large{\Black{$\gamma$}}} 
\end{picture}}
9
  • 2
    \input{yourimagefile.tex} instead of \includegraphics[...]{...}. If you want resizing, use \resizebox from graphicx` package.
    – user11232
    Commented Apr 18, 2013 at 0:28
  • tex isn't really an image format? is this just a tex wrapper that includes an image (as in fig or gnuplot's combined tex/iimage exports?) in any case if it is TeX \input{...} should work. Commented Apr 18, 2013 at 0:28
  • There must be a duplicate some where here. Couldn't find it right now.
    – user11232
    Commented Apr 18, 2013 at 0:28
  • 4
    Welcome to TeX.SX.
    – user11232
    Commented Apr 18, 2013 at 0:41
  • 1
    @JackMedley You can edit the question if you want to provide additional information or code.
    – doncherry
    Commented Apr 18, 2013 at 3:08

2 Answers 2

2

here is a complete example of your code:

\documentclass[a4paper,11pt]{article}
\usepackage{axodraw4j}
\usepackage{color}
\setlength\unitlength{1pt}
\begin{document}

\framebox{\fcolorbox{white}{white}{%
\begin{picture}(162,306) (271,-175) 
\SetWidth{1.0} 
\SetColor{Black} 
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](272,-174)(352,-94) 
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](352,-94)(432,-174) 
\Photon(352,-94)(352,50){7.5}{7} 
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](352,50)(432,130) 
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](272,130)(352,50) 
\Text(368,-14)[lb]{\Large{\Black{$\gamma$}}} 
\end{picture}}}

%\input{<file>.tex}  % instead of the above code

\end{document}

enter image description here

If the package axodraw4j is not already on your system then you have to install it manually. It is not on CTAN!

4
  • Hi Herbert, Thats exactly the diagram I need however when I compile (with: 'pdflatex Filename.tex') it only draws the little gamma without any of the lines? Are you compiling with a different command? Cheers! Jack
    – JMzance
    Commented Apr 18, 2013 at 10:05
  • it needs the sequence latex->dvips->ps2pdf
    – user2478
    Commented Apr 18, 2013 at 10:06
  • I was compiling with pdflatex before which worked ok - apart from the images. and it errors immediately when I try and run latex->...
    – JMzance
    Commented Apr 18, 2013 at 10:28
  • Nevermind! I sorted it. Cheers
    – JMzance
    Commented Apr 18, 2013 at 10:30
2

The code that you show in a comment looks on the surface like LaTeX syntax, but it is definitely not LaTeX out of the box, as commands like \Line, \Photon, \Text, etc. aren't defined by LaTeX. Thus as part of the program that you used to produce this code, there has to be some "package" (a file with the extension .sty, or perhaps .dtx if it isn't unpacked) that defines those commands.

Search for that file and then load it in the preamble of your document as

\usepackage{<name-of-package>}

and at the point you want your graphic appear

\input{<mygraphic>.tex}

Without a clue what the program is that you used, this is all guesswork of course.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .