Generalbracket messed up!

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
juliette
Posts: 75
Joined: Thu Nov 20, 2008 10:15 pm

bracket messed up!

Post by juliette »

for some reason my left bracket turns out smaller than my right bracket! Does this happen to anyone else or just me ??

Code: Select all

\documentclass{report}
\usepackage{amsmath}
\usepackage{tipa}

\begin{document}

$\cos\!\left(\frac{r}{\textrm{\textcrlambda}_{SP}}\right)$

\end{document}

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

bracket messed up!

Post by frabjous »

What distribution/version of LaTeX are you using?

I can't even compile your sample code (TeXlive 2008), because it tells me that \! can't be used in mathmode. However, both:

$\cos\left(\frac{r}{\textrm{\textcrlambda}_{SP}}\right)$

and

$\cos\negthinspace\left(\frac{r}{\textrm{\textcrlambda}_{SP}}\right)$


(with the rest unchanged)

give me equal-sized brackets on the sides.

(Edit/P.S. I guess it was compiling with \! in there, only with errors--I have Kile set up not to view the output if there are errors, so I just assumed it didn't compile. Then, yes, the parentheses are different sizes. The problem seems to be the \!. I'd just use \negthinspace instead, or leave it out.)
juliette
Posts: 75
Joined: Thu Nov 20, 2008 10:15 pm

Re: bracket messed up!

Post by juliette »

Thanks frabjous!

You're right, the \! was the problem. Someone sent me that code, and he uses a unix-based tex compiler while I use TeXnicCenter, so maybe it works on his compiler and not on ours. Thanks again.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: bracket messed up!

Post by frabjous »

I'm using Linux, so I doubt that's it. Perhaps one of us just has an older version than the other.

I can't really figure out why \! can't be used in math mode. From what I've read, \! is just an abbreviation of \negthinspace, and even documents prepared by the AMS show \! being used in mathmode... but for some reason, \negthinspace works better.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

bracket messed up!

Post by Juanjo »

From the manual of the tipa package (cf. subsubsection 3.2.4):
TIPA defines \*, \:, \; and \! as special macros in order to easily input phonetic symbols that do not have a shortcut character explained above. Before explaining how to use these macros, it is necessary to note that these macros are primarily intended to be used by linguists who usually do not care about things in math mode. And they can be ‘dangerous’ in that they override existing LaTeX commands used in the math mode. So if you want to preserve the original meaning of these commands, declare the option ‘safe’ at the preamble.
In other words, by default, tipa redefines \!. To restore its original meaning, load tipa as follows:

Code: Select all

\usepackage[safe]{tipa}
With this small change, the code in the opening post works perfectly. BTW, I would replace SP by \text{SP} or \textit{SP}.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Post Reply