Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using IEEEeqnarray environment and want to left align a text. How to do that?

\documentclass[a4paper, 10pt, conference]{ieeeconf}
\usepackage{amsmath} % assumes amsmath package installed
\interdisplaylinepenalty=10000
\begin{document}
\begin{IEEEeqnarray}{C}
    p(t) = \sum_{k=1}^M a_k \cos(k\w_f t + \phi_k) = \sum_{k=1}^M h_k(t) \label{eq:pli} \\
\text{where} 
    h_k(t) = a_k \cos(k\w_f t + \phi_k)  \label{eq:plih}
\end{IEEEeqnarray}
end{document}
share|improve this question
2  
Welcome to TeX.SX! It would be helpful if you added a minimal preamble showing the class you're using and the necessary packages to typeset the example. –  egreg Mar 10 '12 at 10:52
add comment

2 Answers

without an example, this is untested, but if the IEEE class doesn't provide anything for this, the TeX primitive \noalign probably does something similar to what you need.

... \label{eq:pli}\\
\noalign{\noindent where}
 h_k(t) =
share|improve this answer
    
Thanks for your reply. however this does not work in IEEEeqnarray environment. Thanks anyway –  mreza k Mar 14 '12 at 7:17
    
"does not work" doesn't give us much to go on. please supply a minimum example showing the class you are using (the different IEEE classes have different implementations of ieeeeqnarray) –  David Carlisle Mar 14 '12 at 9:40
add comment

There are a few things wrong with what you are trying to do. For example, you haven't given IEEEeqnarray the column alignment specifier. Note that, as you appear to be using \text you must have the amsmath package loaded. I won't use that, but we'll come back to amsmath in a moment. A minimal working example for your equation may be the following:

\documentclass{article}
\usepackage{IEEEtrantools}
\usepackage{lipsum}

\begin{document}

\lipsum[2]
\begin{IEEEeqnarray}{lrCl}
    &p(t) &=& \sum_{k=1}^M a_k \cos(k\omega_f t + \phi_k) = \sum_{k=1}^M h_k(t) \label{eq:pli} \\
\mbox{where}\nonumber\\
    &h_k(t) &=& a_k \cos(k\omega_f t + \phi_k)  \label{eq:plih}
\end{IEEEeqnarray}

\end{document}

Note the addition of the column specifier {lrCl} when beginning the environment. The l will be used to left align the text and the rest is reasonably clear. Apparently the C is capitalised to give a little more space either side of that column. Note also the addition of \nonumber and \\ for your text to suppress numbering and start a new row. I have also used \mbox so that I don't have to load the amsmath package. You also missed out the necessary & characters for alignment. This looks like:

enter image description here

Now, I don't think I've ever heard of the IEEEtrantools package before, and it's better to use a more supported and feature complete package like amsmath. The amsmath package happens to have a command just for what you want to do (\intertext{...}), and provides a number of useful display mathematics environments. The closest to what you want is the align environment:

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}

\begin{document}

\lipsum[2]
\begin{align}
    p(t) &= \sum_{k=1}^M a_k \cos(k\omega_f t + \phi_k) = \sum_{k=1}^M h_k(t) \label{eq:pli} \\
\intertext{where}
    h_k(t) &= a_k \cos(k\omega_f t + \phi_k)  \label{eq:plih}
\end{align}

\end{document}

This aligns the text to the far left (which is perhaps what you really want). Note that it's far simpler to get this output, with no column alignment specifier needed, and only a couple of & characters. The vertical spacing between the text and the equations is also far better.

enter image description here

share|improve this answer
    
Thank you for your detailed and helpful comment. I'll try to use align envv, how to use equation subnumbers in this environment? like a=b+c (1a) f=d+g (1b) –  mreza k Mar 14 '12 at 7:18
    
amsmath provides an environment for sub-equations. See tex.stackexchange.com/questions/14027/using-subequations for an example on how to use it. –  qubyte Mar 14 '12 at 7:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.