Create Math Diagrams in LaTeX: Does TeX Have Diagram Package?

In summary: It allows for angled arrows and has a lot of useful features for creating graphics. In summary, there are various diagram packages available for \TeX installation, but Asymptote is a recommended tool for its versatility and features such as angled arrow support. Other options include using a picture editor or converting SVG images to pictures, but these may be less convenient.
  • #1
Tokipin
19
0
Does the TeX install here have a diagram package? For diagrams like commutative diagrams. It would be nice.
 
Physics news on Phys.org
  • #2
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]
 
  • #3
I mean diagrams like this:

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

Attachments

  • commutativediagram.png
    commutativediagram.png
    1 KB · Views: 1,130
  • #5
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]
 
  • #6
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]
 
  • #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.
 
  • #8
[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:]
 
  • #9
Asymptote is a nice tool for making diagrams in [tex]\LaTeX[/tex] documents
 

1. What is LaTeX and how is it used for creating math diagrams?

LaTeX is a typesetting system used for creating high-quality documents, particularly in the fields of mathematics and science. It has a specialized package called "TikZ" which allows for the creation of diagrams and figures using mathematical notation and commands.

2. Can I create diagrams in LaTeX without using the TikZ package?

Yes, there are other packages available for creating diagrams in LaTeX such as "PSTricks" and "Asymptote." However, the TikZ package is the most commonly used and offers a wide range of features and customization options.

3. Is the TikZ package difficult to learn?

As with any new skill, there is a learning curve when it comes to using the TikZ package for creating diagrams. However, there are many online tutorials and resources available to help users learn the basics and more advanced techniques. With practice and patience, creating diagrams in LaTeX with TikZ can become second nature.

4. Can I import existing diagrams into LaTeX?

Yes, LaTeX allows for the import of images and diagrams created in other software programs, such as Adobe Illustrator or Inkscape. However, it is important to note that the quality and appearance of the imported image may vary depending on the resolution and compatibility with LaTeX's document format.

5. Are there any limitations to creating math diagrams in LaTeX?

While the TikZ package offers a wide range of features and customization options, there may be some limitations when it comes to creating very complex diagrams or diagrams with 3D elements. In these cases, it may be more efficient to use specialized software or consider importing the diagram into LaTeX as an image.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
927
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
816
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
11K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
783
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
990
Back
Top