New answers tagged

1

The shading effects might be difficult to achieve using plain TikZ/PGFPlots. You are better off using Asymptote instead. However, I have written a TikZ/PGFPlots which results the expected output without the fancy lighting. \documentclass[border=1cm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{colormaps} \usetikzlibrary{...


1

Okay thanks to Torbjørn T. for the comment. The answer to this problem is just alike "Single ampersand used with wrong catcode" error using tikz matrix in beamer i.e. Tikz and beamer sometimes don't agree on & being a column separator, so you just have to rename it with some other symbol, like \& ampersand replacement=\& then my code ...


2

A solution with a psmatrix for the tree. For the enumeration with Greek letters, I defined a \greek{counter} command, so the enumitem package accepts the key label=\greek*: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{pst-node} \usepackage{upgreek} \usepackage{enumitem} \makeatletter \def\@greek#1{% \ifcase#1\or% \ensuremath{\upalpha}...


5

Just like an exercise, I think that your graph is done with tikz-cd, but I can do some mistakes. You can draw also with istgame package, or with tikz tree/forest. \documentclass[a4paper,12pt]{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd}[row sep=1cm,column sep=2cm] & & & 103.68 \\ & & 86.4 \arrow[ru] \arrow[rd] & \\ &...


3

If you want to draw a CNN-related network with latex but feel overwhelmed with the 1000-page material to learn on latex, PGF, and Tiks, I would suggest you first visit PlotNeuralNet in Github and learn from some examples there. In addition to the example latex files, the project contains some python files to automate the code editing.


3

\documentclass[]{article} \usepackage{tikz} \usetikzlibrary{matrix,arrows,calc,math,shapes,arrows.meta,backgrounds,positioning} \begin{document} \begin{tikzpicture}[ terminal/.style={ rectangle, minimum size=1cm, text width=2cm, align=center, very thick, draw=...


3

Despite my comment, I gave a quick try to your problem. Here is a possible solution using TikZ: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{arrows.meta} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture} \tikzset{% block/.style = {% rectangle, ...


1

Does this help? \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,bending,automata,positioning} \begin{document} \begin{tikzpicture}[shorten >=1pt,node distance=4cm,on grid] \node[state] (c) {id}; \node[state] (a) [above left of= c] {$a$}; \node[state] (b) [above right of= c] {$b$}; \path[->] (a) edge [bend right=40] node[...


1

If you have a lot of that kind of figures, then the knot package should be used. The following is another suggestion. I draw by hand each curve and put some nodes in appropriate position. Code is explained itself (I hope!). \documentclass[tikz,border=5mm]{standalone} \begin{document} \begin{tikzpicture} \def\rcurv{(1,0)--++(90:1) arc(180:0:.5) arc(180:360:....


0

There's nothing really complicated. I just changed \import to \input and added \usepackage{graphicx} to preamble . The problem was \input is undefined control sequence without graphicx package. Thanks you all for help!


2

With TikZ. (do you want the boxes more fancy?) \documentclass[tikz,border=5mm]{standalone} \begin{document} \begin{tikzpicture}[thick,time/.style={minimum height=5mm,minimum width=6mm,fill=#1,text=white}] \def\k{1.5} \def\n{4} \def\r{6} \draw[teal,-latex] (0,0)--(\r+1,0); \draw[teal] (0,.1)--(0,-.1) node[below=2mm,time=teal]{$0$} (\k,.1) node[above=2mm,...


3

Since this is tagged with Metapost, here is an effort in MP. It's wrapped up in luamplib so you need to compile it with lualatex. \documentclass[border=5mm]{standalone} \usepackage{luamplib} \begin{document} \mplibtextextlabel{enable} \begin{mplibcode} beginfig(1); path timeline; timeline = origin -- 260 right; pair m[]; m0 = point 0 of ...


0

Typically, you would import maps from external source, as drawing "complicated" maps requires too much work in Tikz. One option is to pre-process it using, for instance, Inkscape. There is indeed another option to create high-quality geographic maps, that is using ncl or PyNgl. This facility: allows the greatest flexibility in drawing maps, using ...


0

As Andrew pointed out, sometimes you just need to shut up and read the documentation. So here's my solution in case this is of any use to anyone. The code below draws the top/bottom bars automatically as well as labels the bars appropriately. \documentclass[border=3mm]{standalone} \usepackage{tikz} \usepackage{calc} \usetikzlibrary{braids} \begin{document} ...


2

Another version of Asymptote path Heighwaydragon(pair A, pair B, int iteration=0, bool below=true) { path[] Path; if (iteration==0) { return A--B;} else { Path.push(Heighwaydragon(A,(below) ? rotate(90,relpoint(A--B,1/2))*A : rotate(90,relpoint(A--B,1/2))*B, iteration-1, (below) ? true : false)); Path.push(reverse(Heighwaydragon(B,(below) ? rotate(90,...


4

Here is one. Next time, please make sure your example is minimal, most of those packages are irrelevant. For this I've just adapted the example in the tikz-cd manual. Note that you of course cannot refer to the name of a node before it has been defined. \documentclass[12pt,reqno,a4paper]{amsart} \usepackage{mathtools} \usepackage{tikz-cd} \begin{document} \...


4

\documentclass{article} %\url{https://tex.stackexchange.com/q/549289/86} \usepackage{tikz} \usetikzlibrary{braids} \begin{document} \begin{tikzpicture} \pic[ braid/.cd, every strand/.style={ultra thick}, strand 1/.style={red}, strand 2/.style={red}, strand 3/.style={red}, strand 4/.style={green}, strand 5/.style={green}, strand 6/.style={...


0

Instead of vertex use node -- this is a bug as defined here --https://tex.stackexchange.com/a/532652/197451 \begin{tikzpicture} \begin{feynman} \vertex (i) {\(h_\lambda\)}; \node[right=1cm of i, crossed dot] (a);%<--------------------amend to node \vertex[right=2cm of a] (b); \vertex[right=1cm of b] (f) {\(h_\sigma\)}; \vertex[...


Top 50 recent answers are included