# Tag Info

26

Edit A bug fixed (the outer equator midpoints was not calculated correctly, as pointed out by @Dror). MWE with Asymptote, file lattice.asy: size(200); import graph3; pen surfPen=rgb(1,0.7,0); pen xarcPen=deepblue+0.7bp; pen yarcPen=deepred+0.7bp; currentprojection=perspective(5,4,4); real R=2; real a=1; triple fs(pair t) { return ...

21

Are you thinking about something like this? \documentclass{standalone} \usepackage{asymptote} \begin{document} \begin{asy}[width=10cm,height=10cm] import graph3; import three; size3(200); currentprojection=orthographic(3,3,5); currentlight=light(gray(0.4),specularfactor=3,viewport=true, (-0.5,-0.25,0.45),(0.5,-0.5,0.5),(0.5,0.5,0.75)); int nb ...

21

A little make-up with slight modifications \documentclass[tikz]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \shade[left color=red,right color=red!40] (-1,-2)--(-1,-5) arc (180:360:1) -- (1,-2) arc (0:180:1 and 0.3); \draw (0,0) ellipse (1 and .3); \draw (-1,0)--(-1,-5) arc (180:360:1) --(1,-5) -- (1,0); ...

17

With adjustable height: \documentclass[tikz]{standalone} \usetikzlibrary{calc} \begin{document} \begin{document} \newlength{\mylen} \setlength{\mylen}{-3cm} %% change here for changing length (height) \begin{tikzpicture} \draw (0,0) ellipse (1 and .5); \draw (-1,0)--(-1,-5); \draw (1,0)--(1,-5); \draw (-1,-5) arc (180:360:1); ...

13

The problem is that you're using rand which generates random numbers between -1 and 1, instead of rnd, which generates random numbers between 0 and 1. This leads to some of the lines having a negative width, which throws Acrobat off. Replacing the rand with rnd fixes the problem: \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{fadings} ...

12

You can use path fading=east from the fadings library for this: \documentclass{article} \usepackage{tikz} \usetikzlibrary{fadings} \begin{document} \parindent0pt \null \definecolor{orange}{RGB}{233,77,16} \thispagestyle{empty} \vspace{-1cm} \vfill \hfil \begin{tikzpicture}[overlay] \coordinate (gNE) at ...

10

Two separate solutions. Code \documentclass[border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \fill[color=red!80] (-1,-4) arc (180:0:1 and .2) -- (1,-5) arc (0:-180:1); \fill[color=red] (0,-4) ellipse (1 and .2);%Not necessary, it is there if the opacity is changed or a solution ...

7

Joining late the party (the right occasion to use \pgfmathdeclareoperator). Key aspects of the answer: drawing the glass tube is simpler at user-side as all the relevant code has been gathered by the glass tube style; options have been introduced to customize size of the tube; the scale is shown accordingly to customization provided; added upper tick ...

7

pgfplots offers something on these lines. An example from the manual: \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} \begin{axis}[axis lines=none] \addplot[mesh,samples=1000,domain=-4*pi:4*pi,line width=2pt] {sin(deg(x))}; \end{axis} \end{tikzpicture} \end{document}

7

The plot is incorrect because the number of samples taken to draw the function is little. Take a large number of samples or use a different domain that allows x=2, TikZ plot path operation and Pgfplots takes 25 samples by default. Here a solution using Pgfplots: Code \documentclass[border=10pt]{standalone} ...

7

Here's an invisible tree. \documentclass[border=0.125cm]{standalone} \usepackage{tikz} \pagecolor{black} \usetikzlibrary{shapes.geometric,decorations} \pgfmathdeclarerandomlist{colors}{{red}{yellow}{pink}{green}{orange}{purple}{blue}{white}} \newcommand\drawstar[1][]{% \pgfmathsetmacro\s{rnd*2+2} \pgfmathsetmacro\t{rnd*.5cm+0.5cm} ...

7

Please always post complete code starting from \documentclass{..} and ending at \end{document}. I don't know how block is defined. Your question is not clear. Whether a ,b and c are one below the other or a and b side by side with c below them at the center? Please note that below of=a is deprecated. you should use below = of a instead with ...

6

This does look like a bug. As a workaround, you can set extra x tick style={ xticklabel={ \pgfmathparse{exp(\tick)} \pgfmathprintnumber[sci, precision=1]{\pgfmathresult} } } to print the correct label: \documentclass[11pt,titlepage,a4paper]{article} \usepackage{tikz,pgfplots,pgfplotstable} ...

6

To draw the "wavy" lines, you can use the snake line pattern offered by the decorations.pathmorphing library. Play with the segment length and amplitude parameters to get the exact line style you want. Code \documentclass[border=2pt]{standalone} \usepackage{circuitikz} \usetikzlibrary{tikzmark,decorations.pathmorphing} \begin{document} \begin{circuitikz} ...

6

I would use \matrix to position the Firm nodes, and manually draw the boxes. (Somehow the fit library doesn't work, and so the boxes are not drawn with the most elegant code :(). Code \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,decorations,arrows,positioning,matrix,calc} \usepackage{verbatim} \begin{document} \pagestyle{empty} ...

6

you can set the overlay and remember picture option to the tikzpicture: \documentclass{beamer} \usepackage{tikz} \begin{document} \begin{frame} \begin{tikzpicture}[overlay,remember picture] \draw (0,0) circle (1cm); \end{tikzpicture} \end{frame} \begin{frame} \begin{tikzpicture}[overlay,remember picture] \draw (0,0) circle (1cm); \draw (2,2) circle (2cm); ...

6

Your problem is baseline=(#1.east). It should be baseline=(#1.base). Further, you can put xshift inside the coordinates like \tikz[remember picture,overlay] \draw[decorate,decoration={brace,amplitude=3pt},] ([xshift=6mm]select-1.north east) -- node[right=3pt]{$\sum \gamma_t^k \leq 1$} ([xshift=6mm]select-2.south east); Full code: ...

6

There are two issues here: Use \clip with a "huge" rectangle, while avoiding that clipping rectangle to be used as part of the BoundingBox. This can be solved by using \clip inside a pgfinterruptboundingbox environment. After the clipping area is set this way, we perform the drawing, but then the BoundingBox of the figure is updated for each stroke (even ...

5

You can use node and control its dimensions. \documentclass{article} \usepackage{tikz,calc} \begin{document} \fboxsep=0pt \fbox{ \tikz[baseline=(a.base)] \node[draw=black, fill=blue, rectangle, rounded corners,inner sep=0, outer sep=0,minimum width=5ex] (a) {\vphantom{Sg}} ; Signal} \end{document} Here \vphantom adds the total height (i.e., height of S ...

4

Problems with \foreach aside, I think the syntax \path (b) edge (d) (a) edge (b) edge (c) edge (d); comes much more natural. It is also much easier to change edge options on an edge-to-edge basis (or for more than one edge, too): \path (b) edge (d) {[thick] (a) edge (b) edge[green] (c) edge[red,->] (d)}; Though, a similar thing can still ...

4

I think it is possible by carefully selecting the dimensions of the rectangle. In your example, you should select a rectangle whose height is equal to the width of the line. In this case it is \pgflinewidth. \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \clip (-1,-0.5\pgflinewidth) rectangle (1,0.5\pgflinewidth); \draw ...

4

I can confirm this issue on OS X with Adobe Acrobat X. All other, PDFKit-based PDF viewers (Skim, Preview, IDE-integrated viewers) work fine. A simple, but in my experience always working workaround with problematic PDFs is to sanitize them via conversion to PS and then to PDF1.3 (which basically rasterized some fading and transparency effects): pdf2ps ...

4

Similar to Jake’s solution but with my qrr.trans library ([1], [2]). Code \documentclass[tikz]{standalone} \usetikzlibrary{shapes.geometric,qrr.trans} \tikzset{ reg poly/.style={shape=regular polygon, regular polygon sides={#1}, outer sep=+0pt}} \tikzset{ unreg poly/.style={/utils/exec=\def\myPolygonCounter{1}, @unreg poly/.list={#1,(unreg ...

4

You need to remove the parentheses from the inner loop. Namely, instead of passing {\targets} to the \foreach loop, you should be passing \targets. \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node (a) at (0, 1) {}; \node (b) at (0, -1) {}; \node (c) at (1, 0) {}; \node (d) at (-1, 0) {}; \foreach ...

4

First you have to give names to each node, with the syntax node[<options>] (<name>) {<node text} I define a macro \HighlightedNode that holds the name of the node to be highlighted, and a second one \Highlight to change the node to be highlighted. The highlighting is simply a thick red ellipse drawn around the centre of the node, please ...

4


4

This is a way to draw the diagram. \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,fit,arrows} \begin{document} \begin{center} \begin{tikzpicture}[auto,node distance=2cm,>=stealth'] \tikzset{block/.style= {draw, rectangle, minimum height=2em,minimum width=4em}, sum/.style = {draw, circle, node distance=2cm}, input/.style = ...

4

You have to use the fpu library, if you plan to do “exact” computations. Otherwise PGF uses TeX's arithmetic which is not accurate enough. \documentclass[a4paper,11pt]{scrartcl} \usepackage{array} \usepackage{pgf} \usepgflibrary{fpu} \pgfkeys{pgf/fpu} \begin{document} \begin{tabular}{*{4}{r@{\enspace}>{$}l<{$}}} a) & ...

3

append after command uses a similar approach for saving the node’s name as the tree uses to connect the nodes. For this, I borrow most of the code from a label or a pin and apply it in your example, too. I am using edges here since with your \pgfextra example, you would also need the additional \pgfinterruptpath. Unfortunately, both implementations do not ...

3

You can also use PSTricks: \documentclass{article} \usepackage{pst-circ,pst-plot} \newcommand*\CurvedArrow[4]{ \rput(#1,0){ \psplot[algebraic]{0}{#2}{#3*sin(6*x)+#4} \psline{->}(#2,#4)(!#2 0.15 add #4) } } \begin{document} \begin{pspicture}(-0.4,-0.1)(7.3,8.8) \wire[arrows=*-*](0,0)(7,0) \coil[arrows=*-*](0,2)(7,2){} ...

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