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.

Hi I wish to number equations with a list environment

\begin{itemize}
\item Lol
\begin{equation}
y_t=h_t(\hat{x}_{t|t-1})
\end{equation}
\end{itemize}

I want y_t=h_t(\hat{x}_{t|t-1}) in the same line of Lol... Can you help me to find out a way?

share|improve this question
1  
In the same line? Just write inline formula with $ $. You can not number an inline expression. –  Sigur Dec 31 '12 at 11:07
add comment

3 Answers

up vote 3 down vote accepted

This has good alignments, but the text part of item (Lol and Hackety hack.) shouldn't be too large:

\documentclass{article}


\begin{document}
First an equation.
\begin{equation}
f(x) = \sin(x)
\end{equation}
Then a list.
\begin{itemize}
\item Lol \hfill \makebox[0pt][r]{%
            \begin{minipage}[b]{\textwidth}
              \begin{equation}
                 y_t=h_t(\hat{x}_{t|t-1})
              \end{equation}
          \end{minipage}}
\item Hackety hack. \hfill \makebox[0pt][r]{%
            \begin{minipage}[b]{\textwidth}
              \begin{equation}
                 a = b
              \end{equation}
          \end{minipage}}
\end{itemize}
And another equation.
\begin{equation}
 g(x) = \cos(x)
\end{equation}

\end{document}

enter image description here

share|improve this answer
add comment

This probably works really bad in a lot of cases:

enter image description here

\documentclass{article}
\newcommand{\listequationnumber}{\refstepcounter{equation}(\theequation)}
\newcommand{\listequation}[1]{\hfill$\displaystyle #1$\hfill\listequationnumber}

\begin{document}
First an equation.
\begin{equation}
f(x) = \sin(x)
\end{equation}
Then a list.
\begin{itemize}
\item Lol \listequation{y_t=h_t(\hat{x}_{t|t-1})}
\item Hackety hack. \listequation{a = b}
\end{itemize}
And another equation.
\begin{equation}
 g(x) = \cos(x)
\end{equation}

\end{document}
share|improve this answer
    
This solved my question.. But is there any way to improve the equation alignment? Thank you so much! –  Vincenzo Dec 31 '12 at 12:57
add comment

You can use the paralist package, especially the inparaenum environment should be what you are looking for.

Code

\documentclass{article}
\usepackage{paralist}

\begin{document}
\begin{inparaenum}[(1)]
\item lol
\item $y_t=h_t(\hat{x}_{t|t-1})$
\item lol
\end{inparaenum}
\end{document}

Output

Output

share|improve this answer
    
Oh, nice. But the equation is not numbered using the equation counter, is it? The number comes from the list. –  Sigur Dec 31 '12 at 11:32
    
@Sigur that's right, if the equation numbering must come through the equation environment, your comment holds true, at least to my knowledge one can't number inline expressions. –  xfoo Dec 31 '12 at 11:39
    
Thanks but the equation is not numbered using the equation counter, so this don't answer my question... –  Vincenzo Dec 31 '12 at 11:48
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.