Math & ScienceSame size inner brackets

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
rafaelangarita
Posts: 4
Joined: Mon Feb 08, 2010 6:53 pm

Same size inner brackets

Post by rafaelangarita »

Hello,

I'm writing the next formula:

Code: Select all


\[ \left\{  \left[   \frac{ab}{b} \right] , \left[   \frac{aa}{a} \right]     \right\} \]

The problem is that the height of the brackets don't match with each other. It seems they are as high as the letters they are enclosing.

How can I make the second pair of brackets be as high as the first pair?

Thank you very much!

Recommended reading 2024:

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

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

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Same size inner brackets

Post by php1ic »

Can you post an example code. This produces equal size brackets for me

Code: Select all

\documentclass[11pt,a4paper]{article}
\begin{document}

\[ \left\{  \left[   \frac{ab}{b} \right] , \left[   \frac{aa}{a} \right]     \right\} \]

\end{document}
rafaelangarita
Posts: 4
Joined: Mon Feb 08, 2010 6:53 pm

Re: Same size inner brackets

Post by rafaelangarita »

Thank you, you are right. Your answer helped me realize what the problem was:

I was trying to use the package amsmath which I don't have installed.

Thank you very much.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Same size inner brackets

Post by localghost »

Keeping the automatic adjust of the delimiters I see two possible solutions.

Code: Select all

\[
  \left\{\left[\frac{ab}{b}\right] ,\left[\frac{aa\vphantom{b}}{a\vphantom{b}}\right]\right\}
\]

\[
  \left\{\left[\frac{\smash{ab}}{\smash{b}}\right] ,\left[\frac{aa}{a}\right]\right\}
\]
But there's always the possibility of doing a manual adjustment of delimiters.
php1ic wrote:[...] This produces equal size brackets for me. [...]
Here's an example where it's not working.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}

\begin{document}
  \[
    \left\{\left[\frac{ab}{b}\right],\left[\frac{aa}{a}\right]\right\}
  \]
\end{document}
Caused by the amsmath package.


Best regards and welcome to the board
Thorsten
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Same size inner brackets

Post by phi »

localghost wrote: Here's an example where it's not working.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}

\begin{document}
  \[
    \left\{\left[\frac{ab}{b}\right],\left[\frac{aa}{a}\right]\right\}
  \]
\end{document}
Very interesting. I've done a bit of research, but was unable to find out why this happens. Initializing the math fonts before loading amsmath prevents this, but I'm not sure what exactly happens here.

Code: Select all

\documentclass[11pt]{article}
\makeatletter
\csname S@10.95\endcsname
% {\escapechar\m@ne\mv@normal}% Uncomment this line
\makeatother
\usepackage{amsmath}
\begin{document}
$\displaystyle\left[\frac ba\right]\left[\frac aa\right]$
\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Same size inner brackets

Post by localghost »

Nice workaround. But it fails if fonts packages like txfonts or pxfonts are loaded. On the other hand it works with lmodern.
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Re: Same size inner brackets

Post by phi »

This is not intended as a workaround, I just want to know what exactly causes this behavior. I'll ask in the newsgroup.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Same size inner brackets

Post by CrazyHorse »

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}

\begin{document}
  \[\delimiterfactor=1020
    \left\{\left[\frac{ab}{b}\right],\left[\frac{aa}{a}\right]\right\}
  \]
\end{document}
Post Reply