{labels} is about customizing the labels of {diagrams} and mathematical constructs like {matrices}. For questions about \label or similar commands, use {cross-referencing} instead.

learn more… | top users | synonyms (1)

40
votes
5answers
8k views

How do I label different rows or columns of a matrix using braces?

I have a matrix enclosed in brackets [ ] (or (), or {}, or |'s, or ||'s): - a b c d - | e f g h | | i j k l | - m n o p - which I want to label like so: R |---| -- - a b c d ...
38
votes
5answers
40k views

TikZ set node label position more precisely

This seems like it should be really easy but I can't seem to find it anywhere... I'd like to be able to fine-tune the positioning of a node label. I'm aware of the ...
35
votes
3answers
6k views

TikZ: Bend text so that it follows a line

I have two arrows going from a node on the left to a node on the right. Both arrows are slightly bent. I want to label the arrows with text that is bent just like the arrows. This is as far as I've ...
22
votes
3answers
6k views

How can I set the TikZ label anchor explicitly?

I want to add a label to a node, but "inside" the node. Something like this: The manual seems to indicate it might be possible, although no actual key is named. The ... anchor point for the ...
21
votes
3answers
1k views

Draw dimension of a line as a decoration in TikZ

Is it possible to define in TikZ a new decoration or something like that, such that it is possible to write something like: \draw[dim={text,above}] (A) -- (B); \draw[dim={text,below}] (C) -- (D); ...
20
votes
3answers
284 views

Chart showing the relative number of pages in the document

I'm playing with the idea of adding a chart in the begining of my thesis, showing the relative dimension of each chapter (or section, maybe). This is something that I would want to generate ...
20
votes
2answers
346 views

Show graph of references inside a document

I have quite a lot of labels and references (around 250 labels, 600 references to those) in my document. As I need to re-arrange parts of the document, I'd like to know which labels are referenced ...
19
votes
2answers
1k views

High level digital design in TikZ

I am very new to TikZ and I have trouble making a diagram similar to the one here: My problems are specifically making MUX to get to inputs which would be on 1/3 and 2/3 of the width. Taking sigma ...
19
votes
1answer
8k views

Comprehensive list of TikZ style options?

I'm aware that one can use \tikzstyle{every label}=[...] to apply styles to every label within a tikzpicture; or \tikzset{mystyle/.style={...}} to apply style specs to a specific type of node mystyle ...
16
votes
1answer
2k views

How to use “fit” to frame the nodes and labels

I'm using the fit TikZ library to fit a rectangle around two nodes which include labels. However, the rectangle is only fit around the actual nodes, not about their labels: \documentclass{article} ...
14
votes
2answers
520 views

Complicated tikzpicture for theorem of multivariabe continuous functions

I'm attempting to construct a tikzpicture that looks like this: Here's what I have: \documentclass[12pt]{article} \usepackage{amssymb} \usepackage{amsmath} \usepackage[english]{babel} ...
14
votes
3answers
92 views

What to consider when naming labels to prevent errors?

This question is inspired by Umlauts in label and a quote from an answer to How to automatically add \! in subscripts? However the best is to avoid _ in labels. I already name all my labels with ...
14
votes
1answer
1k views

Adding a label to a bent arrow in TikZ

In this question Is there a TikZ equivalent to the PSTricks \ncbar command? Jake provided a very nice TikZ version of the PSTricks \ncbar command. With normal node connections in TikZ, I can use the ...
13
votes
2answers
7k views

Positioning of Pgfplot axis labels

I'm trying to adjust the position of my axes labels and I'm having some trouble: \documentclass{article} \usepackage{float} \usepackage{pgfplots} \usepackage{graphicx} \begin{document} ...
13
votes
2answers
407 views

Using the same figure twice with no new number

I have a figure that relates to two different issues discussed at very different point in a long document. Rather then send the reader back 50 pages to look up a figure, I would like to include the ...
13
votes
1answer
4k views

How to introduce a line break in a TikZ node label?

I need to introduce line breaks into the label of a node. This is what I've tried so far, but none of it worked: 1: \node[node, label={[split parts = 4]alpha \nodepart{two} bravo \nodepart{three} ...
12
votes
5answers
1k views

How do I draw a little red square to label my right triangle?

