Math & ScienceCurly Braces in Equation

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Amitavo Roy
Posts: 14
Joined: Sat Apr 06, 2013 11:50 am

Curly Braces in Equation

Post by Amitavo Roy »

I am new with LaTeX. I don't understand why this code line is not working.

Code: Select all

\begin{equation}
\label{eq:4.20}
\eta_{elec}=
\left{
\frac {\gamma_{j,in} - {\langle{\gamma_j}\rangle}_j} {\gamma_{j,in}-1}
\right}
\end{equation}
Please suggest me
Last edited by cgnieder on Sun Apr 07, 2013 11:25 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Curly Braces in Equation

Post by localghost »

And please always provide a self-contained and minimal example to give an adequate problem description. Those who try to help are rarely motivated to write a complete example from scratch.

If you want curly braces in the output, you have to escape them by a backslash (\) and so make them a command. Curly braces are usually used for grouping so this measure is necessary to get them printed.

The actual error is caused by the fact that \left and \right expect a delimiter (braces, brackets, parentheses). otherwise they will produce error.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackahe{mathtools}  % loads »amsmath«

\begin{document}
  \begin{equation}\label{eq:dummy}
    \eta_text{elec}=\left\{\frac{\gamma_{j,in} - \langle\gamma_j\rangle_j}{\gamma_{j,in}-1}\right\}
  \end{equation}
\end{document}
For more clarity in your code you should avoid superfluous braces (see above).


Basic reading:
Further reading:

Thorsten
Amitavo Roy
Posts: 14
Joined: Sat Apr 06, 2013 11:50 am

Curly Braces in Equation

Post by Amitavo Roy »

Thanks a lot, localghost.

Now it is perfect.
Post Reply