2022 Developer Survey is open! Take survey.

# Tag Info

## Hot answers tagged diagrams

Accepted

### What is the best way to draw an arbitrary number of lines in LaTeX?

• 20.3k
Accepted

### Subgroup diagram of $S_3$

Like this? \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{arrows.meta, calc, chains } \begin{document} \begin{figure} \centering \begin{...
• 251k
Accepted

### Best method to animate a step by step state space diagram construction in TikZ

An off-beamerclass \uncover command is defined, that specifies the frame number at which an object in a tikzpicture is to be revealed. %\uncover{<current>}{<when>}{...<commands>...} \...
• 50.9k

### Best method to animate a step by step state space diagram construction in TikZ

I don't know if this is ideal for you. Because I change some of your tikz code in order to use a absolute coordinate for each path. In this way, each individual path can be drawn without reference the ...
• 1,893

### Subgroup diagram of $S_3$

You get a more symmetric diagram if you change the order of the subgroups: \documentclass[12pt]{article} \usepackage{tikz-cd} \begin{document} \begin{figure} \centering \begin{tikzcd}[ row sep=...
• 986k

### Subgroup diagram of $S_3$

Or using tikz-cd: \documentclass[12pt]{article} \usepackage{tikz-cd} \title{Subgroup Diagram of $S_3$} \begin{document} \begin{figure} \centering \begin{tikzcd}[row sep= 1em,column sep=1em] & ...
• 46.2k
Accepted

### Draw the flat torus

Here's an option. I defined a command \flattorus with three arguments: (optional) The side of the square in the TikZ picture, in cm. I put 4 as the default value, but of course you can easily change ...
• 15.4k
Accepted

### How can I draw rectangle with empty fraction?

We can define a macro \fracrect that draws the rectangle. The command is \fracrect[tikz options]{numerator}{denominator} For example, \fracrect[xscale=4]{9}{12} will be similar to your second divided ...
• 20.3k

### What is the best way to draw an arbitrary number of lines in LaTeX?

A fairly general method for repeating things a given number of times, using also the corresponding index. \documentclass[12pt]{memoir} \ExplSyntaxOn \NewDocumentCommand{\REPEAT}{mm} {% #1 = number ...
• 986k
Accepted

### Drawing a Pyramid within a Rectangular with Arrows and Text

Doing this for entertainment :) \documentclass[tikz,border=15pt]{standalone} \usepackage{fontspec} \usepackage{newtxtext} \setsansfont {texgyreheros} [ Scale = MatchUppercase , ...
• 5,109
Accepted

### Interface for diagrams and example

It's true—TikZ can be intimidating at first. The 1000+ page manual is downright terrifying. But it's worth it! Start with some of the tutorials at the beginning of the manual. You'll be drawing ...
• 20.3k

### Draw the flat torus

A nice solution was posted by @Vincent (+1) but this was already in the works so I figured I'd post it as an alternative. Here is a macro \flattorus that takes two arguments (and one additional ...
• 20.3k

### Best method to animate a step by step state space diagram construction in TikZ

One more suggestion: replicate animation as is done in MWE in question simplified styles of tikzpicture elements shorter and simpler code \documentclass[border=2mm]{standalone} \usepackage{amsmath,...
• 251k
Accepted

### How can I draw Circular sector with three empty fraction?

Modify the code from the solution about rectangles but use circular sectors: The code for the above image is \fraccirc{9}{12}\qquad\fraccirc[fill=blue!30]{3}{4}. The default fill color is orange!70, ...
• 20.3k

### Subgroup diagram of $S_3$

The TikZ graphs and graphdrawing libraries are nice for this as well (see also "Part IV Graph Drawing" of the pgfmanual). One caveat is the requirement of LuaLaTeX for graphdrawing, since ...
• 31

### Interface for diagrams and example

A small variation of the nice @Sandy G answer (+1) which gives wee bit shorter code. For exercise :-) \documentclass[border=3.14159]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta, ...
• 251k

### What is the best way to draw an arbitrary number of lines in LaTeX?

A LaTeX3 version using \rule (based on Skillmon's answer) \documentclass{article} \usepackage{xcolor} \ExplSyntaxOn \int_new:N \g_dl_line_count \NewDocumentCommand{\drawlines}{ m }{ \int_set:Nn \...
• 2,410

### What is the best way to draw an arbitrary number of lines in LaTeX?

It is not necessary to use TikZ for this, you could also use LaTeX's built in \rule: \documentclass[12pt]{memoir} \usepackage{xcolor} \makeatletter \newcommand\drawline[1] {\expandafter\drawline@\...
• 48.7k
Accepted

### Drawing not simply connected domain

You are overcomplicating this. Draw all three closed curves with one \draw command using even odd rule to fill the area between the curves. Decorate with arrows and labels using \node in the ...
• 20.3k
Accepted

### Right triangle with angle

Try this \documentclass[border=5mm]{standalone} \usepackage{asymptote} \begin{document} \begin{asy} size(300); pair A = (0,0); pair B = dir(18); pair C = (xpart(B), 0); draw (A--B--...
• 35.8k
Accepted

### Using xy-diagram to create an asymmetrical triangle

Here is the diagram with xy. Note that I loaded cmtip which makes proper arrowheads. You are permitted to have empty cells, so simply remove the B from the top left entry (but leave the &. \...
• 20.3k
Accepted

### How can I create a Gantt / Sankey diagram combination?

Some comments I think a solution for the diagram you are looking for can be achieved using only the positioning library: I organized all the elements of the drawing around the empty cell in the upper ...
• 2,859
Accepted

### Tree Diagram with Filesystem Branches

This can be done with forest, but it requires some manual adjustment because of the way the folder style interacts with the standard style. \documentclass{article} \usepackage[edges]{forest} \...
• 20.3k

### How can I draw rectangle with empty fraction?

Add another solution using rectangle nodes and put everything in a single tikzpicture which can be drawn by a command (e.g. \fracrect{3}{7}{6}{14}). \documentclass{article} \usepackage{tikz} \...
• 1,893
Accepted

### move nodes manually in tikzpicture

Remember that the positioning library allows you to place relative nodes to others with displacements in all directions using above/below left/right = above/below_displacement and left/...
• 10.3k

### move nodes manually in tikzpicture

\documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,calc} \begin{document} \begin{tikzpicture}[auto, node distance = 0.4cm, thick, every node/.style = {rectangle, font = \sffamily,...
• 2,410

### Tree Diagram with Filesystem Branches

your question is not clear, sorry. your other image is simple to draw by use of forest package: \documentclass[border=0.2 cm]{standalone} \usepackage[edges]{forest} \usetikzlibrary{arrows.meta} \...
• 251k

### Creating a bent 3D pipe in Tikz

Not sure if this is exactly what you're looking for, but you can \draw an arc with option double and place ellipses at each end. Note the double distance should account for the line thickness to get a ...
• 20.3k
Accepted

### Why does my text along the line intersect nodes?

Huh, your MWE is very (to my opinion unnecessary) complex (consequently in it can be easily lost) My suggestion is mostly off-topic -- possible solution is already mentioned in @SebGlav comment -- ...
• 251k