Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Hot answers tagged

19

\documentclass[border=5pt,tikz]{standalone} \begin{document} \begin{tikzpicture}[xscale=1,yscale=1] \fill[blue!20] (0,-2.5) --+ (0,2.5) arc (0:180:1.5) -- (-3,-2.5) arc (180:235:3) --+ (0,-.25) --+ (.45,-.25) --+ (.45,.015) (0,-2.5) arc (0:-55:3); \fill[white] (0,0) arc(0:180:1.5) --+ (0,-2) -| cycle; \fill[blue!10] (-1.5,-2) circle ({1....


18

You don't need to connect nodes. First draw background lines. All starting from (0,0). \foreach \angle in {0,1,...,359} \draw[cyan!50!black] (0,0)--++(\angle:4); Second, draw a circular node white filled: \node[circle, fill=white, text=cyan!50!black, text width=15mm, align=center]{Orion\\2000}; And third (although it's the first command), define the ...


17

\documentclass[a4paper]{article} \pdfpageheight\paperheight \pdfpagewidth\paperwidth \makeatletter \dimen4=.996264\paperheight \dimen6=.996264\paperwidth \pdfliteral page{% q n 0 0 m \strip@pt\dimen6 \space \strip@pt\dimen4 \space l s Q} \begin{document} zzzz \end{document}


17

Note sure if it is more efficient, but it is a lot easier to work with if you define the coordinates first, and then draw them. BTW: +1 for a nice usable MWE \documentclass[border=5pt,tikz]{standalone} \usetikzlibrary{backgrounds,calc} \definecolor{hellblau}{RGB}{18,158,181} \definecolor{dunkelblau}{RGB}{22,141,163} \newcommand{\changefont}[3]{\...


15

Welcome to TeX.SE! Here is a simple prototype of what you need. Hopefully, you may apply your desired customizations to it. \documentclass[border=1pt]{standalone} \usepackage{tikz} %TikZ central library is called. \usetikzlibrary{automata,positioning} % automata and positioning libraries are required to use nodes and coordinates in addition to placement ...


13

To connect the edges of the circle you can use the border anchors of nodes (A.120) and the to Operator to connect it to the outer square. \documentclass[tikz, border=5mm]{standalone} \begin{document} \begin{tikzpicture} \draw[clip] (-2,-2) rectangle +(3,3); \node[minimum size=5cm](A){}; \node[circle, draw, minimum size=1cm](B) at (A.center) {}; \foreach \...


13

Like this? \documentclass[border=10pt,multi,tikz]{standalone} \begin{document} \begin{tikzpicture} \foreach \m in {0,1,2}{ % draws shaded regions \draw [fill=gray!50!white, rounded corners] ({ 15+120*\m}:2.25) arc ({15+120*\m}:{129+120*\m}:2.25) -- ({129+120*\m}:1.75) arc ({129+120*\m}:{15+120*\m}:1.75) -- cycle; } % draws non shaded regions \...


13

For complicated figures with graphics, I think there is some consensus that tikz is the way to go. It is probably worth learning. It is amazing, but can be intimidating for the beginner. For very simple pictures (lines, arrows, text, ovals) the picture environment has easy-to-learn tools. The \put command together with \line and \vector commands can recreate ...


13

This draws it as two objects. \documentclass[border=2mm,tikz]{standalone} \begin{document} \begin{tikzpicture} \draw (90:0.2) arc(90:430:0.5 and 0.2); \draw[dash pattern=on 7pt off 3pt on 20pt] (-110:0.5) -- ++ (70:1); \end{tikzpicture} \end{document} If you are bothered by having to tune the dash pattern, but are fine with overpainting ...


12

Here's how to do it with pstricks. I also suggest a line with arms: \documentclass[svgnames]{article} \usepackage{pst-node} % \usepackage{auto-pst-pdf} to compile with pdflatex --enable-write18 (MiKTeX) % or pdflatex --shell-escape (TeXLive, MacTeX) \begin{document} This is a very long\Rnode{st}{ \underline{sentence that}} appears in this very \Rnode{ss}{\...


12

\documentclass{article} \usepackage{tikz} \usetikzlibrary{topaths} \tikzstyle{every picture}+=[remember picture,inner xsep=0,inner ysep=0.25ex] \begin{document} This is a very long \tikz[baseline=(node1.base)]\node (node1) {\underline{sentence that}}; appears in this very \tikz[baseline=(node2.base)]\node (node2) {\underline{short short}}; document. \...


12

Using iterative tricks you could obtain better result. RESULT: MWE: \documentclass[border=5pt,tikz]{standalone} \definecolor{hellblau}{HTML}{129EB5} \definecolor{dunkelblau}{HTML}{168DA3} \usetikzlibrary{backgrounds} \pagecolor{hellblau} \newcommand{\changefont}[3]{\fontfamily{#1}\fontseries{#2}\fontshape{#3}\selectfont}%Nice code! \begin{document} \...


12

Here's a version in plain Metapost featuring a useful idiom to find all the intersection points between two paths. This is wrapped up in luamplib so compile it with lualatex (or work out how to adapt it for plain mpost). \documentclass[border=5mm]{standalone} \usepackage{luatex85} \usepackage{luamplib} \begin{document} \mplibtextextlabel{enable} \begin{...


12

\documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.text} \definecolor{myWhite}{HTML}{f7f7f7} \definecolor{myGr1}{HTML}{c6c6c6} \definecolor{myGr2}{HTML}{e3e3e3} \definecolor{myCy}{HTML}{0396C1} \begin{document} \pagestyle{empty} \begin{tikzpicture}[scale=0.4] %front \fill[myWhite] (4.3,-17.6) -- (-9.5,-14.25) -- (-9.5,8.2) -- (4.3,5.75) -- ...


11

There is no every draw available. One possible way is to style every path. \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[every path/.style={->,red,thick}] \draw(0,0)node[left]{$ A $}--(5,0)node[right]{$ B $}; \end{tikzpicture} \end{document} An alternative solution is to globally set draw for every picture. ...


11

This answer shows how to get a rotated rectangle to fit around any two given nodes, so does not require any change to the way you set-up the picture. \documentclass{article} \usepackage{amsmath, amsfonts, amssymb} \usepackage{tikz} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture} \node (a) at (0, 0) {a}; \node (b) at (1,0) {b}; ...


11

This not using tikz ;-) \documentclass[a4paper]{article} \usepackage{pgf} \usepackage{eso-pic} \begin{document} \AddToShipoutPictureFG{% \AtPageLowerLeft{% \begin{pgfpicture} \pgfpathmoveto{\pgfpoint{0mm}{\paperheight}} \pgfpathlineto{\pgfpoint{\paperwidth}{0mm}} \pgfusepath{stroke} \end{pgfpicture}}}% blub\newpage blub \end{document}


11

Macros can be defined for each color. How the circles overlap depends on the order they are drawn, the second one is drawn over the first. With every path/.style={thick,fill=lightgray} the default style for the circles is set (line width and fill color here). The fill color is later overwritten with e.g. [fill=red] for individual circles. Using polar ...


11

\documentclass[border=2mm, tikz]{standalone} \usetikzlibrary{matrix, positioning} \tikzset{ trafficlight/.style = {% matrix of nodes, nodes in empty cells, rounded corners, draw = blue!70, fill = blue!30, nodes = {circle, minimum size=5mm, anchor=center, draw=black}, row 1/.style={nodes={fill=red}}...


11

Package eso-pic can be used to put something on every page: \documentclass[]{article} \usepackage{tikz} \usepackage{bbding,lipsum} \usepackage{eso-pic,picture} \AddToShipoutPicture{% \AtPageLowerLeft{% \put(0,.5\paperheight){\makebox(0,0)[cl]{\ScissorHollowRight}}% \put(1.5em,.5\paperheight){\tikz\draw[dashed] (0,0) -- (\paperwidth-3em,0);} ...


11

If you know the angle, then you can use relative polar coodinates, e.g. \draw (1,1) -- +(30:2cm);. The + before the polar coordinate indicates that the previous coordinate ((1,1)) should be used as the origin. If you use ++(30:2cm), the current point is also updated, so if you add another relative coordinate to the path, the origin of that will be the end ...


11

Edit: explanation of the method used to determine the nature of the spiral. This curve is a spiral with two centers. To determine this, I printed your image (my printer did not respect the original colors) then actually built with a ruler and compass the perpendicular bisector of the segment that cuts the small green curve on the left. This allowed me ...


11

You can use the the show path construction and the markings decoration to put an arrow next to every path segment. The limitations are that you have to repeat the last point in the path (-- cycle alone won't do it) and you have to take care of the direction in which you draw the path. \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations....


11

Note that with blue!50 you define a color that is 50% of blue. This is a very different approach to adjusting hue and saturation with a HSB color model, which I would suggest using here. With the xcolor package (or TikZ) you can define a color using the Hsb model that takes a number between 0 and 360 to define the hue (which you can easily divide through the ...


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