Math & ScienceA misplaced comma

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
NELLLY
Posts: 113
Joined: Thu Nov 26, 2009 2:21 am

A misplaced comma

Post by NELLLY »

Hi
when I wrote

Code: Select all

\begin{eqnarray*}
I_1&=&\left[\mu_0-\frac{\rm k_1 \sigma}{\rm \sqrt{n_1}},
\mu_0+\frac{\rm k_1\sigma} {\sqrt{n_1}}\right]
\end{eqnarray*}
the comma is not aligned with the line of the fraction, is there a solution?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

A misplaced comma

Post by gmedina »

Hi,

try something like this:

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
  I_1 &= \left[\mu_0-\frac{\rm k_1 \sigma}{\rm \sqrt{n_1}}\raisebox{.7mm}{,}\,
    \mu_0+\frac{\rm k_1\sigma} {\sqrt{n_1}}\right]
\end{align*}

\end{document}
Reasons not to use eqnarray (and its relatives) can be found in some other threads.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

A misplaced comma

Post by localghost »

You should not use the eqnarray environment anymore [1]. This behaviour is quite usual since the comma is placed on the baseline in opposite to the fraction bar. If you want to modify that, try the \raisebox command. But think that would disturb the appearance generally.

[1] The PracTeX Journal - TeX Users Group | Lars Madsen: Avoid eqnarray!


Best regards
Thorsten
NELLLY
Posts: 113
Joined: Thu Nov 26, 2009 2:21 am

Re: A misplaced comma

Post by NELLLY »

This works perfectly. Thank you very much.
Post Reply