New answers tagged

7

Put C and D in the right column: \documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} & & C \\ A \arrow[r] & B \arrow[ur] \arrow[dr] & \\ & & D \end{tikzcd} \end{document}


6

\documentclass[tikz,border=3mm]{standalone} \usetikzlibrary{arrows.meta,bending,backgrounds,calc} \begin{document} \begin{tikzpicture} \draw (-3,2) to[out=-20,in=180] coordinate[pos=0.4] (t1) coordinate[pos=0.5] (t1') (0,1.5) to[out=0,in=-160] coordinate[pos=0.5] (t2') coordinate[pos=0.6] (t2) (3,2) (-3,-2) to[out=20,in=180] coordinate[pos=...


2

Here is one way. \documentclass[tikz,margin=3mm]{standalone} \usetikzlibrary{positioning,shadows.blur,arrows.meta,bending} \begin{document} \begin{tikzpicture}[node distance=2em, nodes={draw,rounded corners,align=center,blur shadow, fill=white,minimum height=3em,minimum width=8em}] \node (L){Leadership}; \node[above left=of L] (M) {Set Mission}; \...


2

You can place nodes inside the \draw macros and shift them to the left or right. This way, you can properly align the nodes. Like this, for example: \documentclass[tikz]{standalone} \tikzset{ level/.style = { ultra thick, blue, }, connect/.style = { dashed, red }, label/.style = { align=center, ...


2

This diagram seems to have the following logic: one starts with {1,2,3,4} and finds all subsets of that list that emerge by dropping one entry, and puts them in the next line. In the line below that, one puts all subsets of these, which emerge by dropping another element. Continuing like this, one arrives at one-element lists in the last line. A given list ...


3

With pure tikz, quite elementary with use of the libraries calc, chains and positioning: \documentclass[tikz, margin=3mm]{standalone} \usetikzlibrary{calc, chains, positioning} \begin{document} \begin{tikzpicture}[ node distance = 8mm and 2mm, start chain = going right, N/.style = {inner sep=1pt, on chain} ] \...


3

Have you checked this thread? Energy level diagrams with TeX I don't have enough reputations to comment, so I put it as my answer.


4

The chains library is a powerful tool, but maybe not really suited for such diagrams. This is an attempt to make things more automatic and accessible. Please read the annotations in the code. The inputs and outputs are stored in lists, and so are the numbers of neurons. \documentclass[tikz, margin=3mm]{standalone} \usetikzlibrary{quotes,positioning} \begin{...


3

You can have this diagram with a simple tabular: \documentclass{article} \usepackage{amsmath} \usepackage{makecell} \begin{document} \renewcommand{\arraystretch}{0.8} \begin{tabular}{r@{}c@{}l} strict convexity & $\implies $ & convexity \\ \makecell{$\Vert$} & & \makecell{$\Vert\qquad$} \\ \multicolumn{1}{r@{}}{\footnotesize (under ...


1

I have overlooked the overwritten arrow. So I think you want something like that: %\documentclass{article} \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{matrix} \usetikzlibrary{arrows.meta} \usetikzlibrary{backgrounds} \begin{document} \begin{tikzpicture}[] \matrix (m)[matrix of nodes, nodes in empty cells, row sep=1.5em, %column sep=...


4

Since you would like tikz-cd: \documentclass{article} \usepackage{tikz-cd} \usepackage{amsmath} \begin{document} \[ \begin{tikzcd}[ row sep=large, column sep=large, arrows={Rightarrow} ] \text{strict convexity}\ar[r]\ar[d,"\text{(under differentiability)}" description] & \text{convexity}\ar[d,"\text{(under differentiability)}" ...


3

Does it have to be TikZ? Maybe a simple tabular is enough: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{tabular}{c c c} strict convexity & $\Rightarrow$ & convexity \\ $\Downarrow$ & & $\Downarrow$ \\ strict & $\Rightarrow$ & convex \\ \end{tabular} \end{document}


0

Here's a quick sketchup of what you want. The arrows are defined in the \draw tags, so you'll be able to change the style in there somewhere. Good luck! \usepackage{tikz} \usetikzlibrary{shapes,arrows} \usetikzlibrary{positioning} \begin{tikzpicture}[thick] \node(sc){Strict Convexivity}; \node[below = 1cm of sc](ud){(Under ...


2

This answer of mine can easily be adapted to your case, with the help of the curve2e package to enable the use of polar coordinates inside picture environments. The symbols are automatically scaled as appropriate when used in first- and higher-order superscripts or subscripts, and honor the bold math version. Here is a compilable example. For details and ...


4

This is a modest generalization of Mark Wibrow's answer, hoping that I interpreted the Wikipedia article correctly. The number of corners is odd, n=2N+1. You can specify N, the radius and the style of edges vs. arcs, and since these are pics, you can apply the usual transformations like rotations. \documentclass[tikz,border=3mm]{standalone} % based on https:...


0

I wrote a package to produce process flow diagram with TikZ. These are slightly less complex than P&IDs, but you can work it out something useful anyway. At least, the package defines a certain variety of symbols commonly used in chemical process diagrams. You may want to have a look to the chemplants package, available on CTAN at https://ctan.org/pkg/...


5

Welcome! TikZ has those built in in the library shapes.geometric. \documentclass[fleqn]{article} \usepackage{mathtools} \usepackage{tikz} \usetikzlibrary{shapes.geometric} \newcommand{\Ngon}[2][]{\vcenter{\hbox{\begin{tikzpicture} \node[regular polygon,regular polygon sides=#2,draw,minimum size=1cm,#1](#2-gon){}; \foreach \X in {1,...,#2}{\fill (#2-gon....


2

Subtracting 180 from the in and out angles yields \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix,arrows} \usepackage{amsfonts} \begin{document} \begin{tikzpicture}[descr/.style={fill=white,inner sep=3.5pt}] \matrix (m) [ matrix of math nodes, row sep=3em, column sep=2.5em, text height=1.5ex, text depth=0.25ex ] ...


1

Here is another way! Do you see plain TikZ code? \documentclass[tikz,border=5mm]{standalone} \begin{document} \begin{tikzpicture} \begin{scope}[shift={(-.5,.5)}] \fill[purple!30] (4,0) rectangle +(1,-3); \fill[cyan] (3,-3) rectangle +(1,-1); \fill[orange] (0,-4) rectangle +(3,-1); \draw (0,0) grid (5,-5); \end{scope} \draw[red,mark=*,line width=1....


2

Welcome. This is a start. \documentclass[tikz,border=3mm]{standalone} \begin{document} \begin{tikzpicture}[thick,font=\sffamily,scale=1.5] \draw (0,3.5) node[left]{$c_2$} -- (0,0) node[below left] {$0$} -- (3.5,0) node[below right]{$c_1$}; \draw plot[domain=1:3,smooth] (\x,3/\x-1/2); \draw (0,1) node[left]{$y_2$} -| node[pos=0.25,below=3mm] {Feasible ...


8

Welcome! With a TikZ matrix it is very easy. \documentclass[border=3mm,tikz]{standalone} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture} \matrix[matrix of nodes,nodes in empty cells, nodes={minimum size=2.5em,draw,outer sep=0pt,anchor=center}, row sep=-\pgflinewidth,column sep=-\pgflinewidth, column 1/.style={nodes={draw=none},align=right,...


2

Welcome! All you need to do is to add every label/.append style={font=\normalsize} to make their font size as large as the one of the other nodes. \documentclass{article} \usepackage{tikz-cd} \usepackage{amsfonts} \begin{document} \begin{tikzcd}[row sep = huge, column sep = huge,every label/.append style={font=\normalsize}] & \makebox{Spin($M$)} ...


1

Use legend image post style={only marks, mark=square*}, \documentclass{article} \usepackage{float} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \pgfplotscreateplotcyclelist{colour-list}{ red,style={fill=red}\\ orange,style={fill=orange}\\ yellow,style={fill=yellow}\\ green,style={fill=green}\\ blue,style={fill=blue}\\ } \usepackage{filecontents} \...


1

Since you say you want a square, I added legend image code/.code={ \draw [#1] (0cm,-0.1cm) rectangle (0.2cm,0.1cm); }, to get \documentclass{article} \usepackage{float} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \pgfplotscreateplotcyclelist{colour-list}{ red,style={fill=red}\\ orange,style={fill=orange}\\ yellow,style={fill=yellow}\\ ...


4

As for your points: You can make this scope a pic. This addresses also point 4. You can use colored tokens={black!50}. The manual shifts are unnecessary if you add the distance in the positioning syntax, e.g. right=44mm of make withdraw. One very convenient way to repeat things is to use pics. And after you pointed your finger on it: the arrows pointing to ...


1

You could do something like the following. This relies on the tree command being present on the system, as well as bash and sed --- so this is useless on Windows, for example --- but the command is run externally, as part of compilation, provided shell escape is enabled. \documentclass{article} \usepackage{bashful} \usepackage[edges]{forest} \begin{document}...


1

There are many ways you can swap labels. Here are three of them: You can swap the labels with every arrow/.append style={swap}. You can swap individual labels by adding [swap] to the arrows. If you use the quotes syntax, swapping the labels is as simple as adding a prime. Example codes: \documentclass{article} \usepackage{tikz-cd} \usepackage{amsmath} \...


1

It is not an answer as such (but it is too long to put in a commentary). I think it's possible using -shell-escape, the tree command and a few regex (I'm more familiar with perl than python). The first thing is to be able to find a pattern to be able to build the code in tikz. Using : [pablo@worktex ~] $ pwd /home/pablo [pablo@worktex ~] $ tree ltxgit/ ...


1

If somebody is interested in the TikZ version, he can find it here. \documentclass{article} \usepackage{tikz} % needed for TikZ \begin{document} \begin{figure}[ht] \begin{tikzpicture}[ squarednode/.style={draw=black, minimum size=9.9mm}, % define a new node: black border and minimum size of 9.9mm y=1.5cm % set the y unit to 1.5cm to ...


3

Wow, this was retro! Felt like 1985, when the picture environment was the best graphics you could get (in LaTeX). Disclaimer: I don't think that in the long run you will be happy with this solution, since it will get more and more cumbersome to maintain. Moreover, there is a lot of duplication that one could avoid by defining some macros. However, I ...


4

If you use tikz-cd, you do not have to introduce an artificial row. tikz-cd is based on tikz, after all, which has labels for that purpose. So if you want to have a Z and a \cong above, you only need to add |[la]| to that cell, where la is just a shorthand for that label. \documentclass{article} \usepackage{amsmath,amsfonts} \usepackage{tikz-cd} \begin{...


Top 50 recent answers are included