A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [tikz-styles]

{tikz-styles} are predefined sets of options that organize how graphics elements are drawn. It is thus possible to program specific styles and reuse the styles on different objects. The {tikz-styles} tag can be used in parallel with {tikz-pgf}.

Filter by
Sorted by
Tagged with
4
votes
1answer
68 views

How can I share TikZ styles between pictures without making them available globally?

The tikzpicture environment allows to define styles in square brackets that are available within the picture. I would like to share the styles between multiple pictures to edit them in a single place. ...
4
votes
2answers
657 views

TikZ path with rounded corners and decorations.markings not working as expected (pos=0.0 at wrong location)

I want to put small round markings at fixed distances on a six-pointed star. There are two problems though: pos=0.0 is not at the expected location, but slightly shifted possibly due to the rounded ...
4
votes
2answers
357 views

Tikz: cones with a wide base

In every example of cone which I found so far there is an unpleasant mistake at the base since the sides should be tangent to the bottom ellipse but they are never. Drawing a larger base the problem ...
3
votes
2answers
243 views

How do I mark an angle with multiple arcs?

I have been trying to find a good answer to this question (or a question to match it): I'm trying to give an angle a marking with multiple arcs in the interior, as per the pictures below. I'm not ...
3
votes
1answer
517 views

Front Cover for document

I was attempting to get an effect similar to this cover that is found here: I started with the code found here that draws a grid with colors. How can I go about completing the code to get the output ...
3
votes
3answers
231 views

How to draw a much more dense grid or lattice?

My inquiries: 1) How to draw a much more dense grid in 2-dim? 2) How to draw a much more dense grid in 3-dim? Let us say it is still 4 x 4 in 2d or 4 x 4 x 4 in 3D in size, but I want to have ...
3
votes
1answer
600 views

Using counter values as part of style name for plots

