TikZ is a higher-level drawing language built on top of the PGF graphics framework. For questions specifically about the PGF layer use {pgf-core} instead. Both tags are possible on the same question. The tag {diagrams} is also compatible with this tag.

learn more… | top users | synonyms (3)

4
votes
1answer
1k views

Put numbers in legend using pgf pie

I would like to have the numbers that are inside the pie chart to be in the legend. How can I make that happen? Here is the MWE: \documentclass{article} \usepackage{pgf-pie} \usepackage{tikz} ...
3
votes
1answer
570 views

How to put nodes or rectangles inside a node?

I've created a chain of nodes. In each of those nodes, I want to put other rectangles with text inside. This is how I want each chained node to look like (please excuse my touchpad drawing): I ...
17
votes
1answer
853 views

Brackets around matrices in TikZ

I'm writing a custom package for labeled matrices using TikZ. I noticed an inconsistency in TikZ. This is best illustrated with the following MWE: \documentclass{standalone} \usepackage{tikz} ...
3
votes
0answers
564 views

“No shape named intersection-1 is known” error in TikZ [closed]

I want to draw a circle with arrows ending not perpendicular but straight on the surface. I managed so far to draw the paths I need and I already read about the naming of paths, but I get an error as ...
2
votes
1answer
165 views

What packages do I need to learn as developer to learn LaTeX?

I am a web developer and I often have the need to convert the the webpage to pdf. I have just discovered latex and pretty much liked it. But as there are many packages available , I am not into book ...
4
votes
1answer
272 views

Autoconnecting tikz-matrix nodes

