Tag Info

Hot answers tagged

13

This is done via transparency groups and relies mostly on PDF rendering so sometimes it might go awry. Here is an example that within the scope everything is as usual overprinting with respect to drawing order but the overall result is transparent with respect to the background. \documentclass[tikz]{standalone} \usetikzlibrary{patterns} \begin{document} ...


11

One option using a style and append after command to add the dashed lines to the node; since the solution uses \path ... node ...; you can do all operations on nodes (use the standard available keys, name them and have access to their anchors to draw elements): \documentclass{article} \usepackage{tikz} \tikzset{ keep name/.style={ prefix after ...


10

This is straightforward using TikZ: The code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix,calc,backgrounds} \definecolor{mybrown}{RGB}{33,34,28} \definecolor{myyellow}{RGB}{242,226,149} \definecolor{mygreen}{RGB}{176,232,145} \definecolor{myblue}{RGB}{61,139,189} \definecolor{myorange}{RGB}{245,156,74} ...


6

Here is a possible solution using the tikz positioning and chains libraries: \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{positioning,chains} \begin{document} \tikzset{ mynode/.style={ draw, rectangle, align=center, text width=5cm, font=\small, inner sep=3ex}, mylabel/.style={ draw, rectangle, align=center, ...


5

This works just fine. You had the coordinates wrong and a missing ;. I've removed a few packages that are not relevant for the mwe \documentclass{article} \usepackage{tikz,xcolor} \begin{document} \thispagestyle{empty} \begin{tikzpicture}[remember picture,overlay] \coordinate (A) at (current page.north west); \coordinate (B) at (current page.south ...


5

Do you want simple foreachs for everything? The same as in your code can be done with % arara: pdflatex \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[step=1cm,black,thin] (0,0) grid (5,5); \foreach \xtick in {0,...,5} {\pgfmathsetmacro\result{\xtick * .2} \node at (\xtick,-0.5) ...


5

Clipping can be used to draw the half of the line in red: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \tikzstyle{myline} = [ ultra thick, line cap=round, ] \draw[ myline, every node/.style={above, text=red, font=\sffamily}, ] (0, 0) coordinate (A) node {A} -- (3, ...


5

Improved version To have finer control, you can use Caramdir's answer to Drawing on an image with TikZ. The idea is to place the picture so that the lower left corner is at the origin of the TikZ coordinate system; a helper grid is added (See Jake's answer to the same question) just to easily visualize coordinates during the placement of other elements: ...


5

Yes, this can be done (see example below). However, it's not clear that you really need a matrix here since all the required elements can be arranged as desired without using a matrix. One option would be to use pgfplots to draw your plots; box them (a precaution to avoid the plots from inheriting settings from the "outer" tikzpicture) and then use the ...


5

Taking advantage of what you've already done, but changing a little the coordinates; for the lower part I used a custom pattern which is a variation of north east lines, but allowing you to specify the separation between the lines, their width and color: \documentclass{article} \usepackage{tikz} \usetikzlibrary{patterns} % defining the new dimensions and ...


4

It's a problem of mixing units. Using simply ($(Q) + ({0.5*(\n1+\n2+180)}:{-0.5-5pt})$) PGF assumes unit is pt so it simply moves you -5.5pt away from Q (similarly, ($(Q) + ({0.5*(\n1+\n2+180)}:{-0.5+5pt})$) moves you just 4.5pt away from Q. What you need is to specify cm for the 0.5 \draw[draw=green,fill] let \p1=($(Q)-(R)$), \n1={atan(\y1/\x1)}, ...


4

When an optional argument contains closing brackets, use an extra pair of braces to "hide them"; otherwise, TeX thinks the closing bracket closes the optional argument. In this case, instead of \draw[(-], ultra thick, green] (0.6,.02) -- (1,0.02); use \draw[{(-]}, ultra thick, green] (0.6,.02) -- (1,0.02); A complete example: \documentclass{report} ...


4

Below I present two options using TikZ and one additional version using forest. First TikZ option Since to place T1 you used below left=of center, then you can locate T3 symmetrically using below right=of center. Also, to have even separation between the nodes you have to use below left=1em and 1em of center and below right=1em and 1em of center Second ...


4

With library trees of TikZ package this is very simple to obtain: \documentclass{article} \usepackage{tikz} \usetikzlibrary{trees} \usepackage[active,tightpage]{preview}% just for showing image \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt}% \begin{document} \begin{tikzpicture}[ thick, every node/.style = { text width = 5em, ...


4

There is none but you can cook up yourself. Here is my two-minute mock-up without much thinking because I'm watching something else with my other eye \documentclass[tikz]{standalone} \tikzset{ adjust height/.style={minimum height=#1*\pgfkeysvalueof{/pgf/minimum width}}, adjust width/.style={minimum width=#1*\pgfkeysvalueof{/pgf/minimum height}} } ...


4

Without TikZ. Still far from perfect though. \documentclass{memoir} \usepackage[paperwidth=10.5cm,paperheight=15.5cm,headheight=0.5in]{geometry} \usepackage{xcolor} \usepackage[explicit]{titlesec} \definecolor{sec}{HTML}{DD5C14} \definecolor{band}{HTML}{EE9C52} \titleformat{\section}[hang]{\sffamily\Huge\bfseries}{}{0.5ex}% ...


4

Using the positioning library to place the nodes and some styles, your code can be simplified: \documentclass[border=4pt]{standalone} \usepackage{enumitem} \usepackage{tikz} \usetikzlibrary{positioning} \setlist[itemize,1]{leftmargin=*,topsep=0pt} \begin{document} \begin{tikzpicture}[ mybox/.style={ draw, text width=5.7cm, anchor=north }, ...


4

Nothing special here, since you have access to the anchors for the nodes in the matrix, so you simply need \draw[red,decorate,decoration={brace,mirror,raise=-2pt}] ([xshift=3pt]a-2-2.south west) -- ([xshift=-5pt]a-2-3.south east); or \draw[red,decorate,decoration={brace,mirror,raise=-2pt}] ([xshift=3pt]a-2-2.south west) -- ([xshift=-4pt]{a-2-3.south ...


3

As Claudio Fiandrino said, you need to load the shapes (or shapes.geometric) tikzlibrary, too, in order to make diamond work. When I tried your code, the setting every node./style={...} gave some problems, because it was overriding the decisionstyle (and all the other styles): Since you have defined a style for each node, I'd suggest you to use them: ...


3

To draw diamonds, you have to include the shapes tikz library (and for arrows the arrows tikz library) in the preamble: \documentclass{article} \usepackage{tikz} \usetikzlibrary{trees} \usepackage[active,tightpage]{preview}% just for showing image \PreviewEnvironment{tikzpicture} \usetikzlibrary{shapes,arrows} \setlength\PreviewBorder{5pt}% ...


3

Slightly modified (simplyfied) @Sergej solution: \documentclass[border=2mm, tikz, preview]{standalone} \usetikzlibrary{positioning,chains} \begin{document} \begin{tikzpicture}[ node distance=15mm and 10mm, start chain=going below, mynode/.style = { draw, rectangle, align=center, text width=5cm, ...


3

To trisect an angle, try something like this: \begin{tikzpicture}[scale=1] \tkzDefPoint(6,0){A} \tkzDefPoint(0,1){B} \tkzDefPoint(1,4){C} \tkzDrawSegments(A,B B,C) % Get the angle and define two new points that lie on the trisectors. \tkzFindAngle(A,B,C) \tkzGetAngle{at} \tkzDefPointBy[rotation=center B angle 1*\at/3](A) \tkzGetPoint{T1} ...


3

You can use perpendicular coordinate system at (t2|-d1) in \node at (t2|-d1) {Desc2}; (t2|-d1) means - x coordinate same as t2 and y coordinate same as d1. So if (x1,y1) are coordinates of t2 and (x2,y2) are coordinates of d1 then (t2|-d1) (or equivalently {d1-|t2)) is equal to (x1,y2). For more details, read pgfmanual, page 137, section 13.3.1. ...


3

TikZ 3.0.0 has a babel library intended for compatibility with the babel package, that fixes catcodes within tikzpicture, and seems to also solve the onlyamsmath compatibility issue for me. Note: as cfr points out, this does of course still disable onlyamsmath checking within TikZ pictures \documentclass{article} \usepackage[all,warning]{onlyamsmath} ...


2

You can select the baseline for the tikzpicture; for example, using baseline=(current bounding box.north) as option you get The code: \documentclass[12pt,leqno]{article} \usepackage{amsmath, amsfonts, amssymb,amsthm} \usepackage[margin=1 in]{geometry} %margins \usepackage{tikz} %Vector Drawing and Graphs \usepackage{pgfplots} \usepackage{enumitem} ...


2

Possibly overkill, but you could adapt Morley's theorem, and use trilinear coordinates that form the equilateral triangle whose vertices can be used to describe the trisectors. Unfortunately, the conversion from trilinear coordinates to tkzEuclide's barycentric coordinate system involves some fiddling. \documentclass[tikz,border=5]{standalone} ...


2

You can use \raisebox to move box containing y tick label, for x tick label you can use as you mentioned \quad or moving the two x tick label with \kern \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.10} \begin{document} \begin{tikzpicture} \newcommand\CONSTH{326.4887} \newcommand\CONSTS{205.0669} ...


2

I’m not sure if this is what you are after, but here is my try using expl3. \documentclass{article} \usepackage{tikz,xparse} \ExplSyntaxOn \NewDocumentCommand \nG { m m m } { \node[opacity=0, text~opacity=1, minimum~size=10mm, anchor=base] at (#1, #2) {#3}; } \NewDocumentCommand \writeSep { m m m } { \martin_writesep:nnn { #1 } { #2 } { #3 } } ...


2

The default number of samples is too small (25), increasing it helps to smooth the function. Also an odd number triggers the problematic value sin(0)/0, thus the number should be even for the symmetric domain. \documentclass[10pt]{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{figure}[!h] \centering ...


2

It isn't entirely clear which line you are trying to draw: a line from the left to right of the page? a diagonal? (which one?) This example uses colours to distinguish four possibilities: \documentclass{article} \usepackage{tikz} \begin{document} \thispagestyle{empty} \begin{tikzpicture}[remember picture,overlay] \coordinate (A) at (current ...



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