Conventionally { and }; used to delimit groups or arguments in (La)TeX code.

learn more… | top users | synonyms

45
votes
6answers
22k views

Adding a large brace next to a body of text

I'm writing a short document listing some chronological events. I want to pick out a period with a big brace. Here's a quick mockup: What's the best way to do this? Can I set the size declaratively ...
26
votes
5answers
2k views

Showcase of brace tricks: }, \egroup, \iffalse{\fi}, etc.

There have been a few questions about braces recently, specifically about when to use them (see this and that question). Note: I had mistakenly stated that SamB was the author of both questions. But ...
55
votes
6answers
2k views

How bad for TeX is omitting braces {}, even if the result is the same?

Sometimes writing braces and omitting them produces the same result: \tilde{\psi} \mathrm{e}^{\mathrm{i} \pi} vs \tilde \psi \mathrm e^{\mathrm i \pi} Or (taken from Werner's comment below) ...
34
votes
8answers
2k views

Why do people use unnecessary braces?

I often see people creating new macros where the macro token is surrounded by braces. For example, \newcommand{\foo}{foo} This is unnecessary and I find the extra braces make it harder to read. Why ...
14
votes
2answers
6k views

large braces for specifying values of variables by condition

How do I typeset something like, X = 0 if a=1, 1 otherwise, using those huge left braces and specifying each condition in a line?
14
votes
3answers
6k views

Aligning across 'aligned' equation blocks

I'd like to format two groups of equations such that all their equal signs line up and such that I can put a big brace to the right of each block to annotate that block. The last part is easily ...
10
votes
2answers
6k views

A lateral brace to group a set of equations with labels

I have a set of equations that I'd like to display together (as an example, the Maxwell's equations). Requirement #1: I'd like to have them labelled like in an align environment \begin{align} ...
11
votes
2answers
249 views

Why is unicode-math not working with TikZ?

This thread evoked from this thread. \documentclass{article} \usepackage{unicode-math} % This causes the question mark bug % This code requises unicode-math % How can you use the code without ...
20
votes
3answers
1k views

Why does TeX remove braces around delimited arguments?

On pp. 203–204 of the TeXbook, Knuth describes how TeX absorbs macros' arguments: delimited go until the first appearance of the delimiter, and undelimited go until the next token, in both cases ...
11
votes
2answers
2k views

How can I put a curly brace inside an algorithm to group code lines?

I am using the algorithmic package (or even algorithm2e is fine). Is it possible to use curly braces to group some lines in the algorithm so as to be able to put an explanation to the right?
25
votes
2answers
1k views

Asymmetric overbrace

This question led to a new package: abraces How can I control the position of an overbrace's spike? e.g. I want: /------^----------------------\ aksdj ajksdnkajs ajsdknakjsnd jaknd As ...
61
votes
5answers
2k views

{(x+y)}^2 or (x+y)^2?

This expression is just an example, of course. My question is: should one always specify the quantity being exponentiated by surrounding it with braces, or is it acceptable to drop those braces? ...
19
votes
3answers
7k views

How to put a brace on the right, not left, to group cases?

