Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Math Diagrams in LaTeX?

  1. Mar 22, 2009 #1
    Does the TeX install here have a diagram package? For diagrams like commutative diagrams. It would be nice.
     
  2. jcsd
  3. Mar 22, 2009 #2

    robphy

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    the picture environment works

    [itex]

    \]

    \begin{picture}(200,200)(0,0)\multiput(0,0)(40,10) {5}{\line(1,4){40}}\multiput( 0,0)(10,40){5}{\line(4,1){160}}
    \put(0,0){\vector(1,4){50}}
    \put(0,0){\vector(1,2){90}}
    \put(50,50){\circle*{10}}

    \put(160,40){\framebox(80,40)[r]{ \textcolor{blue}{\bf \[ x_{Bob} \] } } }
    \put(40,160){\textcolor{yellow}{\dashbox(80,40)[t]{ \textcolor{red}{ \[ t_{Bob} \] } } }}

    \qbezier(100,100)(200,100)(200,200)
    \linethickness{8pt}
    \textcolor{green}{\qbezier(0,0)(0,100)(100,100)}
    \linethickness{1pt}
    \qbezier(0,0)(0,100)(100,100)

    \linethickness{5pt}
    \put(0,0){\vector(2,1){220}}

    \end{picture}
    \[



    [/itex]
     
  4. Mar 23, 2009 #3
    I mean diagrams like this:

    attachment.php?attachmentid=18121&d=1237834928.png
     

    Attached Files:

  5. Mar 23, 2009 #4
  6. Mar 23, 2009 #5

    robphy

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    a little crude...

    [tex]
    \]
    \begin{picture}(200,200)(0,0)
    \put( 0, 0){\makebox(0,0){X}}
    \put( 0,50){\makebox(0,0){A}}
    \put( 0,10){\vector(0,1){30}} \put(-5,25){\makebox(0,0)[r]{a}}
    \put(10, 0){\vector(1,0){30}} \put(25,-5){\makebox(0,0)[t]{b}}
    \put(50, 0){\makebox(0,0){B}}
    \put(50,10){\vector(0,1){30}} \put(55,25){\makebox(0,0)[l]{f}}
    \put(50,50){\makebox(0,0){C}}
    \put(10,50){\vector(1,0){30}} \put(25,55){\makebox(0,0){g}}
    \end{picture}
    \[
    [/tex]
     
  7. Mar 23, 2009 #6

    robphy

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    For some reason, I have to force it do italics

    [tex]

    \begin{picture}(200,200)(0,0)
    \put( 0, 0){\makebox(0,0){\it X}}
    \put( 0,100){\makebox(0,0){\it A}}
    \put( 0,10){\vector(0,1){80}} \put(-5,50){\makebox(0,0)[r]{\it a}}
    \put(10, 0){\vector(1,0){80}} \put(50,-5){\makebox(0,0)[t]{\it b}}
    \put(100, 0){\makebox(0,0){\it B}}
    \put(100,10){\vector(0,1){80}} \put(100,50){\makebox(0,0)[l]{\it f}}
    \put(100,100){\makebox(0,0){\it C}}
    \put(10,100){\vector(1,0){80}} \put(50,100){\makebox(0,0){\it g}}
    \end{picture}


    [/tex]
     
  8. Mar 24, 2009 #7
    Thanks for the recommendations. Is it possible to make an angled arrow?

    I think I'll stick to CorelDraw for the time being. I could probably make a simple SVG-to-picture converter program, but I'm not sure how much it's worth the trouble.

    Actually there are obviously LaTeX picture editors. I found this one: http://jpicedt.sourceforge.net

    I'll try it out later.
     
  9. Mar 24, 2009 #8

    robphy

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    [tex]
    \begin{picture}(200,200)(0,0)
    \put( 0, 0){\makebox(0,0){\it X}}
    \put( 0,100){\makebox(0,0){\it A}}
    \put( 8, 8){\vector(1,1){86}}
    \put( 0,10){\vector(0,1){80}} \put(-5,50){\makebox(0,0)[r]{\it a}}
    \put(10, 0){\vector(1,0){80}} \put(50,-5){\makebox(0,0)[t]{\it b}}
    \put(100, 0){\makebox(0,0){\it B}}
    \put(100,10){\vector(0,1){80}} \put(100,50){\makebox(0,0)[l]{\it f}}
    \put(100,100){\makebox(0,0){\it C}}
    \put(10,100){\vector(1,0){80}} \put(50,100){\makebox(0,0){\it g}}
    \end{picture}
    [/tex]

    LaTeX picture vectors allow slopes in a limited selection of rational slopes.

    jpicedt is pretty good... but I think that some things are rendered in overly complicated ways [that are hard for me to edit manually at the LaTeX level].

    [I've been advocating SVG support in posts here at PF. No takers. :frown:]
     
  10. May 17, 2009 #9
    Asymptote is a nice tool for making diagrams in [tex]\LaTeX[/tex] documents
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Math Diagrams in LaTeX?
  1. Latex vs. writing math (Replies: 10)

Loading...