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
9
votes
1answer
2k views

pgfplotsset append style is not appended to tikzpicture axis environment

When using every x tick label/.append style={font=\scriptsize} in combination with \pgfplotsset outside the tikzpicture environment, the pgfplotssetcommand from the preamble will be ignored (...
9
votes
2answers
464 views

Why `fill` covers `append after command` elements?

Next code is just a little example to describe the problem. I would like to add some elements (lines or text) inside a node and I would like to do it through node's .style. I've tried with append ...
9
votes
2answers
426 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, ...
9
votes
1answer
948 views

TikZ decoration to draw a winding or twisting ribbon

I enjoy TikZ styles and decorations a lot, but I still dabble with them. I know how to draw ribbons with a style, if they aren't meant to twist. But I'd like to define a style that has a twist of the ...
9
votes
1answer
2k views

TikZ Tree Rectangle around nodes

below you can see my code of a tree besides a table. Now I would like to insert some rectangles and ellipses around the nodes. Can someone show me how I can do this. I tried it but it did not work. ...
9
votes
1answer
903 views

Is it possible to reuse tcolorbox definitions in another tcolorbox definition?

TiKZ allows to define a .style which can be later be used in another one: \tikzset{ first/.style={rectangle, draw}, second/.style={first, inner sep=2mm} } any change in first is ...
9
votes
2answers
392 views

Integrated blocks for thesis structure

I would like to draw jigsaw blocks (boxes) and then write text into it. Something like the following figure. I could not find a package to get this shape, however, I am posting a minimal example with ...
9
votes
1answer
696 views

Setting weekend background color

I'm making a calendar in LaTeX with tikz-pgf and I would like to set to gray the background color for the weekend. In the examples I found on the Internet and in the documentation, I can see how to ...
8
votes
4answers
463 views

Is there any efficient way to add cell identifier to each cell in TikZ?

I made a grid with TikZ. I would like to add the cell number in each cell (in the middle of each cell), I used this command \draw (-4,2.5) node[below] {$Z_1$}; But this solution is time consuming. ...
8
votes
2answers
422 views

Division of curved edges in tikz

I need to divide an edge into a number of equal parts. I have the following way to do this for straight edges: \begin{tikzpicture} [very thick, transform shape, scale=.2, rect/....
8
votes
3answers
642 views

How to create a tabbed box using TikZ?

I'd like to create a new style in TikZ for nodes with transparent background, rounded corners, with labels oriented vertically on their left on a opaque fill (similar to a tabbed paper). A sample ...
8
votes
3answers
533 views

I want to draw a figure with 6 small circles surrounding a circle in the middle

\documentclass[journal,comsoc]{IEEEtran} \usepackage{tikz} \usetikzlibrary{mindmap} \usetikzlibrary{positioning} \begin{document} \begin{figure}[!ht] \centering \begin{tikzpicture}[baseline, ...
8
votes
1answer
3k views

Tikz: adjusting pin anchor

I was looking for a possibility to adjust the anchor of the text of a pin. Tikz does not allow this out of the box. This question was already asked on the mailing list pgf-users@lists.sourceforge....
8
votes
2answers
388 views

Good way of ignoring \draw, \fill or \node

I know three ways how to "ignore", or at least "hide" something in TikZ using [...] or \tikzset{bla/.style={...}}: [draw=none] (works like charm for \draw, but doesn't work for node contents; [white] ...
8
votes
2answers
6k views

Define a color in a tikz style

How do I do a definecolor in a /.style? \pgfkeys{/IMMstyle/.style={ inputnode/.style={shape=ellipse,draw,inner sep=2pt,minimum size=5.0mm}, \definecolor{dpred}{rgb}{0.50,0.35,0} ...
8
votes
1answer
260 views

Connecting points from separate Tikz figures

I have this code to draw an oscilloscope: \documentclass[12pt]{standalone} \usepackage{newtxtext,newtxmath} \usepackage{tikz} \begin{document} \def\scl{1}%scaling factor of the picture \begin{...
8
votes
2answers
309 views

“every path” style affects \node “path” when decorating

Here's a MWE: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \begin{document} \begin{tikzpicture} \draw[decorate, decoration=random steps] (0,0) -- (10,0); ...
8
votes
1answer
2k views

How to draw the structure with rectangles inside

I wish to draw the flow like in the picture using the code below, however, I found it is very hard to locate the rectangles by using Coordinate. Is there any better way to do this? Here is the code I ...
8
votes
3answers
519 views

Don't do any fills in TikZ

I have a macro that will draw several things in a TikZ picture using some styles I defined, which include fills: \documentclass{article} \usepackage{tikz} \tikzset{% mystyle1/.style={fill=red,font={\...
8
votes
1answer
141 views

Adding noise to sinusoidal plot

I have the code which outputs a couple of sinusoidal functions \documentclass[tikz,border=3.14mm]{standalone} \usepackage{tikz-3dplot} \usetikzlibrary{arrows.meta,bending} \usepackage{xparse} \...
8
votes
1answer
389 views

Tikz: How to use multiple parameters in pic?

How is it possible to use multiple parameters in a single pic? It works nicely with just 1 parameter, but always results in errors in case of more than 1 parameter. I found this post, which didn't ...
8
votes
1answer
2k views

defining Style of flowchart tikz

I have been trying to define styles to make a good block flowchart in TikZ package, but I'm not very good at it, could you make one with a combination of blue, cyan and green? I need to describe the ...
8
votes
3answers
311 views

how can I create keys such as “column … to …” for a TikZ matrix

I have a node style I would like to apply to many (but not all) the cells/columns/rows of a matrix of nodes. Currently, for every column or cell that I want the style to apply to, I declare the style ...
8
votes
1answer
530 views

Double style and double colour line in tikz

in my document i have a lot of lines like this: I usually do this with a code like this: \begin{tikzpicture}[node distance = 5cm] \node (a) {}; \node (b) [right of=a] {}; \draw[red] (a) -- (b); \...
8
votes
1answer
318 views

How to add help line and background color by tikz

everyone: I want to use tikz to draw a figure like this one: But I don't know how to add help line and background color So I just get this figure: How can I change my code? anyone can help me? \...
8
votes
1answer
534 views

Create a coordinate node at each point of a path

How can I create a TikZ/pgf-style that will put a coordinate, which should be named automatically, at each point of a path? So the following code \draw[put coordinates](0,0)--(3,2)--(4,7)--(-2,1); ...
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 ...
8
votes
2answers
2k views

Plate captions overlapping

I am trying to draw a probabilistic graphical model using BayesNet, a TikZ library for drawing graphical model in latex. I have tried to insert plates caption - Tasks i, Classes c, workers j, ...
8
votes
1answer
1k views

Scale dash pattern with line width

I would like to have dash patterns which scale proportionally to the active line width like shown in the following example: \documentclass[tikz]{standalone} \newdimen\gpdashlength \begin{document} \...
7
votes
5answers
283 views

TikZ foreach “experience bar”

I'm trying to get TikZ to make a sort of experience bar command where I can just call it and enter a number out of say, 6, and it will return that many "filled" dots, and 6 minus that many "unfilled" ...
7
votes
4answers
1k views

Macros/encapsulation in TIKZ

I'm considering starting to use TIKZ, and trying to figure out if it will do what I want, and how. I have a large document with many pictures of Bezier curves. For each of these, I'd like to draw the ...
7
votes
3answers
1k views

Creating stacked shapes for tikzstyle with

I'm working on a diagram, and I'm exploring TikZ for doing it. I searched, and looks like there is no easy way of doing diagrams, like pgfplots for plotting. So, I need to create some special node ...
7
votes
4answers
2k views

Label intersection of 3 sets

I want to make venn diagram using latex, here i already made : \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{positioning,backgrounds} \begin{document} \def\firstcircle{(0,0) circle (...
7
votes
2answers
454 views

Fancy curves in Tikz

I really want to reproduce the following diagram using Tikz. I have tried the following, but I can't seem to do the curves using smooth lines. \begin{document} \begin{center} \begin{tikzpicture}[...
7
votes
3answers
546 views

Blurred tikz picture (Hermite-Gaussian modes)

I want to draw Hermite-Gaussian modes using tikz, all that is really needed is a blurred circle and blurred lines that overlay splitting it into different sections as shown in this picture: I am not ...
7
votes
2answers
3k views

Tikz: Is it possible to change line style within same \draw command? [duplicate]

Is it possible to change the line style in a tikz figure in the same \draw command? I am looking for something like: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} ...
7
votes
3answers
272 views

To make one environment flow into another without empty space

I have this design at the moment. However, when you have many of those, they distract much. I propose to have Answer just on the same line with Question like Question 41 Lorem ipsun. Answer 38 ...
7
votes
2answers
375 views

Fill area between two parabolas using tikzpicture environment

I was asked to find the integral between x = -4 and x = 4 of the intersection of y_1 = x^2 and y_2 = -x^2. So I recreated it using LaTeX. Please consider the following MWE: \documentclass{article} \...
7
votes
1answer
12k views

set textcolor in tikzstyle

How can I set text color inside tikzstyle? I tried as shown below, but surely that is not the correct thing. I can do it seperately in each node, as shown here, but I want to declare it globally. \...
7
votes
2answers
488 views

Alignment of various blocks in tikz

As you can see the left side of the 3 lower blocks are moved to the right while keeping their right sides aligned with the right side of the first block. I'm using the following code: \documentclass[...
7
votes
2answers
621 views

Tree edges different coloring

I want to make tree with each node has valency of three. I got the below code online somewhere. The first level has valency three however second and third level has valency four, and I also want to ...
7
votes
1answer
296 views

Increment Counter as part of TikZ Style

I would like to increment a counter every time a particular style is applied. The MWE below compiles just fine, but the counter is not incremented. I would like to have the counter value be 3 after ...
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, ...
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
2answers
487 views

Draw a 3D right-handed frame with good-looking origin

I am using tikz-3dplot a lot to draw coordinate systems (often multiple in one drawing) and I am not satisfied with how the 'origin' looks. For example, \documentclass[tikz]{standalone} \usepackage{...
7
votes
1answer
827 views

Beamer annotated tables

I am trying to include some boxes around numbers in a table. I am using the method exactly described on the answer to question below: Beamer, annotated tables using Tikzmark The issue is that the ...
7
votes
1answer
308 views

Globally configure length units in TikZ

Consider the following MWE: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \tikzset{ x = 1cm, y = 1cm, node distance = 2, auto, on grid, ...
7
votes
1answer
683 views

How to draw connection between cube in tikz?

I am using tikz to draw multiple cubes. I want to achieve my expected result as bellow However, the main difficulty is that locates cube inside and center of the cube and making a connection between ...
7
votes
1answer
2k views

tikz: Better raised text effect

If you look carefully at the raised text in this image, you can see that it has two drop shadows: as well as the black one to the southeast of the text, there is a white one to the northwest. I know ...
7
votes
2answers
2k views

Tikz Nodes Positions and Shapes with a General Number of Nodes

My purpose is rather simple: use tikzpictures to draw tables of numbers, where the numbers are drawn inside colored boxes with fancy shapes, with different shapes and colors for different numbers. ...