Skip to main content
107 votes
Accepted

Using square bracket in text mode

You don't escape square brackets in LaTeX if you want them typeset. \[ and \] are basically synonyms for \begin{displaymath} and \end{displaymath}, (or \begin{equation*} and \end{equation*} with ...
sodd's user avatar
  • 5,791
69 votes

Using square bracket in text mode

You also could try this: {[2007]}
Qaswed's user avatar
  • 981
27 votes
Accepted

Is it bad style to write x^2, 2^\frac{1}{2} and 2^\sqrt{2}?

x^2 is mildly bad style: the LaTeX manual always braces superscripts and subscripts also in cases like this. 2^\frac{1}{2} is bad style and works by chance. See later. 2^\sqrt{2} is an outright ...
egreg's user avatar
  • 1.1m
26 votes

Using square bracket in text mode

If [ and ] are causing trouble, just switch them out for \lbrack and \rbrack.
daviewales's user avatar
  • 1,323
26 votes
Accepted

How to remove box outlines around parenthesis/brackets in TexStudio?

I found the answer myself. These boxes are called placeholders. They can be removed by going to Options > Configure TexStudio. Then on the bottom left check Show Advanced Options. Go to the Completion ...
jkrod's user avatar
  • 603
25 votes
Accepted

Bracket in math and text

The purpose of LaTeX is to make a distinction between the content (here the writing of a pair) and the rendering (the font size, the shape (bold, italic, etc.), the indentation, etc.). You code the ...
ebosi's user avatar
  • 11.8k
19 votes
Accepted

Universal Parentheses

Making ( active is not really a solution because it is used in so many other ways, but here is how it would be done. To help in this regard. I create \pactive to make ( active which, if used inside a ...
Steven B. Segletes's user avatar
19 votes
Accepted

Why should I “enclose the previous parenthesis with ‘{}’”?

Apparently, the developer of chktex advises to always do something like {(a+b)}^2 which is not what's normally done. There's no need for it and the output is very disputable in typographic terms: ...
egreg's user avatar
  • 1.1m
19 votes
Accepted

Square bracket indicating "A or B or C"

Here is a solution that allows any number of choices for the bracket: The call for this output is \orbrace[.5]{A=0,B=0,C=0,D=0} The command \orbrace takes 2 arguments, one optional. The optional .5 ...
Sandy G's user avatar
  • 46.5k
18 votes

Automatic left and right commands

To make auto-sized bracketing as painless and concise as possible, here's what I do: \usepackage{mathtools} \DeclarePairedDelimiter\autobracket{(}{)} \newcommand{\br}[1]{\autobracket*{#1}} Example:...
Charles Clayton's user avatar
18 votes

How to remove box outlines around parenthesis/brackets in TexStudio?

The boxes are placeholders. You can navigate between them using Ctrl+Left/Right. They vanish, if you type over them e.g. if the cursor is before a closing bracket placeholder ), typing ) will move ...
Tim Hoffmann's user avatar
  • 11.2k
17 votes

How to write a function (piecewise) with bracket outside?

I think that in this case also the use of dcases can be recommended. It can be found in the mathtools package. Someone may prefer to have the arguments of the cases environment to be typeset in ...
Alessandro Cuttin's user avatar
17 votes

Universal Parentheses

An easy solution would just be to use the qty command from the physics package. Here's a MWE: \documentclass{article} \usepackage{physics} \begin{document} With \texttt{qty}: \[ \qty(m_{\frac\alpha\...
Troy's user avatar
  • 13.8k
17 votes
Accepted

Why do \left( \frac{a}{b} \right) and \left( \frac{b}{a} \right) have different sizes?

