Tag Info

New answers tagged

2

Something like this? I used random steps decorator for the green path, and "manually" built the black path, using some key points and start/end angles. Also note the use of polar coordinates, which are more appropiate for this case than cartesian ones. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing,shapes.geometric} ...


5

Use fill=white. \documentclass{article} \usepackage{tikz} \begin{document} \begin{figure} \centering \begin{tikzpicture}[transform shape,mylabel/.style={thin, draw=black, align=center, minimum width=0.5cm, minimum height=0.5cm,fill=white,font=\Large}] \newcommand\XA{-3} \newcommand\YA{0} \node (x) [circle, draw=black, ...


2

I plotted your functions using pgfplots. % pdflatex \documentclass[margin=2mm]{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \pgfmathdeclarefunction{F}{3}{\pgfmathparse{#1* exp(#2*#3)}} \begin{axis} [ smooth, grid=both,minor tick num=1, ...


3

A solution completely made with TikZ. I used the styles thick and >=stealth' (from the arrows library) in both pictures to make them look fancier. This is of course completely optional. \documentclass[tikz]{standalone} \usepackage{tikz,bm} \usetikzlibrary{angles,arrows,calc,quotes} \begin{document} \begin{tikzpicture}[ thick,>=stealth', declare ...


4

The latest version of PGF has a node contents=<node text> key which can be used in place of the {<node text>} in a node. It could be used like this: \documentclass[tikz, border=5]{standalone} \tikzset{node text/.style={node contents=\transformtext{#1}}} \def\transformtext#1{\ttfamily(#1)} \begin{document} \begin{tikzpicture} \foreach \l ...


5

Here is a solution with pstricks for the first figure (the logarithmic spiral): \documentclass[a4paper, pdf, svgnames]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[f]{esvect} \pagestyle{empty} \usepackage{pstricks-add} \def\localbasis{\psline{<->}(1,0)(0,0)(0,1)} \begin{document} \small \psset{plotpoints=500, algebraic, ...


6

direct from the manual. \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[domain=0:720,smooth,variable=\t] plot ({1.5*sin(\t)},0.8*\t/360,{1.5*cos(\t)}); \draw[->] (0,0,0) --( 2,0,0) node[above]{y}; \draw[->] (0,0,0) --( 0,2,0) node[right]{z}; \draw[->] (0,0,0) --( 0,0,2,) node[above]{x}; \end{tikzpicture} ...


5

I'd just use a "helper" macro so the \savedstyle can be expanded (once): \documentclass[varwidth,border=5]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \newcommand{\misdirection}[2][]{% \begin{tikzpicture} \node (tree) at (0,0) {tree}; \node (apple) at (3,0) {#2}; \draw [blue,#1] (tree) -- (apple); ...


4

With expl3, just for fun :) \documentclass{article} \usepackage{xparse} % automatically loads expl3 \usepackage{tikz} \usetikzlibrary{arrows.meta} \newcommand{\misdirection}[2][]{% \begin{tikzpicture} \node (tree) at (0,0) {tree}; \node (apple) at (3,0) {#2}; \draw[blue,#1] (tree) -- (apple); \end{tikzpicture}} \ExplSyntaxOn % Declare our ...


1

Here's how to do it without expl3: \newcommand\freezeStyle[1][]{% \pgfqkeys{/demo}{#1}% \expandafter\edef\csname\savedname\endcsname##1{% \noexpand\misdirection[\savedstyle]{##1}}} Note that \edef is used here and \noexpand is used to protect macros that should not be expanded. \typeout{\meaning\helloMom} macro:#1->\misdirection [execute ...


2

Correcting the middle figure in the accepted answer; The boxes, rope and pulley are not correctly drawn. \documentclass[pstricks,border=12pt,12pt,dvipsnames]{standalone} \psset{dimen=monkey,fillstyle=solid} \def\Complete{% \begin{pspicture}(8,6) \psline{->}(0,6) \psline{->}(8,0) \uput[0](0,6){$y+$} \uput[90](8,0){$x+$} ...


2

The positioning library is good for this. You can adjust the distances to suit. I've also adjusted the pulley a little to tidy up the line joinings and prevent the pulley overlapping the block. \documentclass[tikz]{standalone} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture}[ force/.style={>=latex,draw=blue,fill=blue}, ...


7

You can use the /.pic construct to do this. You draw the elements you want (Integrator, differentiator, etc.) in a picture environment and just insert these pictures wherever you want just like a node. Here is an attempt (meaningless blocks just to show the method): \documentclass[border=1mm,tikz]{standalone} \usetikzlibrary{calc,positioning} ...


20

You can adjust the in and out angles as well as shift the location of the start and end points: Notes: I also added basicstyle=\ttfamily to have a more listings like output. A \tikzmark was added on the left and right of each mark to simplify the computations of the midpoints. Code: \documentclass[11pt]{article} \usepackage{listingsutf8} ...



Top 50 recent answers are included