tikz

How do PStricks and TikZ compare for ease of learning and for quality of API design?

My group uses Literate Programming for most of our source code---this means that internal documentation is written using LaTeX. We have been using PStricks for fancy technical diagrams of the system, but have recently been recommended to use TikZ. I've gathered this information: TikZ/PGF is new and maintained; PStricks went a long ti...

How to get one component of a tikz/PGF coordinate?

I'm trying to draw a horizontal line across my diagram. The Y coordinate of the line should be halfway between points a and b (a is below b). The left and right endpoints of the line are on the bounding box of the tikzpicture. Here's how I'm doing this now, using the intersection operator: \coordinate (h0) at ($(a.north)!0.5!(b.south)$)...

What is the correct way to center \tikzpicture?

What is the correct way to cause a \tikzpicture to be centered, using LaTeX? By default it appears to be aligned with the left margin. ...

Query regarding drawing TikZ figure

In this sample code, the author does the following \draw ($(closedStart.south) + (-.5em,0)$) edge[stateEdge] node[edgeLabel, xshift=-3em]{\emph{Passive open}} ($(listen.north) + (-.5em,0)$); What irritates me most about these markup based drawing tools is that I've to measure a value and specify. In this case, the author...

Trees and macros with tikz

I am trying to build my trees using macros but I don't get the result I want. Here is a minimal example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{trees} \newcommand{\LeafNode}[1]{% child {node {#1}} } \newcommand{\InnerNode}[3]{% child {node {#3} #1 #2 } } \begin{document} \begin{...

Comprehensive list of Tikz-timing options

Anyone here a guru in Tikz-timing? I am/was looking for a way to label a timing diagram with annotations, but the vertical scale is too compressed. I couldn't find a comprehensive list of options for the \timing command (or if I did, it was a meagre list). My initial guesses at what they might be failed (e.g. height=), but eventually...

How to have a fixed size number that depends on the slide in latex beamer / tikz ?

I have a tikz picture with a circle node which has a number inside. I want this number to change with the slides but to be of fixed size. (-> not mess up the circle). This one isn't working, the circle gets as big as if it has to hold all 3 numbers. \tikz[baseline] \node [fill=blue!20,draw,circle,anchor=base] (node1) { \only<1-3>{3...

What is the correct way to caption a `tikzpicture`?

I have some trees drawn with tikz and I'd like to have some text associated with them. I can use \caption within figure, but not tikzpicture. UPDATE: Thanks for your advice. figure seems to put my first picture at the bottom of the page, and the second one on the second page. I would like these to be close to the paragraph like the tikz...

How to control font sizes in pgf/tikz graphics in latex?

Hi, I'm creating graphs in pgf/tikz. When I use these in my document they are scaled, several are in minipage/subfig like environments. When this happens the font sizes are scaled with the graphics making them very small or unreadable. I've been through the manual but have so far been unsuccessful in my attempts to control this. Is the...

Control font size in graphics in LaTeX when scaling in minipage/subfig?

Hi, I am using pgf/tikz graphics and I'm wondering how one can control the scaling of font sizes in the graphics when using them in minipage/subfig environments? Is there a way to manually set a permanent font size for pgf/tikz graphics or in latex in general so as to make font sizing invariant to scaling? Ideally I'd like to be able ...

Coping with nodes that contain text that goes below baseline in tikz

I have the following problem with Tikz/Latex: I have some nodes that contain text. Most text doesn't have letters that reach below the baseline. But for those nodes where it happens, the ratio and placement of node height and text/baseline is off. Have a look at the example image. Solutions I know of: make the nodes' minimum height...

How to create diagrams for papers.

I want to create some diagrams for some papers. Diagrams will contain some text, e.g. some console output. I need images for using also in html files. There is TikZ so can create images like this: http://www.texample.net/tikz/examples/boxes-with-text-and-math/ http://www.texample.net/tikz/examples/rule-based-diagram/ http://www.te...

Compare floating point numbers in Latex

I am trying to use \ifthenelse to do a floating point comparison. This is the pgf/tikz code, which works if \y is integer only, but not otherwise: \foreach \y in {3,3.5,...,6} { ifthenelse{\y<3}{ ... }{ ... } } ...

Standalone diagrams with TikZ?

I'm using TikZ to draw diagrams in LaTeX that I then want to isolate as image files to put online. My guess is there is a way to extract these diagrams directly without having to tease them out of the finished .pdf file. How would I go about doing that? (If it matters, I'm using TeXnicCenter.) ...

Positioning of hyperlinked shapes with matrix in tikz

I can draw a hyperlinked shape in tikz using the following code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \usepackage{hyperref} \begin{document} \begin{tikzpicture} \node {% \href{http://www.stackoverflow.com}{% \begin{tikzpicture} \filldraw[blue] circle(1cm) node [white] {Click}; \end{tikzpicture}}}; \end{...

Aligning matrix nodes in tikz

Another question about aligning nodes using matrices in tikz. Consider the following: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture} \matrix (m)[matrix of nodes, column sep=5mm,row sep=3mm, align=center, nodes={rectangle,draw, text width = 2cm} ]{ & \node{row1-2...

Latex: stretchable curly braces outside math

Hi, I am producing some latex beamer slides (but I think it is not a beamer specific question per se). I have the following: \begin{itemize} \item Issue1 \item Issue2 \item Issue3 \end{itemize} Now, I want to have a right curly brace (i.e. '}') behind the items spreading over issue1 and issue2. And of course I want to write somethi...

tikz: set appropriate x value for a node

This question resulted from the question here I want to produce a curly brace which spans some lines of text. The problem is that I have to align the x coordinate manually, which is not a clean solution. Currently I use \begin{frame}{Example} \begin{itemize} \item The long Issue 1 \tikz[remember picture] \node[coordinate,yshift=0.7em...

How to Find Intersections with Ellipses in PGF/TikZ

Hello, I am trying to display a sphere in PGF/TikZ to illustrate the idea of great circles. The code for my current result is: \begin{tikzpicture} \tikzfading[name=fade right, left color=transparent!20, right color=transparent!90] \tikzfading[name=fade out, inner color=transparent!100, outer color=transparent!10] \tikzfading[name=fa...

pgf/tikz: String Symbols as Input Coordinates

Hi all, I'm new to pgf so i was trying out some examples from the pgfplot manual. One example is especially relevant for my current task but, alas, it would not compile. Here is the code: \documentclass[11pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[symbolic x coords={a,...