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

learn more… | top users | synonyms

65
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? ...
56
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) ...
47
votes
2answers
52k 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?
46
votes
6answers
24k 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 ...
34
votes
8answers
3k 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 ...
29
votes
1answer
2k views

\{ & \} vs \lbrace & \rbrace

So, what is the difference in using \{ and \} to using \lbrace and \rbrace? Which one is preferred, and when one has to take care?
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 ...
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 ...
21
votes
3answers
623 views

Why are text format commands used inside braces?

Most commands in Latex are written with the arguments inside braces following the command: \command{arguments}. But text formatting options, like \em, or \scriptsize are usually written inside the ...
20
votes
3answers
9k 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 ...
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 ...
17
votes
1answer
726 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} ...
15
votes
2answers
7k 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?
15
votes
2answers
142 views

How do extra braces impact the placement of items in the document?

I am placing some of my document through some outside BASH scripts, but want to protect some information such that the scripts will not change them. The simplest option for me is to put { and } around ...
15
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} ...
14
votes
1answer
11k views

Double square braces like these ⟦exp⟧?

How do I create mathematical equation double square braces like these ⟦exp⟧ in latex? I failed to find it on google (I created these using word 2010 equation editor). I would like these to be of ...
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 ...
12
votes
2answers
263 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 ...
12
votes
2answers
638 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 ...
12
votes
1answer
1k views

How to vertically align underbraces

I am trying to balance underbraces in the equation below, how can I ensure that both underbraces at the same depth? \begin{equation} y = \underbrace{ \left [ x^2 + r^2 (a^2+\frac{a^{0.3}}{b}) ...
12
votes
2answers
3k 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?
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{ ...
11
votes
2answers
1k views

How can I draw annotated braces over and under math expressions?

What LaTeX markup would one have to write to produce a result similar to the image below? Please excuse my Paint-and-mouse drawing skills. :-)
11
votes
2answers
271 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 ...
11
votes
1answer
244 views

Straight Braces

Can I make a variant of Latex Braces? In some equations system, I'd like to use a left brace like in this picture:
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 ...
11
votes
3answers
885 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 ...
11
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 ...
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} ...
10
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?
10
votes
2answers
241 views

Tikz figure inside equation with braces that are too large

I'm currently trying to include a tree, visualized using Tikz-qtree and Tikz into an equation. The problem I'm having is that the curly braces are way too large. The code I'm using at the moment is: ...
10
votes
1answer
186 views

Treating < and > as synonyms for the curly braces { and }

I am exporting photo metadata from a software which seems to be unable to export curly braces correctly. Is there any way to tell LaTeX to treat < as {, and > as }, to keep me from having to go ...
10
votes
2answers
8k 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} ...
9
votes
2answers
208 views

Underbrace in denominator with () [] {} (howto)

I would like to put an underbrace correctly under the denominator of a expression but what I get is wrong because of the (). Alternatively I create another line in the text ...
9
votes
2answers
4k views

Put a curly brace under an ellipsis in a math setting?

so I have $m\times n = n + n + \dots + n$ in my text right now, but I would like to put a curly brace under the \dots to emphasize that there are m n's involved. How would I do this?
9
votes
1answer
10k 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 ...
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
1answer
181 views

How can I typeset a brace on the right-hand side of two equations?

How to obtein this on latex? Thank you.
8
votes
2answers
128 views

Underline number in two parts; math mode

I'm trying to underbrace a binary numeral as follow: 10111101 '--''---' B D in order to show the binary-hexadecimal correspondence, but using twice the underbrace command: ...
8
votes
1answer
6k views

Missing } inserted, yet braces are balanced

Regard the following document: \documentclass[a4paper,reqno]{amsart} \usepackage{amssymb,amsmath,amsthm,fullpage} \begin{document} For each $k$ we denote by $\lambda_k$ the $k$th symmetric ...
8
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 ...
8
votes
1answer
170 views

Brace from {cases} environment disappears after rowcolors*{1}{…}{…}

I use rowcolors*{1}{...}{...} to color a table, then I use it again (with white as arguments) to reset the color. After that, braces look weird (they disappear slightly). If I use scrbook, book, ...
7
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 ...
7
votes
3answers
370 views

unicode-math and braces scaling

I am trying to create a minimal lualatex distribution, and hence try to eliminate as much non OTF fonts as possible (I try to get rid of the .afm, .pfb, .map, etc files to save space). Everything is ...
7
votes
1answer
883 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
382 views

Labeling non axis parallel braces in tikz

Given two points, the following code draws a brace connecting them and labels it. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc,decorations.pathreplacing} \begin{document} ...
7
votes
2answers
970 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
1answer
292 views

Can I use \begingroup \endgroup as delimiter of \detokenize, instead of {}?

I would like to use other delimiters than {} for the argument of \detokenize. E.g. something like \detokenize\begingroup a lot of stuff \com \mycom \endgroup but it does not work. Am I really ...
7
votes
1answer
188 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% ...
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 ...