The sample code: \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw ( 0 , 0 ) coordinate (A) -- ( 4 , 0 ) coordinate (C) -- ( 0 , 3 ) coordinate (B) ...
12
votes
1answer
6k views

Place label in middle of line with TikZ

What is the best way to place a label in the middle of a line with TikZ? I mean smack dab in the middle of the line, not above or below it. The following is close \begin{tikzpicture} \draw[|->, ...
12
votes
1answer
4k views

pgfplots using strings *from data table* as x axis labels in bar chart

I've seen some of the other threads on using strings as x axis labels, but nothing that fits my situation. I'm trying to create a bar chart from a CSV file. I can do it so long as everything in the ...
12
votes
1answer
2k views

Stacked barplots/groupplots with text labels in x-coordinate

I was trying to stack a groupplot, or was it grouping a stacked plot? However I was trying to get something like: The ybar stacked option works quite nice here. But when I try to adapt it to a ...
11
votes
1answer
4k views

How to change label and ticks of a pgfplots colorbar?

I have a 3d plot with colored surface and a colorbar made with pgfplots. My probably related questions are: How can I set the label of the colorbar? What are the equivalents of zticks (positions of ...
11
votes
1answer
6k views

How to place label in middle of line (above and below) with TikZ

\fbox{ \begin{tikzpicture}[scale=1,auto=center] \node[circle,fill=gray!20] (n1) at (2,8) {Node A}; \node[circle,fill=gray!20] (n2) at (8,8) {Node B}; \foreach \from/\to in {n1/n2} \draw ...
11
votes
1answer
100 views

Multiple \the… formats for a single counter?

Say I have a definition (\arabic) that includes a small list of sub-definitions (\alph). Sometimes I want to use full cross-references (2.3a, 2.3b, ...). But sometimes, when the main definition is ...
10
votes
2answers
495 views

How to generate n points over a circumference and choose label and color

I would like to place n points over a circumference like Figure 3 of this file. I'd choose the label to be assigned to each vertex and color and I'd like to have the code in TikZ-pgf.
10
votes
2answers
464 views

Irregular Polygon with Angle Labels

I am looking to create the 15-sided irregular polygon figure below, without having to declare coordinates for each point. Is there an easier way to do this? Tikz? PGF?
10
votes
1answer
397 views

How do I put a label inside a Feynman diagram circle?

I have this simple Feynman diagram with a circle: I would like to put the number "1" in the middle of that circle. I've tried these: \fmfiv{lab=1}{c} \fmfiv{lab=1}{.5[nw,se]) ...
10
votes
1answer
57 views

Reading (input) a file whose name is created with a label

I don't want to get into the details of why I want to do this, but I would like to: create a new counter called filenumber; create a file whose filename is \jobname\thefilenumber.txt and write to ...
10
votes
1answer
564 views

Label automatically positioned so that it doesn't overlap anything

I produce automatically generated LaTeX-files with nodes and links. Is it possible to put the label of the node outside of the node and it is automatically positioned somewhere, such that there is no ...
9
votes
1answer
192 views

TikZ: positioning label at the end of a path

I'm trying in TikZ to find a general way to draw an arrow and label it at the end. Something like this works reasonably well: \draw[->] (0, 0) -- (1, 3) node[pos=1.1]{$\vec{v}$}; However, ...
9
votes
1answer
797 views

Use text data as mark labels in pgfplots

I have a table with numerical data and text in different columns, like this: 0 0 0.1 1 0 \pi 2 0 \frac{\pi}{2} I'd like to put text labels on a plot using the text in the third column ...
9
votes
2answers
1k views

pgfplots: two labelings for a single 3d plot

I am trying to add a second labeling to my 3d plot, but I can not figure out how to do it correctly. The idea is to add a second axis without any grid, ticks, lines and nothing but labels and overlay ...
9
votes
2answers
419 views

Label variables of equation using tikz without using itemize

I'm trying to use tikz to label the variables of an equation. I know of a similar question (Itemized Equation) but the answer uses itemize to label the variables. I would like to do something similar ...
9
votes
3answers
206 views

PSTricks: Wrong axis labels

Consider the following example: \documentclass{article} \usepackage{pstricks-add} \def\sandsynlighed#1#2{% \psframe[ linecolor=red, fillstyle=solid, fillcolor=blue!50 ](#1,0)(!#1 ...
9
votes
1answer
197 views

Using xy-pic, how do you label an arrow with a curly brace that spans the length of the arrow, and can be offset arbitrary distances?

I'm trying to figure out how to label the arrows with curly braces that span the length of the arrow, and to make it all very pretty. More specifically, I'm trying to make ...
8
votes
2answers
642 views

referencing main subequation

In the following example i labeled each subeqnation. \begin{subequations} \begin{gather} R_0 = 0 \label{subeqn:ini-cond-r} \\ N_0 = 0 \label{subeqn:ini-cond-n} \end{gather} ...
8
votes
1answer
192 views

Equation number for each row of a matrix equation

Is it possible to give an equation number to each row of a matrix equation? How could I have equation labels in the vein of subequation numbers, one for each row of the matrix equation? Here, I'd ...
8
votes
2answers
2k views

Matrix with arrows and labels

I would like your advice on writing a matrix with latex. In order to explain the meaning of the rows and columns, the matrix should be surrounded by two arrows, one on the left side pointing downward ...
8
votes
2answers
108 views

Use labels from file in Tikz

I want to compare data from two files in a 4 by 4 grid. The data files are like this: data1.dat: A B C D ..... data2.dat: 1 2 3 4 ......... I am able to set up the grid with the ...
8
votes
1answer
363 views

Label equations arbitrarily

When I have equations, as in \begin{equation} ... \end{equation} Can I arbitrarily assign the numbers to the equations? Instead of the usual order (1), (2), (3), ..., I'd like something like (1), ...
8
votes
1answer
1k views

Titles aligned horizontally above nodes in figure

I am trying to create a flow chart going left-right where each stage has a header aligned with it, at a certain height above the chart. I am trying to use the Hydrogen Splitting Example (see the ...
8
votes
1answer
138 views

How to generate a “named destination” in PDF?

According to the Evince help, one can open a PDF at the location of a "named destination": SYNTAX evince [--help] [--page-label=PAGE | --page-index=NUM‐ BER | --named-dest=DEST] ...
8
votes
1answer
3k views

individual tick label style with pgfplots

given the following code, I want to modify the tick labels in such a way, that for negative values of x, the labels are located above the x-axis. How can I realize this? \documentclass{report} ...
8
votes
1answer
728 views

Two level labels in bar plot

I need to group the labels in the x axis by putting a second level label. I need to separate the nodes that are grouped from the other ones or marked them somehow. For example, if I have the labels ...
8
votes
1answer
193 views

Numbering equations with letter and number?

I need all the equations in one of the sections to be numbered as letter (R) and an ascending number (1, 2, 3...). So they look like (R1), (R2), (R3) etc. I do not want the number of the ...
8
votes
1answer
970 views

Pgfplots contour gnuplot crazy labels

This is driving me mad. I am tryng to create some contour plots, but I get them full of labels, so that they are unreadable! I can't even see the lines or read the values because they are too much. I ...
8
votes
1answer
2k views

Different color for individual bar in bar chart & adding bar labels

Please consider the following MWE. There are three things I would like to do: Individual colouring For the last element ("not rejected") I would like to fill the bar with another color (e.g. ...
8
votes
1answer
199 views

Reuse an image resp. a box in TikZ but have side-effects only once

I have a huge document (a pool of exercise problems) with lots of \input statements (one file per subexercise). In order to not get lost in this mess and easily open files from the PDF, I include a ...
7
votes
4answers
344 views

How to label the curve of a function at any point along it in tikz?

In my example, I have to simple curves y = sqrt(x) and y = x. I would like to be able to attach a label along each curve, say at the middle of the curve. Right now, I am doing it by trial and error ...
7
votes
2answers
203 views

How to reference the Index?

How can I reference the index created by the package makeidx? Minimal working example: \documentclass{scrbook} \usepackage{hyperref} % creates links on refs \usepackage{makeidx} \makeindex ...
7
votes
2answers
179 views

Putting labels inside section headings

I usually work with LyX, and when I want to label a section (in order to reference it later), I put the label inside the section heading. This usually works, but recently I tried to create an article ...