How can I get a brace on the right, not the left, to group cases, using cases? (I know actual cases look better with the brace on the left, but the items I need to group are not literally cases. They ...
12
votes
1answer
1k views

Curly brackets around a table

I would like to have braces on the left side of a table (either that or on the right side) and bellow the same table. What I have got is $ m-Mal \underbrace{ ...
9
votes
1answer
2k views

Using braces to label parts of an equation

Given an equation, say Bayes' rule, $P(X \mid O) \propto P(X)P(O \mid X)$ how do I label the different parts of the equation using curly braces?
7
votes
2answers
619 views

braces over matrix

I want to make an overbrace and a side brace on my matrix in order to indicate its size. How can I achieve that. \begin{pmatrix} 1 & 1 & 0 & .& . & . & 0 & 1 \\ 0 ...
7
votes
4answers
1k views

Brace and text in side margin

Within a text, I would like to emphasize one or two paragraphs by placing a curly brace in the left side margin, and next to it some short text vertically centred around the brace's centre. The ...
5
votes
2answers
844 views

Remove additional space around \underbrace{…}

How do I remove the additional space that is added when using \underbrace{...}, to get the same width in both lines: \documentclass{scrreprt} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} ...
10
votes
1answer
6k views

Adding underbrace in tikz

I have this code to draw a mass on a spring and now I want to have a curly brace below the spring to denote the distance: x_0. How do I do this? \begin{tikzpicture} ...
6
votes
2answers
1k views

braces on the sides of an easybmat matrix

I created the following matrix with easybmat, and I would like to add at the bottom (respectively right) something like an underbrace (resp. "rightbrace") under each of the two blocks, together with a ...
5
votes
1answer
406 views

Splitting a command syntax across a \newenvironment definition

This question is a direct follow-up to the question Can a \newcommand Definition Contain Braces as Substitution Text? I asked yesterday. The following example is once again a counter-intuitive one, ...
12
votes
2answers
254 views

necessity of braces for accent commands

Many resources on LaTeX teach that "é" and "ä" are typeset with (respectively) \'{e} and \"{a}; and it is similar for other accent symbols. Are the braces really needed? Aren't \'e and \"a shorter but ...
36
votes
2answers
42k views

How can I get text underneath an underbrace?

I am looking to do something of the following: To get text underneath the underbrace. Is it involving \stackrel or some sort of similar command?
12
votes
2answers
519 views

Differences in vertical positioning of superscripts and subscripts depending on grouping (`{ }`): Why? Caveats? Workarounds?

This question about {(x+y)}^2 vs (x+y)^2 drew my attention to the slightly different vertical positioning of super- and subscripts for such expressions. Compare (x+y)^8_8 (left) and {(x+y)}^8_8 ...
11
votes
2answers
1k views

Side brace around image with underbrace

I have an image and I want to put a side brace on the left and an underbrace on the bottom. The underbrace works fine, but the left becomes twice the image height for some reason. I'm sure the image ...
10
votes
1answer
2k views

Annotating individual math terms with braces

I am trying to annotate individual terms of a mathematical expression, as depicted below. The problem I get is that the comment seems to be taken as part of the fraction, which unnecessarily extends ...
11
votes
3answers
853 views

whitespace/brace/indentation conventions for LaTeX programming

This question is not about formatting the text/markup of a document. I'm really focused on the programming aspect of LaTeX. I'm working on a fairly large set of document classes and packages, and ...
14
votes
1answer
4k views

Adjusting vertical alignment of underbraces

Is there a way to align multiple underbraces so that they sit on the same horizontal line? For example, the following code \[ \biggl( \underbrace{0,1}_{A}, \underbrace{\frac{1}{2},\frac{1}{3}}_{B} ...
6
votes
2answers
2k views

Underbrace in Tikz

I'm trying to add an underbrace to a graph in tikz but when i compile run PDFLaTeX and View PDF, the underbrace doesn't look correct. Instead of curling down and inwards at the ends, it goes outwards ...
5
votes
1answer
515 views

How to put a brace and a title?

I would like to put a brace between the Q_s and Q_d of the following diagram \begin{tikzpicture}[domain=0:5,scale=1,thick] \usetikzlibrary{calc} %allows coordinate calculations. %Define linear ...
9
votes
1answer
8k views

Aligning the right parts in multiple \begin{cases}

Is there an intelligent way to left-align the parts right of & of the two cases environments shown below (if x >= 0, otherwise, if y < 0, otherwise). I wonder if there is a better way than ...
7
votes
1answer
173 views

typesetting material to the left of a big curly brace

\documentclass{article} \newcommand*{\LeftWidth}{3.0cm}% \newcommand*{\RightWidth}{\dimexpr\linewidth-\LeftWidth-2em\relax}% \newcommand{\AlignedBrace}[2]{% \medskip\par\noindent% ...
5
votes
1answer
89 views

Changing the size of the braces from the cases environment

I have created the following picture using the cases environment. For this picture I have two questions. 1) I would like to limit the size of the braces created by the cases environment to ...
4
votes
1answer
4k views

Left brace including several lines in eqnarray [duplicate]

How is it possible to make a brace and have something like this in a eqnarray block?
9
votes
1answer
175 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 ...
7
votes
2answers
113 views

Braces on either side of a list

I want to create this: The following code does this, but produces a number of overfull hbox and vbox statements in the log -- how can I get rid of those? On the other hand, if there is a better ...
7
votes
1answer
746 views

How to adjust brace size for nested braces?

How can I adjust the size of the outer braces to make the following equation neater? \documentclass[a4paper]{scrreprt} \usepackage{amsmath} \begin{document} \[ M = \left\{ x \in X : ...
7
votes
1answer
3k views

natbib: Error when citing paper with similar authors and same year

I get a strange error when I try cite two certain papers in the same document, when I use the natbib package (with numbers option enabled). If I trim the author list or change the year of either ...
6
votes
2answers
2k views

Case equation without curly brace

I want to have a case equation without the left curly brace. I am using \documentclass[11pt,a4paper]{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{amsthm} ...
6
votes
4answers
888 views

Dynamically sized brackets/parentheses for text

I'd like to have a large bracket that shows a relationship from one set of text to another, like this: Nam dui ligula, fringilla a, ) euismod sodales, sollicitudin ) vel, wisi. Morbi auctor ...
5
votes
1answer
222 views

Can a \newcommand Definition Contain Braces as Substitution Text?

The following example is completely counter-intuitive, but I need this in a bigger definition I'm not including here. \newcommand{\openbrace}{{} I need this to start a nested scope. Is this ...
5
votes
1answer
1k views

multi-line text for brace decoration in tikz

I'm trying to make a time-line with events by means of tikZ. Everything is going fine, I found (here) some nice examples and explanations but... I do a brace decoration for my time-line which has long ...
4
votes
3answers
244 views

Why don't the curly braces and the mid bar become bigger?

I'm having the following code: \documentclass[11pt]{article} \usepackage{amssymb,amsthm,amsmath} \newcommand{\abs}[1]{\lvert #1 \rvert} \newcommand{\N}{\mathbb N} \newcommand{\K}{\mathbb K} ...
4
votes
1answer
201 views

The command \string does not print curly braces of its argument

While printing the List of Symbols, I would like, in a draft, to print the definition commands as well. For instance, consider the following commands: \providecommand{\perm}{\ensuremath{\pi}} ...
3
votes
2answers
190 views

Latex Curly braces grouping arrows

I'm creating a communication diagram. The desired effect is to have the following in a box: Alice Bob ...
3
votes
1answer
323 views

Align inside align

I have a list of equations with annotations like the one below: \documentclass{scrartcl} \usepackage{amsmath} \begin{document} \begin{align*} aaaa &= 1 &&\text{for $X$} \\ bbbb ...
2
votes
2answers
123 views

consistent math font size in a formula

I have a math formula, having three underbraces, enclosing three expressions, with explanations below each brace, explaining what that quantity is. Since these expressions, as well as their ...
2
votes
2answers
6k views

“Extra }, or forgotten \endgroup” error

Don't understand why this piece won't compile fluently. TeX file as following: \begin{figure} \centering \includegraphics[width=\textwidth]{chapter2/epjb/groups_0.pdf} ...
2
votes
1answer
463 views

Unbalanced braces with newenvironment / NewEnviron

I am trying to define an Environment myEnv s.t. \begin{myEnv} text1 \end{myEnv} text2} expands to \renewcommand{\myCommand}{ text1 } { text2} The reason for the obviously unbalanced expression ...