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

  • Context: LaTeX 
  • Thread starter Thread starter Tokipin
  • Start date Start date
  • Tags Tags
    Diagrams Latex
Click For Summary

Discussion Overview

The discussion revolves around the capabilities of TeX for creating mathematical diagrams, particularly focusing on the availability of diagram packages and the use of the picture environment for diagram creation. Participants explore various methods and tools for diagramming within LaTeX, including commutative diagrams and other graphical representations.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • One participant inquires about the existence of a diagram package in TeX for creating diagrams like commutative diagrams.
  • Another participant shares an example using the picture environment to create a diagram, demonstrating its capabilities.
  • A participant provides a link to a resource that discusses creating graphics in LaTeX, suggesting that there are existing tools for this purpose.
  • Some participants express concerns about the limitations of the picture environment, noting that it can be crude and may require forcing certain styles, such as italics.
  • One participant asks about the possibility of creating angled arrows in diagrams and mentions the potential of using CorelDraw or developing an SVG-to-picture converter.
  • A later reply discusses the jpicedt tool for LaTeX picture editing, highlighting its strengths and weaknesses in rendering diagrams.
  • Another participant mentions Asymptote as a useful tool for creating diagrams in LaTeX documents.

Areas of Agreement / Disagreement

Participants express a variety of opinions on the effectiveness of different tools and methods for creating diagrams in LaTeX. There is no consensus on a single best approach, and multiple competing views remain regarding the use of the picture environment versus other tools like jpicedt and Asymptote.

Contextual Notes

Some participants note limitations in the picture environment, such as the complexity of certain rendered elements and the difficulty of manual editing. There are also mentions of specific features, like the ability to create angled arrows, which may not be straightforward.

Tokipin
Messages
19
Reaction score
0
Does the TeX install here have a diagram package? For diagrams like commutative diagrams. It would be nice.
 
Physics news on Phys.org
the picture environment works

<br /> <br /> \]<br /> <br /> \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}}<br /> \put(0,0){\vector(1,4){50}}<br /> \put(0,0){\vector(1,2){90}}<br /> \put(50,50){\circle*{10}} <br /> <br /> \put(160,40){\framebox(80,40)[r]{ \textcolor{blue}{\bf \[ x_{Bob} \] } } }<br /> \put(40,160){\textcolor{yellow}{\dashbox(80,40)[t]{ \textcolor{red}{ \[ t_{Bob} \] } } }}<br /> <br /> \qbezier(100,100)(200,100)(200,200)<br /> \linethickness{8pt} <br /> \textcolor{green}{\qbezier(0,0)(0,100)(100,100)}<br /> \linethickness{1pt} <br /> \qbezier(0,0)(0,100)(100,100)<br /> <br /> \linethickness{5pt} <br /> \put(0,0){\vector(2,1){220}}<br /> <br /> \end{picture}<br /> \[<br />
 
I mean diagrams like this:

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

Attachments

  • commutativediagram.png
    commutativediagram.png
    1 KB · Views: 1,230
a little crude...

<br /> \]<br /> \begin{picture}(200,200)(0,0)<br /> \put( 0, 0){\makebox(0,0){X}}<br /> \put( 0,50){\makebox(0,0){A}}<br /> \put( 0,10){\vector(0,1){30}} \put(-5,25){\makebox(0,0)[r]{a}}<br /> \put(10, 0){\vector(1,0){30}} \put(25,-5){\makebox(0,0)[t]{b}}<br /> \put(50, 0){\makebox(0,0){B}}<br /> \put(50,10){\vector(0,1){30}} \put(55,25){\makebox(0,0)[l]{f}}<br /> \put(50,50){\makebox(0,0){C}}<br /> \put(10,50){\vector(1,0){30}} \put(25,55){\makebox(0,0)<b>{g}}<br /> \end{picture}<br /> \[<br /> </b>
 
For some reason, I have to force it do italics

<br /> <br /> \begin{picture}(200,200)(0,0)<br /> \put( 0, 0){\makebox(0,0){\it X}}<br /> \put( 0,100){\makebox(0,0){\it A}}<br /> \put( 0,10){\vector(0,1){80}} \put(-5,50){\makebox(0,0)[r]{\it a}}<br /> \put(10, 0){\vector(1,0){80}} \put(50,-5){\makebox(0,0)[t]{\it b}}<br /> \put(100, 0){\makebox(0,0){\it B}}<br /> \put(100,10){\vector(0,1){80}} \put(100,50){\makebox(0,0)[l]{\it f}}<br /> \put(100,100){\makebox(0,0){\it C}}<br /> \put(10,100){\vector(1,0){80}} \put(50,100){\makebox(0,0)<b>{\it g}}<br /> \end{picture}<br /> <br /> <br /> </b>
 
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.
 
<br /> \begin{picture}(200,200)(0,0)<br /> \put( 0, 0){\makebox(0,0){\it X}}<br /> \put( 0,100){\makebox(0,0){\it A}}<br /> \put( 8, 8){\vector(1,1){86}} <br /> \put( 0,10){\vector(0,1){80}} \put(-5,50){\makebox(0,0)[r]{\it a}}<br /> \put(10, 0){\vector(1,0){80}} \put(50,-5){\makebox(0,0)[t]{\it b}}<br /> \put(100, 0){\makebox(0,0){\it B}}<br /> \put(100,10){\vector(0,1){80}} \put(100,50){\makebox(0,0)[l]{\it f}}<br /> \put(100,100){\makebox(0,0){\it C}}<br /> \put(10,100){\vector(1,0){80}} \put(50,100){\makebox(0,0)<b>{\it g}}<br /> \end{picture}<br /> </b>

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:]
 
Asymptote is a nice tool for making diagrams in \LaTeX documents
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 25 ·
Replies
25
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
12K
  • · Replies 12 ·
Replies
12
Views
3K