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
12
votes
1answer
682 views

Nested node class with pictogram decoration

I'm wondering how can I define custom TikZ node class mynode thats allows my to use following syntax: \node [mynode,fill=yellow!40] {component} \child{ \node [mynode,fill=yellow!40] {...
12
votes
1answer
1k views

Reference a node's color by using node name

I am trying to use a node name to reference the node's color. I am not sure if this is even possible. I have a TikZ mindmap: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes....
11
votes
1answer
20k views

Different arrow line styes and different row sizes in tikzpicture

I am using tikzpicture environment, together with \matrix command to draw a diagram. I have two questions: Can I use different arrow line styles in the same matrix? For instance, the matrix called m, ...
11
votes
3answers
1k views

Verbatim in tikz node

I am trying to have a verbatim environment in a tikz node just next to some other nodes. I have tried \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \...
11
votes
1answer
208 views

Draw ribbon with variable bending points

I refer to the following answer of Gonzalo Medina about creating a ribbon with text. I want to modify the existing code such that the points where the ribbon bends are quite large compared to the ends ...
11
votes
2answers
333 views

How to do a planar/multiview/first-angle projection in Tikz?

I need to make quite a few "first-angle projection" in Tikz (see Wikipedia ) for an exercise sheet, so I was wondering if there is a routine to make them? By this I mean that I could give a certain ...
11
votes
2answers
1k views

Hyperlinked nodes in TikZ mindmap

I am trying to make a small mindmap such that some of the child nodes are hyperlinked. I tried to follow the advice given here, about the new node style hyperlink node, but the following MWE compiles ...
11
votes
1answer
1k views

How to plot this cascaded/waterfall python-type plot using TikZ

I would like to make a plot of this equation P_n = \frac{n^a}{a!}\exp[-n] for different n. How can I use this cascaded style from the TikZ/PGF examples, to plot P_n (y-axis) with a (x-axis), for ...
11
votes
2answers
1k views

Tikz style conflicting with clip command

Below is my example. I'd like to use a global style for all my tikz pictures to set up the line width. It is working well until I use a clip. I guess that it is not possible to pass some style option ...
11
votes
1answer
18k views

How to change line style while drawing in Tikz

I'm trying to draw a dotted line from A to B and a straight line from B to C. If I use two draw commands, then there is an obvious break in the line, because I use rounded edges. Just using one draw ...
11
votes
1answer
11k views

TikZ Self Loops Style Question

