Math & Sciencebraces under matrix entry affect matrix braces

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Wayne_Durden
Posts: 3
Joined: Fri Dec 17, 2010 6:26 pm

braces under matrix entry affect matrix braces

Post by Wayne_Durden »

Hi,

I got a "problem" (if you can call it one) with brackets under entries in a matrix:
They affect the brackets of the matrix, so the whole thing looks kind of weird, because the bracket "get's part of the matrix entry" and causes a higher bracket.
Is it possible to arrange the brackets "under" the matrix, not affecting the entry/column they are referring?

I hope I could explain my problem.

Greetings
Last edited by Wayne_Durden on Sat Dec 18, 2010 11:35 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.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

braces under matrix entry affect matrix braces

Post by frabjous »

Wayne_Durden wrote:
I hope I could explain my problem.

Greetings
Code containing a minimal example of what you mean would be better.
Wayne_Durden
Posts: 3
Joined: Fri Dec 17, 2010 6:26 pm

braces under matrix entry affect matrix braces

Post by Wayne_Durden »

Oh, I am sorry I didn't mention that!

Here's the code:

Code: Select all

\begin{equation} \left[\begin{array}{c} \begin{array}{c} \dot{s}
\end{array}\\ \dot{v}\end{array}\right]=\left[\begin{array}{cc} 
0 & 1\\ 0 & \underbrace{-\frac{d_{m}}{m_{red}}}_{Reibverl.}
\underbrace{-\frac{i_{\textrm{A}}^{2}k_{m}^{2}}
{r^{2}m_{red}R_{\textrm{A}}}}_{elektr.\, Verl.}\end{array}
\right]\cdot\left[\begin{array}{c} s\\ v\end{array}\right]+
\left[\begin{array}{c} 0\\ 
\underbrace{\frac{i_{\textrm{A}}k_{m}}
{rR_{\textrm{A}}}}_{\text{ß}}\cdot\frac{1}{m_{red}}\end{array}
\right]u_{\textrm{A}}\end{equation}
(The code is exported from a LyX-file btw)
I hope this helps!
Thanks a log!
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

braces under matrix entry affect matrix braces

Post by frabjous »

Here I define a \myunderbrace command which ignores the underbrace part for height calculations. Notice that its syntax is \myunderbrace{..}{...} rather than \myunderbrace{..}_{..} as with standard \underbrace. I'd explain the details but it might be better for you to work them out on your own, and/or tweak it if need be.

Code: Select all

\documentclass{article}

\newlength{\bracewidth}

\newcommand{\myunderbrace}[2]{\settowidth{\bracewidth}{$#1$}#1\hspace*{-1\bracewidth}\smash{\underbrace{\makebox{\phantom{$#1$}}}_{#2}}}

\usepackage{amsmath}

\begin{document} 
\begin{equation} \left[\begin{array}{c} \begin{array}{c} \dot{s}
\end{array}\\ \dot{v}\end{array}\right]=\left[\begin{array}{cc}
0 & 1\\ 0 & \myunderbrace{-\frac{d_{m}}{m_{\textit{red}}}}{\textit{Reibverl.}}
\myunderbrace{-\frac{i_{\textrm{A}}^{2}k_{m}^{2}}
{r^{2}m_{\textit{red}}R_{\textrm{A}}}}{\textit{elektr.\ Verl.}}\end{array}
\right]\cdot\left[\begin{array}{c} s\\ v\end{array}\right]+
\left[\begin{array}{c} 0\\
\myunderbrace{\frac{i_{\textrm{A}}k_{m}}
{rR_{\textrm{A}}}}{\text{\ss}}\cdot\frac{1}{m_{\textit{red}}}\end{array}
\right]u_{\textrm{A}}\end{equation}

\end{document}
This generates:
brace.png
brace.png (5.48 KiB) Viewed 8751 times
Is that what you had in mind?
Wayne_Durden
Posts: 3
Joined: Fri Dec 17, 2010 6:26 pm

Re: braces under matrix entry affect matrix braces

Post by Wayne_Durden »

Thank you a lot! That was exactly I was looking for!
You made my day!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

braces under matrix entry affect matrix braces

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic (not the last post) accordingly as clearly written in Section 3 of the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.


Best regards and welcome to the board
Thorsten
Post Reply