Tag Info

New answers tagged

0

This is a solution for tikz. Since the OP did not provide style code for bag and levels, this solution plays a bit to find them. To find coordinates for t=0,1,2, this solution labelled nodes (1,1), (1/2,1/2), and (1/4,1/4) respectively with a, b, c and then use orthogonal coordinate to find the positions for t=0,1,2. (Please see the last 3 lines of code.). ...


2

Because why not ? :P \documentclass[tikz]{standalone} \usetikzlibrary{plotmarks} \begin{document} \begin{tikzpicture} \def\dx{1cm}\def\mylista{}\def\mylistb{} \foreach \x in {0,1,2}{ \foreach \y in {.5,1.5}{ \xdef\mylista{\mylista (\x,\y)}\xdef\mylistb{\mylistb (\y,\x)} } } \draw[thick,red,double distance between line centers=\dx,double=orange!40] ...


2

Something like this? \documentclass[tikz]{standalone} \newcommand{\nvar}[2]{ \newlength{#1} \setlength{#1}{#2} } \nvar{\dx}{1cm} \begin{document} \begin{tikzpicture} \path [draw=red, thick, fill=orange!40, even odd rule,] (-1,-1) rectangle (3,3) (0,0) rectangle (2,2); \draw [semithick][help lines, step=\dx] (-1,-1) grid ( 3, 3); \draw ...


4

Insert the code below at the end of the tikzpicture environment (just before \end{tikzpicture}). \foreach \a in {.5,1.5}{ \foreach \b in {0,1,2}{ \node at (\a,\b){$\otimes$}; \node[green] at (\b,\a){$\times$}; } }


2

One way to space out the tree in forest is to increase the minimum distance between the siblings. As mentioned above, fit can also be used to adjust the spread. \documentclass{standalone} \usepackage{forest} \usetikzlibrary{positioning} \begin{document} \begin{forest} for tree={grow=0,l=3cm,anchor=west,child anchor=west, s sep+=10pt} [{$(1, 1)$}, ...


2

You can count how many elements there are in one of the arrays and use that number as the foreach limit. Then every spin accesses one element of the arrays; \documentclass[tikz]{standalone} \def\firstlist{{0,1,2}} % <== Notice the double brace for array notation \def\secondlist{{0,1,2}} \newcommand{\testa}{ \pgfmathdim{\firstlist}%Get the number of ...


2

I'm not sure exactly what kinds of suggestions you are looking for since, as others have said, your existing code is already impressive. I fiddled a little to get this working with the background package and to try to make it a bit more flexible. The code uses 2 commands: \CornerOrn{} and \OtherOrn{} each take 1 argument specifying the relevant ornament. ...


2

I'm not so sure you want to do it. ;-) \documentclass{article} \usepackage{xparse} \def\xforeach#1#{\xforeachaux{#1}} \ExplSyntaxOn \NewDocumentCommand{\xforeachaux}{mm} { \carlitos_xforeach:nn { #1 } { #2 } } \seq_new:N \l_carlitos_xf_first_seq \seq_new:N \l_carlitos_xf_second_seq \seq_new:N \l_carlitos_xf_list_seq \cs_new_protected:Npn ...


3

Borrowing from Bruno's definition of \slantbox at Shear transform a "box", I was able to construct the following, using simple stacks of \fcolorboxes. The perspective is completely determined by three parameters: \myrotate (the baseline rotation), \myslant (the slant magnitude or fallback parameter), and the short-stacking gap. First, I ...


3

The problem is that labels are also nodes, and it seems that fancytikzposter defines a default node shape which is used everywhere (even in labels) which has two parts, one above for the "title" and other below for the "content". When you write label={foo} a node is created with "foo" as title and empty space as content. It is this empty space which ...


4

I would (and I do) cite it as a @manual: @manual{tantau:2013a, author = {Till Tantau}, title = {The TikZ and PGF Packages}, subtitle = {Manual for version 3.0.0}, url = {http://sourceforge.net/projects/pgf/}, date = {2013-12-20}, } The same goes for other packages.


13

In my proposed solution, the picture is put into a macro \mypicture which takes rectangle coordinates as parameters. These are used to set the bounding box and clip the picture. This macro is used twice for displaying the picture. Here, I used some overlap between the two parts of the long picture but this can be adjusted easily. \documentclass{article} ...


1

Specifically for TikZ, I would recommend citing the following formally archived peer-reviewed article. @inproceedings{Tan12, author = {Tantau, Till}, title = {Graph Drawing in {TikZ}}, booktitle = {Proceedings of the 20th International Conference on Graph Drawing}, series = {GD'12}, year = {2013}, isbn = {978-3-642-36762-5}, ...


3

Use find/replace with Regular expressions (feature of editor, not of TeX) to replace any occurrence of ''fill=colorx,'' with ''fill=colorx,draw=colorx,''. In Winedt I just confirmed that searching for fill=\(*\), and replacing with fill=\0,draw=\0, will turn \node[fill=red,rectangle]at (0,0){test};% into \node[fill=red,draw=red,rectangle]at ...


6

You can define your own parameterized style to do this, with \tikzset{drawandfill/.style={draw=#1,fill=#1}} Complete example: \documentclass[tikz]{standalone} \begin{document} \tikzset{drawandfill/.style={draw=#1,fill=#1}} \begin{tikzpicture} \node[rectangle,drawandfill=red] at (0,0) {test}; \node[rectangle,fill=red,draw=red] at (1,0) {test}; ...


3

I doubt that you want the fill and draw colour to be the same as you won't see anything! Here's an example (the drawing colour is just give as the node colour and the fill colour is specified with fill=...): \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[blue,fill=red, rectangle]at (0,0){test}; ...


4

It can be nicer if you remove the middle points of the two curves and adjust the angles slightly as follows: \documentclass[tikz,border=2mm]{standalone} \begin{document} \begin{tikzpicture}[xscale=0.9] \shadedraw[shading=axis] (0,0) to[out=20,in=160] (10,0)--(10,0.5) to[out=160,in=20] (0,0.5)--cycle; \draw(5,1.25) circle[x radius=1.5mm, y radius=2.5mm]; ...


4

You can start with something like this. \documentclass[tikz,border=2mm]{standalone} \begin{document} \begin{tikzpicture} \shadedraw[shading=axis] (0,0) to[out=15,in=180] (5,1) to[out=0,in=165] (10,0)--(10,0.5) to[out=165,in=0] (5,1.5) to [out=180,in=15] (0,0.5)--cycle; \draw(5,1.25) circle[x radius=1mm, y radius=2.5mm]; \end{tikzpicture} \end{document}


2

Just for fun with PSTricks. \documentclass[pstricks,border=15pt,12pt]{standalone} \usepackage{pst-node} \degrees[5] \psset{radius=12pt,arcsep=36pt,arrows=->} \begin{document} \begin{pspicture}[showgrid=false](-4,-4)(4,4) \foreach \i in {1,2,...,5}{\rput(4;\the\numexpr\i-1){\Circlenode{N\i}{\the\numexpr\i-1}}} \foreach \i in ...


5

Complement to Claudio's answer without additional variables, for not so complicated arithmetic, you can use eTeX's \numexpr but to make it work in the math mode in terms of expansion, you need to add \number in front of it. {$\number\numexpr\s-1\relax$}; For the remaining parts you can do the math computation via pgfmath engine. ...


11

To number objects from 0 up to value n-1, it is possible to use evaluate or count keys. Both are illustrated in the pgfmanual while explaining foreach operation. An example with the latter: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \def \n {5} \def \radius {3cm} \def \margin {12} % margin in angles, depends on the ...


4

This is an attempt. Only one ; is needed at the end of \path command. Also an oval is added to circle the Patch H and the single line between (A) and (D) is changed to depict lines in the crude image. Code \documentclass[letter,10pt]{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{automata,arrows,positioning,calc} \begin{document} ...


4

knot and double don't work together because the double mechanism is how knot overwrites any underlying paths: it uses double with the sidelines set to the background colour and the central colour the main colour (this is opposite to how double is intended to be used). If you want the main path to itself be doubled then you need to draw the path three times: ...


4

The knot style makes the path a "doubled" path, only unlike a usual doubled path then the outside part is set to the background and the inside set to the desired colour. This is what allows a knot path to "punch through" another path. As this is not the usual way of using the double style, the arrow head is picking up the wrong colour (and thickness) from ...


1

Another solution with tikz, as requested. The problem with the linked answer is that the arguments to the atan function in the pgf low-level layer have been reversed. Switching the arguments inside the wavy semicircle definition solves that issue. Code for the styles borrowed from here. \documentclass{standalone} \usepackage{tikz} ...


5

A bit enhanced circular clipper with PSTricks. \documentclass[pstricks,border=12pt,dvipsnames]{standalone} \usepackage{graphicx} \usepackage{multido} \newsavebox\IBox %\savebox\IBox{\includegraphics[scale=3]{example-grid-100x100pt}} \savebox\IBox{\includegraphics[width=6cm]{golum}} \def\HColumns{10} %half columns \def\HRows{10} %half rows \psset { ...


11

Here is another frog solution which also uses path picture beneath. If you don't mind loading tcolorbox for this purpose, you can use its fill overzoom image option for TikZ. This option takes a picture file name as parameter (here frog.jpg again) and scales this image to fit into (or better: over) the shape: \documentclass[border=5mm]{standalone} ...


6

Another solution using forest package. The code for nice empty nodes is adapted from example 81 in forest documentation. \documentclass[tikz, border=3mm]{standalone} \usepackage{forest} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \forestset{ nice empty nodes/.style={ for tree={calign=fixed edge angles}, delay={where ...


5

You are supposed to put the edge from parent operation at the end of the corresponding child path declaration, like in the following : \begin{tikzpicture}[-,>=stealth',level/.style={sibling distance = 3cm, level distance = 1.5cm}, leaf/.style={circle, draw}, label/.style={red},edge from parent path={(\tikzparentnode.south) -- (\tikzchildnode)}] ...


7

Since I could not find writelatex's frog.jpg, I'm using the Masked tree frog head from Charlesjsharp on Wikimedia... I like the approach of using clip, since one can then clip the image with lots of different shapes... \documentclass{article} \usepackage{graphicx} \usepackage{tikz} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} ...


2

run with xelatex \documentclass{article} \usepackage[svgnames]{pstricks} \begin{document} \begin{pspicture}[showgrid=false](-0.11,0)(1,5) \psset{linecolor=IndianRed,doubleline} \psecurve(0,0)(0,1.99)(0.2,2.4)(0.5,2.7)(0.8,2.7)(0.9,2.49)(0.9,2) \psecurve[border=1pt](0.9,3)(0.9,2.51)(0.8,2.3)(0.5,2.3)(0.2,2.6)(0,3.01)(0,5) \psline(0,2.01) \psline(0,3)(0,5) ...


1

A "poor man" solution: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node(a)[circle,fill=blue,minimum size=3cm]{}; \draw[line width=1pt,red,line cap=rounded] (a.180)to[bend left=45](a.90); \draw[line width=1pt,red] (a.170)to[bend left=45](a.80); \draw[line width=1.5pt,red] (a.160)to[bend left=45](a.70); \draw[line ...


26

You can use path picture key. \documentclass[tikz,border=5mm]{standalone} \begin{document} \tikz\node[circle,draw, text=white, path picture={ \node at (path picture bounding box.center){ \includegraphics[width=3.5cm]{frog} }; }]{I'm watching you!}; \end{document} Image is ...


3

Based on a search for matrix I came up with this: It's not the most beautiful solution, but is close to your pic. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes, arrows, calc, positioning,matrix} \tikzset{ data/.style={circle, draw, text centered, minimum height=3em ,minimum width = .5em, inner sep = 2pt}, empty/.style={circle, text ...


6

Just for fun, with feynmp and egreg's feynmp-auto. If on MikTeX or TeX Live 2012 or earlier, compile with --shell-escape (or --enable-write18) as command-line options. All manual positioning (\fmfforce commands) is done to match your sample, but the positions can be computed automatically by leaving these out. \documentclass{standalone} ...


3

Another (possibly better) complete solution using intersections and calc libraries with the aid of a \foreach construct can be as follows: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc,arrows,positioning,intersections} \begin{document} \def\dis{1cm} \begin{tikzpicture}[line width=0.7pt,>=latex',node distance=\dis] \node (o) at ...


9

Load the amsmath package to enable \binom{}{}. Making use of this answer here \documentclass[tikz,border=5]{standalone} \usepackage{amsmath} \usepgflibrary{fpu} \begin{document} \def\N{10} \tikz[x=0.75cm,y=0.5cm, pascal node/.style={font=\footnotesize}, row node/.style={font=\footnotesize, anchor=west, shift=(180:1)}] \path \foreach \n in ...


3

Partial solution (using tikz) \documentclass{report} \usepackage{amsthm,amsmath,amssymb} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node at (0,0) {$\ast$}; \foreach \r in {1,2,...,6}{ \draw (-6,-\r)--(6,-\r)node[right]{$v_{\r}$}; %\draw (-135:\r) circle (1pt); \draw[thick] (-135:1.2*\r) arc (-135:-45:1.2*\r); } \end{tikzpicture} ...


4

I think the problem involves the use of edge which creates a second construction after the main path is drawn. Since [-latex] applies to the entire command until the ;, you end up with 2 arrows. Replacing edge with a regular -- removes the problem: \documentclass[tikz]{standalone} \usetikzlibrary{decorations.pathreplacing} \begin{document} ...


6

Legend box is a TikZ matrix so matrix node options apply to it. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \begin{tikzpicture}% \begin{axis}[legend style={minimum height=3cm,column sep=4cm}] \addplot {rand};\legend{label} \end{axis} \end{tikzpicture} \end{document}


0

Just for fun with PSTricks. It needs the latest pst-plot to let us use postfix in \psxTick and \psyTick. \documentclass[pstricks,border=12pt,12pt,dvipsnames]{standalone} \usepackage{pst-plot,pst-eucl} \psset { urx=15pt, ury=15pt, llx=-15pt, lly=-15pt, ticks=none, labels=none, xAxisLabel=$Q$, yAxisLabel=$P$, algebraic, ...


6

Here is a suggestion: \documentclass[margin=10pt]{standalone} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture}[ every node/.style={text=black}, fdesc/.style={anchor=south east,sloped,font=\scriptsize,pos=#1}, fdesc/.default=1, ] \begin{axis}[ axis ...


4

I tweaked it a little. I hope you don't mind. \documentclass[tikz]{standalone} \usepackage{pgfplots} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture} \begin{axis}[ clip=false, axis x line=bottom, axis y line=middle, ytick={5,20}, xtick={-45,100}, no markers, ymin=0, xmin=-55, xmax=120, ...


2

You could use the tikz package and the arrows and decorations library to achieve something similar to your drawing. \documentclass[tikz]{standalone} \usetikzlibrary{arrows,decorations.pathmorphing} \begin{document} \begin{tikzpicture}[ >=stealth', pos=.8, photon/.style={decorate,decoration={snake,post length=1mm}} ] \draw[gray,thick] (-2,0) -- ...


2

This is a starting point. First define a style (LL here) for snake lines. Then draw a line via \draw[options] (x1,y1) --(x2,y2)node[position]{label}; % Euclid coordi \draw[options] (0,0) --(alpha:radius)node[position]{label}; % polar coordi Options: thick, very thick, color, arrow type,...,LL] Code \documentclass[10pt,a4paper]{standalone} ...


5

The problem is not just for subscopes; simple scopes will also show the undesired behaviour. The problem is that you are wrongly using the visible on option (orange is also wrongly used) independently of the on background layer specification; the problem is solved as soon as visible on (and also orange) is passed as an option to the on background layer ...


7

Just for fun with PSTricks. \documentclass[pstricks,border=24pt,12pt]{standalone} \usepackage{pst-node,pst-plot} \def\Object#1{% \begin{pspicture}[saveNodeCoors,arrows=->](-2,-2)(2,2) \pscircle{2} \curvepnodes[plotpoints=\numexpr#1+1]{0}{360}{2 t PtoC}{w} \multido{\i=0+1}{\wnodecount}{\psline(w\i)\uput[!N-w\i.y N-w\i.x atan](w\i){$w_{\i}$}} ...


10

To learn more about TikZ read pgfmanual.pdf. Via the macro \n you can adjust the order of the root to be taken. \documentclass[tikz]{standalone} \usepackage{amsmath}% for \Re and \Im \def\n{5} \begin{document} \begin{tikzpicture}[ dot/.style={draw,fill,circle,inner sep=1pt} ] \draw[->] (-2,0) -- (2,0) node[below] {$\Re$}; \draw[->] (0,-2) -- ...


4

Are you looking for the xticklabels and yticklabels option? The ticklabels in the xticklabels list are assigned to the tick positions given by the xtick list. Example: xtick={10,30}, xticklabels={$V_i=10$,$V_f=30$}, Code \documentclass[margin=10pt]{standalone} \usepackage{pgfplots} % loads also tikz \pgfplotsset{compat=1.10} ...


8

The easy way out is to fake the derivative; \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \begin{document} \pgfmathdeclarefunction{MyF}{1}{% \pgfmathparse{% (and (1 , #1<=5)*(3.-0.5*#1-2.24667*#1^2+2.93766*#1^3-1.55322*#1^4+0.413019*#1^5-0.0534444*#1^6+0.00265741*#1^7)) +% (and (5<#1 , #1<7)*(4)) +% ...



Top 50 recent answers are included