Tag Info

Hot answers tagged

10

Here is one way to do this. The interesting part is the use of pic to draw your little squares by defining a new "picture" called mysquare. These squares take two arguments: the colour and the label. The arguments MUST be given as {#1, #2} or tikz will complain with cryptic error messages. In particular, note that there needs to be a space after the comma! ...


8

Your analysis is right, factorial or ! only support integer numbers, the decimal part of real numbers is truncated. The following example defines a function facreal, which uses the Gamma function to calculate the factorials with real numbers as argument, see extensions of the factorial in Wikipedia and approximations for the Gamma function (Wikipedia). ...


8

Switch to the newer TikZ library arrows.meta. Then the bounding box calculation includes the arrow head: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture} \draw (0,0) circle [radius=1cm]; \draw [dashed] (-2.1,0) circle [radius=1cm] ; \draw [<-,thick] (-2.1,-1.4)--(0,-1.4) ; \draw (-1,-1.2) node ...


6

Here's one way to do what you want. I've adapted the code from this answer: Produce a list of prime numbers to draw the differences between each pair of primes in the way your drawing showed. The command will draw the differences between the primes putting 13 primes per row by default. This can be changed, as can the vertical space each row takes up. If ...


6

This can be done by tikz-cd, xy or pure pstricks and tikz. I introduced some dimensions (e.g. [-2\jot]). You may want to modify or delete them until the diagram fits your desired style. Here you are: % arara: pdflatex \documentclass{article} \usepackage{mathtools} \usepackage{tikz-cd} \makeatletter \DeclareRobustCommand{\rvdots}{% \vbox{ ...


5

Similar to LaRiFaRi, but with less dramatic length for the vertical arrows to the dots. The trick is to use mock rows and shortening row sep. \documentclass{article} \usepackage{tikz-cd} \newcommand{\cvdots}{\raisebox{-.4ex}[0pt][0pt]{$\vdots$}\mathstrut} \begin{document} \[ \begin{tikzcd}[row sep=1em] & C_{0,1} \arrow[dddl,dash] \arrow[r,dash] ...


5

You can use the rnd or rand pgf functions. rnd generates a pseudo-random number between 0 and 1 with a uniform distribution, and rand does the same between -1 and 1. Simply change the node declaration line with the following: \node [small-node] (n-\i\j) at (\i + 0.5*rand,\j + 0.5*rand) {};


5

You can do two things (apart from loading the TikZ library for arrows). You can add a border to the standalone by passing it through the \documentclass[border=10pt]... or you can enlarge the bounding box for the figure by adding something like \path (current bounding box.south) -- ++ (0,-10pt); as the last line in the environment. Additional comments ...


5

You can simply randomize the lengths of rising and falling edge locations \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \draw (0,0) --(1,0)|- ++(rnd,1) \foreach \x in {1,...,10}{-|++(rnd,-1) -| ++(rnd,1)} -| ++(rnd,-1); \end{tikzpicture} \end{document}


5

I was going to post a starting point, but at that point (sorry) I was almost done so I just finished it, not to mention this was your first post (please try to provide at least a code attempt and/or some data next time). Anyway, I'm not sure if the plots are exact because some lines "mix" in your graph and I don't know which goes where, but the end result ...


5

A combination of rotation and scaling does the job neatly in Metapost. prologues := 3; outputtemplate := "%j%c.eps"; beginfig(1); path re, im; re = origin -- right scaled 4cm; im = re rotated 90; drawarrow im; label.lft(btex $\mathop{\rm Im}(z)$ etex, point 1 of im); drawarrow re; label.bot(btex $\mathop{\rm Re}(z)$ etex, point 1 of re); z1 = ...


5

The radius, the start and end angles for the arc command can be calculated, see the following example. (Update:) For the red "spiral" line I have used the plot function with a polar coordinate. The length of the polar coordinate linearly increases with the angle going from point (z) to (a): \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} ...


5

Does this do the trick? \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{arrows.meta} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture}[aeang/.style={red,#1}] \draw[->] (-1,0) to node [auto]{$f$} (1,0); \draw (-5,-1) node(0)[label=below:{$v_0$}, circle,fill=black,scale=0.3]{}; \draw (-2,-1) ...


4

Another try with MetaPost, inspired by Thruston's solution, but using the zscaled operator of MetaPost which is in fact the complex multiplication. Also, I have incorporated it in a LuaLaTeX program, as I use to do. \documentclass[border=2mm]{standalone} \usepackage{luamplib, amsmath} \begin{document} \begin{mplibcode} beginfig(1); r = 1.3; ...


4

I don't know circuittex, but here is a solution utilizing the tikz library circuits. \documentclass{article} \usepackage{tikz} \usetikzlibrary{circuits.ee.IEC} \begin{document} \begin{tikzpicture}[circuit ee IEC] \path node [contact] (A) {} ++(right:2) node [contact] (B) {} ++(right:2) node [contact] (D) {} ...


4

pre length is already added, therefore the left arrow looks fine, post length fixes the right arrow head. The following example also centers the arrow around the math axis: \documentclass{article} \usepackage{tikz} \usetikzlibrary{ calc, decorations.pathmorphing, shapes, arrows.meta } \newcommand\xlrsquigarrow{% \mathrel{% \vcenter{% ...


3

A bit unfriendly in places, but it pretty much does the job... \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture}[x=1.5cm,y=1.25cm,>=stealth] \foreach \i [count=\y] in {0,1,\vdots,k} \foreach \j [count=\x] in {1,2,\ldots,n-1} \node (C-\y-\x) at (\x,-\y+2.5) {$\ifnum\y=3\ifnum\x=3\else\i\fi\else\ifnum\x=3\j\else ...


3

You can use decorations \documentclass[tikz]{standalone} \usetikzlibrary{decorations.markings} \begin{document} \begin{tikzpicture} \path[decoration={ markings, mark={between positions 0 and 1 step 0.1 with={\draw (0,0) circle (2mm);}} },decorate] (0,0) arc (90:-40:2cm); \end{tikzpicture} \end{document}


3

You can define the curve using a pic and then place that repeatedly using a \foreach loop. Here's an example using the shape from http://commons.wikimedia.org/wiki/File:EKG_Complex_en.svg, converted to TikZ code using SVG2TikZ: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[line join=round, x=2pt, y=-2pt] \tikzset{ ...


3

Perhaps this will work for you: \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage{tikz} \usetikzlibrary{calc} \newcommand\aelastnode{\coordinate (lastnode);} \newcommand{\PR}[1]{ \draw (lastnode) -- ++(#1,0) coordinate (lastnode);} \newcommand{\QRS}[2]{ \draw (lastnode) -- ++(#2/2,#1) -- ++(#2/2,-#1) coordinate (lastnode);} ...


3

Saving your border as ZmI9O.jpg, and employing my answer referenced in my comment, I only had to adjust the filename, paper (aspect), scale, and the offset to create a letter using your border. Upon EDIT, I used the geometry package to show how to set the margin to fit the border, and changed the hook from "Thispage" to "Everypage", so that the border would ...


3

Here is a circuitikz solution. You may like the circuitikz input format but not like the shapes/sizes of the components; in that case, there are many options described in the package manual and in the code if you wish to explore and do some tweaking for your own circuit diagrams. \documentclass{standalone} \usepackage[ europeanresistors, ...


3

I'm not sure if this is entirely what you're after, but I'm posting it as an answer for now because I had to correct other parts of your code for this to work, so it's easiest to show this way. I'll delete the answer if this is not an acceptable solution. A quick way to make this work as you're expecting is to simply put the full path of the key (for your ...


3

A short code with pstricks and etoolbox: \documentclass[pdf, x11names, a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[charter]{mathdesign} \usepackage{etoolbox} \usepackage{pstricks-add} \begin{document} \begin{pspicture}$ \psset{xunit=2.5, tickstyle=top, ticksize=6pt, tickwidth=0.6pt, labels=none, labelsep=4pt, ...


3

Found it. Try this: \begin{tikzpicture} \foreach \x in {1,...,18} \draw[thick] (4.5,1.5) to [bend angle = 2*\x, bend left] (3+0.5*\x,-1) node [below]{\tiny\x}; \draw[thick, red] (4.5,1.5) to [bend angle = 36, bend left](3+0.5*18, -1) node [below right]{\tiny E}; \end{tikzpicture} you have: But with changing the red line with: ...


3

You can implement a slightly better control over your bend angle such that the homotopy is between zero and 36 degrees relative. Then you can use it for the in,out keys. The only change in the code is \foreach \x[evaluate={\xc={(36/17)*(\x-1)};}] in {1,...,17}{ \draw[thick, dashed] (4.5,1.5) to [out=\xc,in=180-\xc,relative] (3+0.25*\x,-1); } Note that ...


3

You can start with this and add/remove different items \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[c/.style 2 args={insert path={node[n={#1}{#2}] (n#1#2){}}}, n/.style 2 args={circle,fill,inner sep=1pt,label={90:$D(#1,#2)$}} ] \path (-2,4.5)[c={1}{1}]; \foreach\y in{1,...,8}{ \draw (n11) -- (2,\y)[c={2}{\y}] -- (4,\y) [c={3}{\y}] ...


3

Since it is a tree, you should have a forest... \documentclass[tikz,border=5pt,multi]{standalone} \usepackage{forest} \begin{document} \begin{forest} delay={ for tree={ grow'=0, l sep+=50pt, circle, minimum width = 2.5pt, fill, inner sep = 0pt, parent anchor = center, child anchor ...


3

I changed your base code a bit because it was easier for setting the steps in the sheet. If you have any doubts, just ask me in the comments. I wanted to set the top nodes using a \foreach and I was almost there, but unlike the numbering above, the top-top nodes have no logic in their succession, if you know what I mean, so I couldn't think of a rules to ...


2

From showed your desired picture, I gues that you looking for something like this: This picture I obtain with: \documentclass{article} \usepackage[letterpaper,textwidth=8.5in,textheight=11in]{geometry} \usepackage{lscape} \usepackage{tikz} \usetikzlibrary{fadings} \tikzfading[name = fondu, left color = transparent!0, ...



Only top voted, non community-wiki answers of a minimum length are eligible