I figured I should be able to give a bunch of line styles and access them using counters. Sure enough, this works out fine; this document \documentclass{article} \usepackage{tikz,pgfplots} \tikzset{%...
3
votes
1answer
769 views

TikZ mdframed environment: close box at end of page and continue on next

I used the Excursus environment as a template to create my own box like this: \usepackage[style=1,leftmargin=0pt,rightmargin=0pt,framemethod=TikZ]{mdframed} \newenvironment{boxtype1}{% \begin{...
3
votes
1answer
664 views

Relationship diagram

So this is what I would like to have Diagram 1 Diagram 2 Diagram 3 with help of Nico i could draw it like that \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{arrows} \...
3
votes
4answers
851 views

How can I draw a spiral with tangential unit vector and labels?

Please, How can I draw these diagrams using TiKZ ? r = r_{0} e^{bt}, \theta= bt x= R cos wt, y=R sin wt, z=hwt
2
votes
1answer
133 views

Alternative to double distance in postaction for non-opacity?

I was inspired by the OP in this thread: Tikz: Drawing railway tracks to make a tikzstyle that will allow me to draw arbitrarily shaped pairs of silver lines with black borders (which will actually be ...
2
votes
1answer
1k views

How can I draw an ellipse with a rainbow color?

I need to draw a rainbow-colored (hue colormap) ellipse in tikz. Something like this but then in an ellipse shape, and in tikz. I've thought about drawing to ellipses, one with rainbox filling, the ...
1
vote
1answer
78 views

Setting polar coordinates for coordinate system in TikZ via macro

The problem I would like to do something equivalent to the following: \def\setX{{(0:1cm)}} \tikzset{x=\setX} "Debuggable" code (it doesn't run, because I put it the way I want it to be. the \setX ...
0
votes
1answer
1k views

Drawing cylinder in 3D plane

Can someone help me write the tikz code to generate the following images? I've tried adapting what some other people have done to generate a cylinder, but I want the cylinder with the axes and with ...
0
votes
2answers
171 views

How Can I make a run off table?

I am new in using Latex. I want to make a run off table like the one in the . I will appreciate your helps.
-2
votes
1answer
137 views

Graph with text inside circles?

All what I want is to get an image which give me eventually an image looks like this attached image (better if it is with some colors and high resolution level): I understand fully that this is quite ...
12
votes
2answers
4k views

How to draw a point at a particular location along the curve in TikZ

I got a nice code to draw an arrow at the mid position of the curve. From Tikz: Arrowheads in the center \tikzset{->-/.style={decoration={ markings, mark=at position .5 with {\arrow{>}}},...
10
votes
1answer
1k views

How can I add nodes through a TikZ style?

Consider a small example below. I'd like to automate the addition of the label-node along the edge through the use of styles. I've tried the naïve solution of just adding such a necessary node ...
10
votes
2answers
4k views

why does latex report errors when using styles in a tikz pgf picture?

I get three errors when attempting to build the following example (with the tikzpicture taken from the tikz pgf manual). Why does this happen, and what am I doing wrong? \documentclass[12pt]{article} ...
9
votes
2answers
427 views

Indentation issues with highlighting cell using tikzmarkin

I am trying to eliminate offset/indentation issues when using tikzmarkin to highlight regions of a table. \documentclass{beamer} \RequirePackage{booktabs,colortbl,caption,tabularx,chngcntr, tikz, ...
8
votes
1answer
7k views

How to control text margin in TikZ shapes

When using different shapes from TikZ library, they have different inner padding for text. Thus, for similar text, we will have nodes (shapes) with different sizes. Then, the child nodes will not be ...
7
votes
1answer
3k views

Tikz: question about arrow tips color and width of paths

Why 4-6, 4-7, 7-5 get these colorings? More precisely, what is the difference between [draw=green, fill=green] to [color=green]? Why the 4-5 arc has a slightly bigger width that 7-6? You can see a ...
7
votes
1answer
238 views

Can't find the documentation for \tikzstyle or `+=` operator in tikz

I've noticed in a number of examples that the following is occasionally used when working with tikz: \tikzstyle{every picture}+=[remember picture] When I search the documentation I can't find ...
7
votes
2answers
1k views

Bend arrow decorations in Tikz

This is a follow-up to my recent question Half arrows in graph using TikZ. \documentclass[tikz]{standalone} \usetikzlibrary{matrix,arrows,arrows.meta,bending,decorations.pathreplacing, ...
6
votes
1answer
127 views

CircuiTikZ: How to create professional wiring diagram borders?

Assumed we have this Minimum Working Example (MWE): \documentclass{article} \usepackage{tikz} \usetikzlibrary{circuits.ee.IEC} \begin{document} \begin{tikzpicture}[circuit ee IEC] \draw (...
6
votes
1answer
219 views

Help required to understand tikz code?

Following is the code that was posted for my question How to show path gains in block diagrams drawn in tikz environment? It is giving me the desired output. But my problem is that I don't understand ...
6
votes
2answers
1k views

comma in node name [TikZ]

In my database some objects have name in A,B format, i.e there is comma in between. I wanted to do something like this \node (A,B) {Comma}; \node (x) {normal}; \draw (A,B) -- (x); However, this is ...
6
votes
1answer
93 views

Where is my understanding of TikZ styles wrong?

I am trying to learn TikZ by reading the manual (p.34). I know my understanding must be completely off the rails, since nothing is working as I think I should; but I'm not sure what I misunderstood. ...
6
votes
2answers
796 views

Why does \ifnum not work inside of TikZ style definitions?

I'm trying to write some conditional TikZ styles. This has been tried here before, but I think never in a completely satisfying way. My try is this: \documentclass{article} \usepackage{tikz} \begin{...
5
votes
1answer
279 views

Adding nodes through a TikZ style, using double dash lines ``--``

I'm basically asking this question, because the answer there is not working for the case with -- lines. Say you have a line like so: \draw (0,0) -- (3,3) node[sloped, midway,above]{Hey!}; Then is ...
5
votes
1answer
3k views

ylabel style when axis y line=right

When I'm using axis y line=right, it appears ylabel style is not applied, as illustrated by this MWE: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} \Large ...
5
votes
1answer
274 views

Filter tikz node text through macro

I would like to make a node style that "filters" the node's label (text) through a command, i.e. replace the node text with a macro, with the original node text passed as an argument to that macro. ...
5
votes
2answers
323 views

How to decorate a node with additional paths?

I want to add styles to my nodes that draw additional paths inside of the node. For example (without proper placement of nodes) \node[draw,circle,lVert] {}; \node[draw,circle,lHor] {}; \node[draw,...
5
votes
2answers
254 views

Cross over of arrows in a complex diagram

I have drawn a diagram using tikzpicture, but it has arrows crossing over each other. How do I keep the Horizontal arrows in each level intact and break the other arrows at the point of intersection? ...
5
votes
1answer
237 views

Beamer's (implicit) options regarding tikzpictures and shadows

While trying to use the torn page effect in a beamer document, I was confronted to an unexpected problem. If you just take the the code of this answer and compile it, you get: If you just change the ...
5
votes
1answer
360 views

Tikz “none at all” style

I'm creating a customisable TikZ pic where I want to enable or disable certain parts of it (e.g. some labels). Is there a style that I can pass to a node, pic, path or so that doesn't visibly draw it? ...
5
votes
1answer
5k views

How can I increase the padding around nodes in a fitted box?

I have code: \documentclass[tikz,border=10pt]{standalone} \usepackage{verbatim} \usepackage{textcomp} \usetikzlibrary{shapes,arrows,fit} \begin{document} \tikzset{ sum/.style = {draw, circle, ...
4
votes
1answer
205 views

How can I set a style in `\forestset` which requires delayed calculations with the results of node walks?

What is the correct way to wrap the specification for the tree below into the my binomial style defined in \forestset and why? The following code works fine: \documentclass[tikz,border=10pt]{...
4
votes
1answer
2k views

How to get line width and inner sep values?

I try to get the values of line widths and node inner sep. How to read such a value form own style (if it will be specified during modifications of the picture) or if it is not specified in this style,...
4
votes
1answer
151 views

Why can’t I use “execute at begin node” together with “align”?

I want to design a tikz style that will modify a node content according to some function of mine. As suggested in an answer to the original question, I can use the “execute at begin node” key for this....
4
votes
1answer
318 views

Is it possible to define abbreviations for coding?

I am using the tikz-timing package to create a timeline since chronosys and chronology wouldn't cooperate and were too limited and archaic-looking to suit my purposes, and moderntimeline unfortunately ...
4
votes
2answers
348 views

A collection of the actual smartphones

Considering the recent excellent questions that I've really enjoyed Welcoming 2019 Pi day: How to draw the letter π? and What has been your most complicated TikZ drawing? I have carefully observed ...
3
votes
1answer
213 views

tikz label over path flips!

I'm trying to come up with a nice schematic of recursive calls using tikz, but the result is not what I expect as one label is flipped without a reason: The MWE is: \documentclass[xcolor=dvipsnames]{...
3
votes
2answers
569 views

How to make this free body diagram with a non-straight force line using tikzpicture environment

Please consider the following MWE adapted from this fantastic example of Kjell Magne Fauske's free body diagram: \documentclass{article} \usepackage{tikz} % From http://www.texample.net/...
3
votes
1answer
350 views

Get the auto generated tick distance of a pgfplot (DIN 461)

I would like to set up my pgfplots to comply with the German Standard "DIN 461". To make it short: We are asked to place the unit of the axis between the last and the second last tick label or replace ...
3
votes
2answers
320 views

Nested rectangles with different widths

The following code \documentclass[a4paper,10pt]{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \path [style={draw}] (0,0) rectangle (4,1); \path [style={draw}] (0,1) rectangle (4,2); ...
3
votes
1answer
89 views

How to make this TikZ picture more idiomatic? (environment diagram)

I am re-typesetting a picture (Figure 3.9) from "Structure and Interpretation of Computer Programs": The result of my TikZ musings is the following: Please, ignore the white-ish main colour, I want ...
3
votes
1answer
350 views

How to pass style options to \pgfextra nodes

According to this answer, I created a style for drawing rectangles with double lines. The problem is, if I pass options like fill=color or thick to the node which I create with the style, these ...
3
votes
1answer
618 views

Arrow scaling problem. How can I zoom properly a very tiny part of a drawing?

Thanks to this solution, I can draw tangent line to a path. I'd like to zoom a very little part of my drawing. Here it is the code: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc,...
3
votes
1answer
886 views

Drawing a control system with tikz

I want to draw a control system diagram like the one below: So far the closest guide I have found where I could draw something like this is here. But it doesnt show me how to place text like "irdref"...