New answers tagged

2

For your image you not to need define their coordinates separately: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture} \node (a) [circle,draw] at ( 0, 0) {a}; \node (b) [circle,draw] at (-1,-1) {b}; \node (c) [circle,draw] at ( 1,-1) {c}; \draw[-] (a) to (b); \draw[-] (a) to (c); \end{tikzpicture} \end{document} If ...


1

You can define the background color in the options for the tikzcd environment. This color will then be used for crossing over. As you did not provide a minimal working example, I use the example from the documentation of the tikz-cd package: \documentclass[border=1mm]{standalone} \usepackage{tikz-cd} \pagecolor{yellow} \begin{document} \begin{tikzcd}[row ...


0

I think you will have to fiddle at least a bit with the coordinates, as you have to tell your red line that the grid has a line width of 1pt: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[line width=1pt, step=1, line cap=rect] (1,1) grid (4,2); \draw[line width=2pt,red,yshift=2,shorten >=-0.5pt,shorten <=-...


1

As daleif already stated in his (several) comments: After removing all the (spelling) errors, the MWE works as expected ... % used PGFPlots v1.16 \begin{filecontents*}{HeightsAndWeights.csv} Peter, 150, 45 Jason, 134, 39 Stefan, 139, 41 Noa, 132, 38 Liv, 137, 36 Beti 135, 34 \end{filecontents*} \...


2

Compute the function value at 2-adic fractions. You can do this by the following: f(1/2) = a do induction on n: for 0 ≤ k < 2^{n-1}: f(k/2^n) = f(k/2^{n-1})*a for 2^{n-1} ≤ k < 2^n: f(k/2^n) = f((k-2^{n-1})/2^{n-1})*(1-a)+a So you got the following tex code. The \pgfkeys here acts as data array. The \pgfpath part plot the data ...


1

A straightforward way of doint this would be to provide a table (instead of coordinates) and add another column with the stuff you want to show in the nodes near coords. For details please have a look at the comments in the code. % used PGFPlots v1.16 \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{ % use this `compat` ...


2

Here's a solution using the sagetex package, which gives you access to a computer algebra system and Python programming. \documentclass{article} \usepackage{sagetex} \usepackage[usenames,dvipsnames]{xcolor} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \begin{document} \begin{sagesilent} def LSF(binexp): a = .6666 L = [0] U = [1] M = [1] ...


3

You can do coordinate calculations with the calc library (not package). That way you do not need to store the coordinates in macros, you can always extract them if you have named the coordinates or nodes. Repeating actions can be stored in a pic. \documentclass[aps,pra,reprint,superscriptaddress, usenames,dvipsnames]{revtex4-1} % \usepackage{tikz} % TikZ ...


0

I mixed answer by Schrödinger's cat and response in similar question This gives: \documentclass[tikz]{standalone} % BEGIN section 1 \usepackage{tikz} \usetikzlibrary{calc, positioning,fit,decorations.pathreplacing} % END section 1 \begin{document} % BEGIN section 2 \begin{tikzpicture}[scale=1] \tikzset{ pics/circle vertically split/.style 2 args = { ...


7

Add \coordinate (a) at (2,\pgfkeysvalueof{/pgfplots/ymax}); in the first axis environment and \coordinate (b) at (2,\pgfkeysvalueof{/pgfplots/ymin}); in the second. Then after the last \end{scope}, add \draw [dashed] (a) -- (b);. As a sidenote, you might be interested in the groupplots library for aligned axes like this. \documentclass[12pt,a4paper]{...


2

How about this? \documentclass[tikz,border=3.14mm]{standalone} \usetikzlibrary{arrows.meta,bending,calc} \begin{document} \begin{tikzpicture}[lbl/.style={circle,draw,inner sep=1pt},>={Latex[bend]}] \draw[dashed,thick] (0,2.5) coordinate(T) (-1,0) coordinate(BL) -- (0,0.5) coordinate(B) edge (T) -- (1,0) coordinate(BR); \draw[<-] ($(T)!0.5!(BL)$) ...


0

Consider using sane_tikz. See below for the code. import sane_tikz as stz label_spacing = 0.25 tick_label_spacing = 0.25 tick_length = 0.25 segment_spacing = 0.6 length_multiplier = 0.8 def segment(length, label_str, left_tick_label_str, right_tick_label_str): seg = stz.line_segment([0, 0], [length, 0]) left_tick = stz....


2

All of them work (in the sense that there are no error messages) if you add the missing semicolons to terminate the paths. You need a semicolon since \pic starts a path, and in TikZ paths are to be terminated by a ;. %%%%%%%%%%%%%%%%%% INTRODUCTION %%%%%%%%%%%%%%%%%% \documentclass[border=10pt]{standalone} %%%%%%%%%%%%%%%%%% PACKAGE %%%%%%%%%%%%%%%%%% \...


3

Welcome! You can switch the 0\pi off as follows. \documentclass[tikz, border=5mm]{standalone} \usetikzlibrary{datavisualization.formats.functions, arrows} \def\mytypesetter#1{ \pgfkeys{/pgf/number format/precision=2} \pgfmathparse{#1/pi} \pgfmathroundtozerofill{\pgfmathresult} \pgfmathifisint{\pgfmathresult}{\pgfmathtruncatemacro{\itest}{\...


2

You can reuse Schrödinger's cat's style for bent arrows. This style gives good results even on curved paths and accepts an optional argument, defaulting to 0.5 (= middle), to indicate where the arrow should lie on the path on which it is placed. With this style, the arrow can be drawn with simply: \draw[attach arrow] (a2) -- (a5); You may specify attach ...


1

Use tikz-euclide package. \documentclass[a4paper,12pt]{article} \usepackage{amsfonts} %\usepackage{amsbsy} \usepackage{amssymb} \usepackage{amsmath} %\usepackage[a4paper, total={6in, 8in}]{geometry} \usepackage{graphics} \usepackage{tikz} \usepackage{tkz-euclide}% Newly added package \usepackage{amsthm} \usepackage{hyperref} \usetikzlibrary{decorations....


5

You're almost there; you just need to add \raggedright and \\. \documentclass[]{article} \usepackage{tikz} \usepackage{setspace} \usetikzlibrary{positioning} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture}[x=1.0cm, y=1.0cm] \node[circle, draw=red] (aa) at (0,0) {}; \def\myreference{References: \\ {\centering Kim, ...


6

This defines such shapes. Note that I did not really simplify positioning too much because probably you want some macros for the dialogue. They can take care of that. The following code is based on the newly added routines of your question. However, rather than defining many macros, it uses pgf keys. For instance, instead of \MeStart{\blindtext[1]\\ Text} ...


5

Something like this? \documentclass[]{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture}[x=1.0cm, y=1.0cm] \node[circle, draw=red] (aa) at (0,0) {}; \def\myreference{References: \\\hfill Kim, et. al., May 2019\hfill\mbox{}} \node[align=left, draw=...


2

One way is to use titlesec. That way you can use ordinary \section commands for that purpose. This has various advantages (table of contents, hyperlinks, ...). You then only need to type \section{I am a cat} Example \newpage \section{You are a duck} Another example in the body of your document. \documentclass{article} \usepackage[a4paper,margin=1in,...


1

The distance is different because the last bent arrow connects to a coordinate while the others connect to nodes with a nontrivial inner sep (and outer sep). The perhaps easiest way to rectify this is to give the node also a name, and use it (rather the coordinate) in the arc path: \coordinate (label_for_ellipses) at ($(first_ellipses) +(0,-0.25)$); \node[...


3

Your pics nest tikzpictures, i.e. if you define a pic you no longer need \begin{tikzpicture} and \end{tikzpicture}. In fact, if you keep them, you may get to see uncontrollable side effects. On way of arranging these three root lattices and the text in a table is to use a built-in matrix (which does not require the library of the same name). \documentclass[...


3

There are many ways of doing this. Some want to define pics to avoid some of the repetition. \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath} \usepackage{subcaption} \usepackage{tikz} \usetikzlibrary{calc,matrix,fit} \tikzset{pics/grid/.style={code={\tikzset{wonderich/.cd,#1} \def\pv##1{\pgfkeysvalueof{/tikz/wonderich/##1}}...


5

Before \end{tikzpicture} insert the following: \node[draw, text width=0.25\linewidth,inner sep=2mm,align=left, below left] at (current bounding box.north east) {In each step of the expanding simple graphs, the vertices are labeled with a fraction and an \textit{a}-label. The fraction is a Farey Fraction; it is typeset above each vertex. }; ...


4

Here is a very simple approach: \documentclass{article} \usepackage[a4paper,margin=1in,footskip=0.25in]{geometry} \usepackage{tikz} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \rfoot{ \begin{tikzpicture}[remember picture,overlay] % From https://tex.stackexchange.com/a/443744/152550 \fill[black] (current page.south west) rectangle ...


6

How about \documentclass{article} \usepackage[a4paper,margin=1in,footskip=0.25in]{geometry} \usepackage{tikz} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \rfoot{ \begin{tikzpicture}[remember picture,overlay] \fill[black] (current page.south west) rectangle ++(\paperwidth,1.5cm) node[midway,align=center,font=\LARGE\bfseries,text=...


4

Here is a solution with the text effects along path option of the decorations.text library. I increased the gap, you can manage it by changing the character widths={inner xsep=1pt} option. \documentclass[border=2mm,tikz]{standalone} \usetikzlibrary{arrows, decorations.text} \tikzset{>=latex} \begin{document} \begin{tikzpicture}[decoration={ ...


3

I will add the worst answer here because I don't like diagrams with many curved arrows or that g_2 is so close to g_3. \documentclass{article} \usepackage{mathtools} \usepackage{amssymb} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} & \mathbb{R}^3\\ W\ar{ru}{g_1}\ar[dashed]{r}[description]{g}\ar{rd}[swap]{g_2}\ar[out=270,in=270]{rrr} & \...


4

As supplement to @Schrödinger's cat's answer. Added are vertical lines labeled P_{r_1} and P_{r_2} (which are shown in OP image but not in his answer) and made some small changes in image code: \documentclass[margin=3mm,varwidth]{standalone} \usepackage{tikz-cd} \usepackage{amssymb} \begin{document} \[ \begin{tikzcd}[row sep=huge, /tikz/column 2/.style=...


6

This is a small variation of this answer. One thing that requires a bit attention is the left-aligned column, which one gets with /tikz/column 2/.style={nodes={align=left,text width={width("$\realR^3=\realR\times\realR\times\realR$")}}} Code (with two different double-stroke R's) \documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} \...


2

If you do computations that involve some parentheses, you need braces. I also do not think you need $ here since you just use polar coordinates (and do not use coordinate computations a la calc). \documentclass{article} \usepackage{tikz} \usepackage{tkz-euclide} \usetikzlibrary{calc,patterns,angles,quotes,intersections} \tikzset{bullet/.style={circle, fill,...


4

Here I create a tokcycle package macro \spaceouttext{gap}{text} that, when invoked, creates the desired tokens in the package's token register named \cytoks. Thus, do the invocation prior to the \draw and pass \the\cytoks as the textual argument. \documentclass[border=2mm]{standalone} \usepackage{tikz,tokcycle} \newcommand\spaceouttext[2]{% \tokcycle{\...


2

You can compose such figures using Graphwiz and the dot2tex Python script converter. The dot2texi package allow you to call dot2tex from within the tex source code, using -shell-escape or -enable-write18 compiling option. Here is is the source code which can produce this figure. \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \...


2

You can just decrease the initial distance and use arrows.meta to add a largish arrow. \documentclass[tikz,border=3mm]{standalone} \usetikzlibrary{automata,arrows.meta} \begin{document} \begin{tikzpicture}[ every initial by arrow/.style={-{Straight Barb[length=5pt,width=6pt]}}, initial distance=0.01cm,initial text={}] \node[state,initial] {$q_0$}; \...


1

You can use local bounding boxes to connect these jigsaw pieces. \documentclass{scrartcl} \usepackage{tikz} \usepackage{jigsaw} \begin{document} \begin{tikzpicture} \begin{scope}[local bounding box=piece1] \piece{1}{-1}{0}{0} \end{scope} \begin{scope}[local bounding box=piece2,yshift=-2cm] \piece{1}{-1}{0}{0} % below of piece 1 \end{scope} \path (piece1....


2

The correct way apparently is to place it in a scope environ for each piece if you want run additional tikz commands -- the (very short)manual is available at -- http://ctan.math.washington.edu/tex-archive/graphics/pgf/contrib/jigsaw/jigsaw-doc.tex MWE \documentclass{scrartcl} \usepackage{tikz} \usepackage{jigsaw} \begin{document} \begin{tikzpicture} \...


1

This may interest you -- from the pgf manual chapter on decoration.markings at page 646 -- link--> http://ctan.imsc.res.in/graphics/pgf/base/doc/pgfmanual.pdf Position and color can be adjusted as per your choice -- this is only a rough draft \documentclass{article} \usepackage{tikz} \usetikzlibrary{automata, decorations.shapes, shapes.geometric} \begin{...


6

What you are trying to achieve is called letterspacing, and one possibility would be to use the microtype package: It provides the commands \textls[<letterspacing amount>]{<text>} and \lsstyle. Since it doesn't seem to be possible to typeset text in the decoration if it appears inside an argument (or at least I couldn't find out how), only the ...


0

I have found other solutions too. Just post here for future reference. \usetikzlibrary{calc,angles,quotes} \begin{document} \begin{tikzpicture} \tkzTabInit[lgt=1.5,espcl=3,deltacl=0.5] {$x$/.6, $f_{\alpha}'(x)$/.6, $f_{\alpha}(x)$/2.5} {$0$,$\alpha-1$,$x^*(\alpha)$,$+\infty$} \tkzTabLine{,+,z,-,-,-,} \draw ($(N12)!0.5!(N13)$) node (A){$0$} (N22) node[below] ...


6

I think plain TikZ is not so difficult as OP complained ^^ What does plain mean? SIMPLE! Change [yscale=.8,xscale=1.4] as you wish! \documentclass[tikz,border=5mm]{standalone} \begin{document} \begin{tikzpicture}[yscale=.8,xscale=1.4] \draw[shift={(-.5,.5)}] (0,0) rectangle +(8,-5) (0,-1)--+(0:8) (0,-2)--+(0:8) (1,0)--+(-90:5); \path (0,0) node{$x$} ...


5

I used the intermediate tab value command from page 33 of the manual \tkzTabVal{2}{3}{0.5}{$x^*(\alpha)$}{0} the {2}{3} refers to the column precedent and antecedent and 0.5 on the sloped line -- -- a second negative/descent/derivative is provided with the help of intermediate entries-- these intermediate entries are not shown with a column heading of - ...


2

I am very far from claiming that this is the "optimal" solution, but it is certainly possible to add a few ingredients to your code to make the result come very close to the desired screen shot. \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.16} \begin{document} \begin{tikzpicture} \begin{axis}[width=0.8\textwidth, axis ...


1

You could use preaction or postaction \documentclass[border=1mm]{standalone} \usepackage{tikz} \usetikzlibrary{arrows, decorations.text} \tikzset{>=latex} \begin{document} \begin{tikzpicture} \draw[->, cyan!50!white, line width=1.5mm,preaction={decoration={text along path, text={|\sffamily|gather},text align={center},raise=0.2cm},decorate} ] (6.8cm,-1....


1

This is what postaction is for. You just need to put the argument of the second \draw[...] command into postaction={...}, and add this to the first path. \documentclass[border=1mm]{standalone} \usepackage{tikz} \usetikzlibrary{arrows, decorations.text} \tikzset{>=latex} \begin{document} \begin{tikzpicture} \draw[->, cyan!50!white, line width=1.5mm,...


6

You can recursively define a macro that picks up a new decorate on each page. This is done with \xdef\MyDeco{decorate{\MyDeco}} in \documentclass[10pt]{article} \usepackage{fancyhdr} \usepackage{tikz} \usetikzlibrary{decorations.fractals} \setlength\headheight{16pt} \renewcommand\headrule{% \vspace{-0.75in} \hrulefill {\tikz[decoration=Koch ...


1

Quick hack: by adding an invisible character the same height as V and the same depth as gy but zero width. \vphantom{Vgy} See: How do I create an invisible character? \documentclass[border=1mm]{standalone} \usepackage{tikz} \usetikzlibrary{matrix} \def\h{0.55cm} \def\w{1.5cm} \tikzset{ myboxshape/.style={rectangle, outer sep=0, minimum width = \w, ...


1

I would define node's style in matrix option. For desired vertical align I would in node's style define node anchor, text depth and text height: \documentclass[tikz, border=1mm]{standalone} \usetikzlibrary{matrix} \def\h{5.5mm} \def\w{15mm} \begin{document} \begin{tikzpicture} \matrix (m) [matrix of nodes, nodes={draw, very thin, inner sep=...


1

E.g. adding text depth=0.25ex,text height=0.8em yields \documentclass[border=1mm]{standalone} \usepackage{tikz} \usetikzlibrary{matrix} \def\h{0.55cm} \def\w{1.5cm} \tikzset{ myboxshape/.style={rectangle, outer sep=0, minimum width = \w, minimum height = \h, inner sep=0}, mybox/.style={myboxshape, very thin, draw,text depth=0.25ex,text height=0.8em}, } ...


1

Another way with plain TikZ: the firuge is just one \path attaching with four nodes and connecting with arrows. The code is long and easy to read. \documentclass{article} \usepackage{tikz,amsmath,amssymb,lipsum} \begin{document} \lipsum[1] Define $\bar\mu\colon [0,2\pi]\times [-1,1]\to \mathbb{R}^3$ with some formular as $\mu$. \[ \begin{tikzpicture} \...


2

Here is the code I wrote in Asymptote language. size(200); int L = 12; int H = 5; picture picGuide; picture picNormal; picture picModify; guide g = (0,0){right}..(4,2){right}..(7,2){right}..(11,0){right}; real lengthOfGuide = length(g); draw(picGuide, g, red); pair NoTransform(pair p) { return p; } pair MyTransform(pair p) { pair offset = point(...


Top 50 recent answers are included