I have this flowchart: \documentclass[tikz]{standalone} \usetikzlibrary{shapes,arrows,matrix,decorations.markings} \begin{document} \tikzset{ base/.style={draw,minimum width=2cm,minimum ...
6
votes
1answer
2k views

Horizontal alignment of text nodes of varying length in Tikz matrix like in Tex tabular

In tablular, we use {r|c|l} to define alignment. Is there anything similar for Tikz matrix. For example, by using matrix, the following MWE produces matrix of nodes, which appear to be center aligned ...
3
votes
1answer
366 views

Create a banner for section style

I am wondering if there is any way to change the default style for sections. I would like to create a banner (across the page) with a dark-gray background and the section title in white. It would be ...
28
votes
6answers
1k views

Design of an asteroid belt in TikZ

How can I construct an asteroid belt in TikZ? That is my question: I get everything right, but I do not know how to make the asteroid belt. I have no code to add besides the preamble with TikZ ...
1
vote
1answer
447 views

Pgfplot figure off-center

I create a tikzpicture in standalone mode (see code below). Then import the resultant .pdf file into my document via \includegraphics (see pic). However the axis labels are cut off and part of the ...
11
votes
2answers
612 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 ...
3
votes
1answer
329 views

Draw an automaton with more states and bent arrows

I want to draw this automaton: But I drew it with a bad way !! \documentclass{article} \usepackage{pgf} \usepackage{tikz} \usetikzlibrary{arrows,automata} \usepackage[latin1]{inputenc} ...
0
votes
0answers
142 views

Create automata with LaTeX [duplicate]

I failed to create this automata with LaTeX: \documentclass{article} \usepackage{pgf} \usepackage{tikz} \usetikzlibrary{arrows,automata} \usepackage[latin1]{inputenc} \begin{document} ...
4
votes
1answer
674 views

Model Railway planning

As there are so many fancy things which are able to do with LaTeX, is there a possibility to create layouts for model railroads? I know only special (mostly Windows) programs, to do that, e.g. ...
2
votes
1answer
357 views

tikzpicture and pdf - x axis partially disappears

I would like to know why the x axis partially disappears, given the following code. Is it a PDF problem? Also, is there any option to connect the midpoints automatically but not in a smooth fashion? ...
7
votes
1answer
2k views

How to change xticklabel or yticklabel style to Percentage?

When using tikzpicture in the pgfplots package, how can I change use PERCENTAGE for xticklabel or yticklabel. Here is a simple example: \documentclass[a4paper]{article} \usepackage{pgfplots} ...
4
votes
2answers
3k views

Referencing TikZ matrix nodes and drawing

I'm struggling with a matrix where I want to put drawings into the cells, but would still like to reference the cells as it is possible with (text) nodes, e.g. for annotation. I know that I can ...
11
votes
5answers
6k views

TikZ editor for Mac OS

I'm looking for an editor like tikzedt for Mac OS X. Or something similar in order to write and see quickly the result. Any suggestion ?
4
votes
1answer
274 views

Transparency group and decoration markings

How can I set the transparency so that the arrow belongs to the same transparency group as the path? \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{decorations.markings} ...
2
votes
1answer
103 views

How to have 2 lines in a block?

I'm using the schemabloc package, and I want to have 2 lines of text in a bloc... Diode under Protection, and Oscillator under Boost in the following example Here it is: \documentclass{article} ...
5
votes
1answer
706 views

Preview TikZ figure in AUCTeX?

I am using AUCTeX on Emacs. Recently I began to draw pics using TikZ, but the problem is AUCTeX doesn't generate preview of this environment. (However, it does generate preview for the general figure ...
2
votes
0answers
22 views

How to refer to a relative position within a node? [duplicate]

I've included an external image in a TikZ diagram as follows: \node (A) {\includegraphics[width=4cm]{image.png}}; The image is 100x100 pixels, and I need to draw a path from pixel (64,32). Is there ...
3
votes
1answer
135 views

Options passed to a path inside insert path style

Is there a way to give to the \path (inside mypath style) the options given to the \draw and \fill commands (ideally, the path should be drawn and red then filled and blue) ? ...
11
votes
2answers
647 views

Intersection of 2 lines not really connected in TikZ

In the code below I repeat one line (one with opacity=0 and other without it) in order to draw the intersection of 2 lines that are not connected. I am seeking a better way to achieve the same result. ...
3
votes
1answer
385 views

How to increase numbers precision in TikZ histogram

I entered fixed point numbers in the following code: \begin{tikzpicture} \centering \begin{axis}[xbar,bar width=0.2cm,legend style={at={(0.5,-0.15)}, xmin=0,xmax=0.8,anchor=north,legend ...
5
votes
1answer
275 views

Creating borders within the specified margins

I've been trying to get borders for specific pages for my thesis, using tikz. Unfortunately, the borders exceed the margins specified, and since I have to submit a bound copy of the thesis, this is ...
15
votes
2answers
617 views

How to turn off an environment (e.g. tikzpicture) for faster draft compiling

I'm currently writing my thesis and have been looking for ways to speed up compile time. I can shave off a lot of time by using draft mode so that images aren't processed, but I have several TikZ ...
5
votes
2answers
539 views

Argument to \input or \include statement?

I produce a lot of plots in Matlab which I export to TikZ with matlab2tikz. In matlab2tikz I can specify the plot width and height, for instance. This works out quite nicely, but as I write my ...
3
votes
1answer
428 views

How to avoid superfluous space in the initial state of a tikz automaton

When drawing tikz automata, I always omit the inital text and only use an arrow to indicate that a state is initial. To this end, I add \tiksset[initial text={}] to the preamble of my tex file. ...
1
vote
0answers
230 views

Drawing lozenges in Tikz [duplicate]

I'm creating a simple flowchart using Tikz, and I'd really like the "decision" nodes to be lozenge-shaped (think "tilted parallelogram") rather than square, in order to fit text better. Here's a ...
3
votes
1answer
480 views

tikz day list calendar to show only Sundays

I would like to create a list calendar of days showing only Sundays, and be able to annotate the day as well. The following loathly hack sort of approximates to what I want, but has a number of ...
10
votes
1answer
362 views

tikzmark position erratic in overprint environment of beamer

My aim is to highlight a term in an equation, and draw an arrow pointing to another one. Here's my code \documentclass{beamer} \usepackage{tikz} ...
2
votes
2answers
254 views

Tikzpicture horizontal alignment with to[grid with coordinates]

I'm trying to align horizontally three grids, two of them in one figure. Below is the sample code: \documentclass[twocolumn]{article} %% ...
2
votes
1answer
118 views

TikZ object misaligned with main document: slightly shifted to the right

The TikZ picture is not aligned with the main content of the document. It slightly shifts to the right. Notice how the words go outside the frame on the right side. Any hints on how to correct this ...
5
votes
1answer
214 views

Wrong positioning of month label tikz calendar

I have the following code: \begin{figure}[t] \centering \begin{tikzpicture} [every calendar/.style={ month label above left, month ...
2
votes
1answer
124 views

placing invisible links at certain coordinates?

Does anybody know if this is possible using TikZ? I'm trying to create links over a picture that i have layed on the background of a frame or at least placing them on some nodes in a TikZ code.
2
votes
0answers
269 views

Why arrow head not shown for this code? [closed]

\begin{tikzpicture} \tikzstyle{every node}=[draw,shape=circle]; \node (v3) at (4, 0) {$v_3$}; \node (v5) at (2, -2) {$v_5$}; \draw [->] (v3)--(v5); \end{tikzpicture} The above code gives me: ...
9
votes
1answer
298 views

pdflscape and tikzpagenodes problem

I am having problems getting the tikzpagenodes package to work with the pdflscape package. I want to access the nodes (current page text area) and (current page marginpar area) when rotating a page to ...
4
votes
2answers
844 views

Draw a grid for obtaining coordinates to pass to includegraphics' viewport option

I want to include only parts of an image. For this, I use the viewport option of graphicx's includegraphics. To find the coordinates, I go by trial and error, adapting the viewport argument until I ...
4
votes
1answer
1k views

tikzpicture vertical line from one node to the other [duplicate]

Assume there are two nodes A and B, with B below A. These nodes are of different width. Connecting A.south to B.north results in a slanted line. I wonder how I can connect A.south to B with the ...
2
votes
1answer
709 views

Blurry Show Background

I am trying to create a frame for each of my figures. Something's like this - a plain white rounded rectangle with a blurry shadow. Could this be done in latex? Could you show me how?
6
votes
1answer
1k views

SWOT Matrix using TikZ

I am trying to draw a SWOT matrix using TikZ. Clearly the procedure that I present in the MWE is not optimized. Also the text (namely on the left side) is not correctly aligned. ...
4
votes
2answers
2k views

tikz - trapezium node - fix angle and height, adjustable width

Using TikZ, I want to draw trapezium nodes all of which have a fixed height and angle(s), but whose widths vary. I can't find any combination of parameters that does what I want. Specifically, with ...
5
votes
1answer
278 views

How to eliminate spacing in tikzpicture?

It seems that, when using Tikz, nodes and/or the tikzpicture environment add space around a drawing. An example is shown in the following MWE, where a simple square is drawn three times. First it is ...
1
vote
1answer
586 views

Disable “clip” and “use as bounding box” in TikZ

Problem I use a tool which generates TikZ-Code (R with tikzDevice, to be precise). But the generated picture has a wide white border which I want to remove. When I manually (or with a script) remove ...
7
votes
2answers
789 views

Is it possible to load a TikZ library locally?

Is it possible to load a TikZ library and make it local to a tikzpicture? I'm writing a long document, and feel like the different TikZ libraries required for different diagrams are "littering" the ...
3
votes
2answers
604 views

Displayed Math in tikz-cd diagrams

I have been using tikz-cd package to produce diagrams however I'm not finding a way to use displayed math within it. My point is that when I use the product sign for instance inside of it, it simply ...
0
votes
1answer
299 views

How to get horizonzal alignment right for nested rectangles?

I know that nesting tikz pictures is considered bad, but I did it anyway as I don't want to mess around with manual positioning. I'm nesting several rectangles similar to another question for circles. ...
9
votes
1answer
311 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 ...
3
votes
1answer
246 views

TikZ arrow tip is displaced

My quetion is twofold: 1) I want to have a timeline graph with some intervalls. This is my code: \draw[->|] (8,5)--(10,5); \node[] (sh4) at (9.5,5.5){$s^{\text{h}}_{4}$}; \draw[|<-] ...