To see why this is the case, consider looking at the bounding box associated with the resulting \frac (or the numerator/denominator): \documentclass{article} \begin{document} \setlength{\fboxsep}{-\...
Werner's user avatar
  • 606k
16 votes
Accepted

Omit round brackets around equation numbers with cleveref

Using \creflabelformat as follows \creflabelformat{equation}{#2\textup{#1}#3} helps. \documentclass{scrreprt} \usepackage{mathtools} \usepackage{hyperref} \usepackage{cleveref} % see: https://tex....
TeXnician's user avatar
  • 33.7k
16 votes

How to insert curly bracket in multirow table

The bigdelimpackage, which comes with multirow is designed for this sort of things. I added some improvements of the table with makecell and booktabs: \documentclass[11pt]{report} \usepackage{...
Bernard's user avatar
  • 272k
16 votes

Big Bracket for equations

Add \left( and \right., but using equation and aligned: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \left( \begin{aligned} \frac{dS_d}{dt}&= A + \lambda_dR_d +...
egreg's user avatar
  • 1.1m
15 votes

Macros \dv and \pdv eat the subsequent parenthesis argument

The package physics abuses the possibilities afforded by xparse to define commands having very weird syntax. For instance, if you want to typeset the standard \frac{dx}{dt}, you have to type \dv{x}{...
egreg's user avatar
  • 1.1m
15 votes
Accepted

Diagonal brace with nested parenthesis

Very easy with horizontal brace; somewhat less easy with rotated brace. I have no time right now to implement a general solution, so I'll go with a brute-force version for now. \documentclass{article} ...
campa's user avatar
  • 31.7k
15 votes
Accepted

Curly braces with subscript and superscript

The subscript and the superscript should be below and [above] the ends of the right curly brace. Something like this? \documentclass{article} \usepackage{amsmath} % for "\overunderset" ...
Mico's user avatar
  • 513k
15 votes
Accepted

lbrack, rbrack vs [ and ]

LaTeX defines these via \def\lbrack{[} \def\rbrack{]} so there is no difference in behaviour. However the command forms can be used on keyboard layouts that make [] inconvenient. They can also bee ...
David Carlisle's user avatar
14 votes

Unstandardized brackets in matrix

I guess you're looking for \left\lceil and \right\rfloor. \documentclass{article} \usepackage{amsmath} % for 'matrix' environment \begin{document} \[ \left\lceil \begin{matrix} a_1 & a_2 & \...
Mico's user avatar
  • 513k
13 votes

Equation caption format: Strange parenthesis?

Here it is, with the \newtagform command from mathtools: \documentclass[12pt,a4paper]{article} \usepackage{blindtext} \usepackage{mathtools} \renewcommand{\theequation}{\Alph{equation}} \newtagform{...
Bernard's user avatar
  • 272k
13 votes
Accepted

Unstandardized brackets in matrix

It makes sense to define new environments for this task: \documentclass{article} \usepackage{amsmath} \makeatletter \newcommand{\newmatrix}[3]{% #1 = prefix, #2/#3 = left/right delimiters \...
egreg's user avatar
  • 1.1m
12 votes
Accepted

Why is the "4" missing, even in the PDF?

I suppose you're trying to obtain that \underbracket doesn't add spacing in the multiplications, and you want some negative math kerning. Here's how to do it. You'll probably have to make some ...
Bernard's user avatar
  • 272k
12 votes

How to make \{ and \} automatically have \left and \right

It's a very bad idea, really. See Is it ever bad to use \left and \right? However, we can find the definitions of \{ and \} in latex.ltx and see \DeclareRobustCommand{\{}{\ifmmode\lbrace\else\...
egreg's user avatar
  • 1.1m
12 votes
Accepted

Latex bracket on multiple lines

This works because stackengine can set equations with fixed baselineskip. \documentclass{article} \usepackage{tabstackengine,amsmath} \TABstackMath \stackMath \begin{document} \[ %\setstackgap{L}{1.1\...
Steven B. Segletes's user avatar
12 votes
Accepted

Which fields have to be {braced} or "quoted" in .bib files (why does year NOT have to be)?

A great documentation for everything BibTeX is Nicolas Markey's Tame the BeaST. (The more official documentation at https://ctan.org/pkg/bibtex is a bit lacking for most because it assumes knowledge ...
moewe's user avatar
  • 177k
11 votes

\bordermatrix with brackets [ ] instead of parentheses ( )

The package nicematrix provides tools to compose tabulars and mathematical tools. With that package, there is no problem to compose exterior rows and columns for a matrix with square brackets. \...
F. Pantigny's user avatar
  • 42.4k

Only top scored, non community-wiki answers of a minimum length are eligible