I have a question on how to "style" the self loops in my diagram. Here is my preamble: \documentclass[letterpaper]{tufte-handout} % Additional LaTeX Packages \usepackage{amsmath} \usepackage{...
11
votes
2answers
1k views

How can I improve those voltage annotations

In France, we draw an arrow above or below a dipole to represent the potential difference between its two poles. I'm trying to automate this using the ideas of the tikz circuits library (not circuitz)....
11
votes
1answer
6k views

pgfplots - How to specify default line widths for plots and marker?

I would like to specify different default line widths for plots and for markers (like x-marker). For the plot line width, I use: \pgfplotsset{every axis plot/.append style={line width=1pt}} Yet, ...
11
votes
1answer
233 views

How do you extend the inner line of a double line?

The built-in double line functionality in TikZ uses the exact same length for the inner line as for the outer/background line, which is reasonable enough. However, because of rounding errors or anti-...
11
votes
1answer
1k views

How to plot a graph from its adjacency matrix (coordinates manually specified)? [duplicate]

For example, I want to plot a graph whose adjacency matrix is [0,1,0;1,0,1;0,1,0]. I first plot three points labeled by p1,p2,p3, and link the points p1,p2, p2,p3. For a general case, how to link the ...
10
votes
3answers
3k views

TIKZ: only fill 75% of the node-background with color

I want to use some background color on my node, but not for the whole node. Just for 75% of the node. My code is this: \documentclass[tikz,margin=5mm]{standalone} \begin{document} \tikz\node[draw, ...
10
votes
6answers
1k views

How can “execute at begin node” be used with special characters like curly braces? (or: how to raise node content)

I'd like to define the following style: test/.style={ execute at begin node={\raisebox\{-0.2cm\}\{}, execute at end node={\}} } and use it like \documentclass{article} \usepackage{tikz} \...
10
votes
3answers
375 views

Expanding macro defined by \csdef to define a style via \tikzset

I need to store tikz option in a \csdef{}: \csdef{My Node Option}{draw=red, thick, fill=yellow} How do I use this definition to define a style via \tikzset? I attempted to use .expand once as per ...
10
votes
2answers
5k views

How to make all nodes same size in TikZ?

I'm draw a TikZ figure, but I came across two problems. First one is that all the nodes have the different size due to the size of the text inside the nodes. I read in some other question here, that ...
10
votes
3answers
1k views

How to draw multiple lines inside the circle

I wish to draw the picture like below, however, I don't know how to add multiple lines in side the circle. This is my code: \documentclass[tikz]{standalone} \usetikzlibrary{ shapes.geometric, ...
10
votes
1answer
668 views

A Spiral of numbers

I am trying to produce a spiral of numbers from 1 through 101 with the following properties: -- multiples of 5 are in a node shaped like pentagon -- there is a special starburst node at numbers 3, ...
10
votes
4answers
3k views

Drawing a circle with an angle using TikZ

I'm trying to re-create this picture using TikZ: I, however, have a very limited understanding of TikZ, and, despite trying to learn how to draw this for an hour or so, have gotten nowhere on my own.
10
votes
2answers
1k views

Jackson structured programming diagram (format a tree diagram)

I'm trying to create a Jackson structured programming diagram. This is basically a simple tree diagram with the exception that boxes can either have a circle (O) or a star (*) in the upper right ...
10
votes
2answers
3k views

Counter for tcolorbox

I would like to create a boxes for theorem definition proposition to looks like the following image ( but with counter for each box ) : I tired with tcolorbox Here's my code: %this is created ...
10
votes
2answers
489 views

Notes on Sentences

I have a sentence like this "पठ् + अ + ति" and I want to add some notes like shown in the attached image. Is there a package for such things or I need to work with Tikz. Any reference material or ...
10
votes
1answer
1k views

beautiful section styles

I came across to website of IREM which I found beautiful section style in the following file Original file was created with PDFLaTeX. Could someone please create those styles for sections and ...
10
votes
1answer
426 views

Tikz shape as node

I had created some picture which I plan to use it in different places of the coordinate plane. But I made it in a form of TeX macro \cone{...}. How can I create such picture in a form of tikz \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} ...
10
votes
1answer
5k views

How to globally tikzset styles

I would like to set a tikzstyle from within a tabular environment, and use it after the table. Adding the usual \global seems to have no effect. The MWE below produces: but I want the last line to ...
10
votes
1answer
654 views

drawing a plane and orthonormal system using tikz

I want to draw the following image and i face problems especially in the plane on the left : \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \draw[thick,->] (52,0) -- (...
10
votes
1answer
256 views

tikz: grid corners

Apologies if this is a duplicate. It would seem like it would be a well-known problem, but I was unable to track a solution. In words: the grid lines do not extend enough to form sharp corners. I ...
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
1answer
2k views

Command to set cycle list position?

Is there a command to (re)set the starting point of a cycle list? What I am using now is the cycle list shift command but I end up doing some time consuming calculations and my code is oftenless ...
10
votes
1answer
2k views

How can I make Beamer overlays with TikZ node attributes?

As a follow-up question to Tikz animated figure in Beamer, how can I animate a particular attribute of a node? MWE \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{graphs} \tikzset{ node ...
10
votes
1answer
5k views

Overlay LaTeX/TeX coding easily on PDF with 300 pages

I've been looking for a way to overlay TeX/LaTeX i.e maths language etc (everything LaTeX is designed for) onto a background document containing 310 pages combined together in a PDF file. So far I ...
9
votes
3answers
478 views

Tikzcd pullback square issue

I have a tikzcd diagram \begin{center} \begin{tikzcd} F \arrow[r] \arrow[d] & * \arrow[d] \\ X \arrow[r, "f"] & Y \\ \end{tikzcd} \end{center} which looks like this: I wish to add a symbol ...
9
votes
2answers
761 views

How to have a specific style for empty cells in a tikz matrix

I have a tikz matrix as the one in the code below which contains some empty cells. (Don't care about issues with column and row separations. I left that out for the sake of simplicity.) \...
9
votes
4answers
1k views

Tikz Edge: Distance from other nodes?

I have the following Tikz code: \usetikzlibrary{positioning} \begin{tikzpicture} \tikzstyle{bordered} = [draw,thick,inner sep=5,minimum size=10,minimum width=100,font=\sffamily] \tikzstyle{...
9
votes
3answers
440 views

Reproduce fundamental cell in Tikzpicture

I would like to make easier the creation of the following diagram. I wrote this code that makes a so called dimer diagram where are different hexagons. Each hexagons is numbered and the plot just ...
9
votes
2answers
3k views

Drawing Indian Flag using tikz

I am trying to draw an Indian Flag using ideas from here and others including an Ashok-chakra symbol from overleaf example. I want to have the proper coding with correct dimensions mentioned at ...
9
votes
2answers
364 views

tikz block diagonally divided

I'm trying to draw the following diagram: What I could do so far: The code: \documentclass[tikz,border=20pt]{standalone} \usetikzlibrary{shapes,arrows} \usetikzlibrary{decorations.pathreplacing} \...
9
votes
2answers
1k views

Correct use of arguments pattern in pgfkeys/append after command in tikz?

I could not find many examples for the correct use of arguments patterns in pgfkes, but I was able to come up with the following: \documentclass{standalone} \usepackage{tikz} \tikzset{dimen/.style={&...
9
votes
1answer
6k views

Display Database Instance Relationship with TikZ

I'm trying to display all of my corporate database instances and their relationship to each other, so to speak the database links. I found the geometry shape cylinder using TikZ \usetikzlibrary{shapes....
9
votes
2answers
2k views

pgfplots - axis xmode/ymode in user-defined style

I would like to specify xmode and ymode for the axis with \pgfplotsset (or any other way, so that the mode can be changed by an if statement) The error message which I get is: ! Package pgfplots ...
9
votes
1answer
4k views

Extract x, y coordinate of an arbitrary point on curve in TikZ

We have very nice Extract x, y coordinate of an arbitrary point in TikZ \documentclass{article} %\url{https://tex.stackexchange.com/q/33703/86} \usepackage{tikz} \usetikzlibrary{decorations.markings}...
9
votes
2answers
458 views

Restoring previous value of PGF/TikZ key?

How does one restore the previous value of a PGF/TikZ key? For example, I would like to set the inner sep of a matrix to 0em but set the inner sep of nodes within the matrix to be the value that ...
9
votes
2answers
1k views

Nested styles in TikZ

I have: \pgfkeys{/TransformerNetwork/.style={ transformer/.style 2 args={draw, cylinder, gray!80, rotate=90, minimum height=#1, minimum width=#2}, }} And then: \begin{tikzpicture}[/...
9
votes
1answer
7k views

Tikz: Text along top and bottom of arrow path

How can I add text to both the top and bottom of a path? My commutative diagram below is 90% complete. I would, however, like text={${gKer({\varphi}){\mapsto}{\varphi(G)}}$} following the path below ...
9
votes
2answers
1k views

How should I prevent a .pic definition inside a document environment, but outside a tikzpicture, from adding a space to the typeset output?

How can I prevent the definition of a .pic from adding an additional space to the typeset output, where the .pic is defined in a \tikzset{} within the document body, rather than either in the preamble ...
9
votes
1answer
1k views

Is there something like \providetikzstyle similar to \providecommand?

I have standalone figures that I include in my document. These figures use statements like \providecommand{\HypotenuseLabel}{$h$} which allows the figure to have a default label, and which can be over ...