1

I want the equation to align left in this specific scenario(i.e. a nested enumerate) and dont want to change the environment setting for the whole article. How do i proceed? Below is my code and preamble

\documentclass{article}
\usepackage[a4paper,portrait, margin=1in]{geometry}
\usepackage{graphicx}
\graphicspath{ {./images/} }
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{float} %% keep tables and figures in float position
\usepackage[utf8]{inputenc}

...

\item Find the unique cubic polynomial P that satisfies 
    \begin{equation*}
        P(-2) = 1, P(-1) = 4 P(0) = 2, P(2) = 4.
    \end{equation*}
    Write P in both the Lagrange and Newton forms 
    \begin{itemize}
        \item Lagrange: $construct l_j for j \in  [1,4]$ \par
        \begin{equation*}
            \begin{aligned}
                l_1(x) = \frac{1}{-8}(x+1)x(x-2) \\
                l_2(x) = \frac{1}{3}(x+2)x(x-2) \\
                l_3(x) = \frac{1}{-4}(x+2)(x+1)(x-2) \\
                l_4(x) = \frac{1}{24}(x+2)(x+1)x \\
                P(x) = l_1(x)+4l_2(x)+2l_3(x)+4l_4(x)    
            \end{aligned}
        \end{equation*}
        \item Newton

enter image description here

  • 2
    Welcome to TeX SX! You have to specify the alignment point with an ampersand. If you don't, the equations will be aligned at the end of line, i.e. right-aligned. This being sais=d, what you want is not very clear. Do you want the equations to be aligned at the left margin of the enumeration perhaps (i.e. under the L of Lagrange)? – Bernard Apr 7 at 9:30
0

I will assume that you wish to align the 5 equations in the aligned environment on their respective = ("is equal to") symbols. The & ("ampersand") symbol should be used to indicate the desired alignment points. (As you've discovered, if no alignment points are specified, the equations end up being right-aligned.)

enter image description here

\documentclass{article}
\usepackage[a4paper,portrait,margin=1in]{geometry}
\usepackage{graphicx}
\graphicspath{ {./images/} }
\usepackage{amsmath,amssymb}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\begin{itemize}
\item Find the unique cubic polynomial $P$ that satisfies 
    \begin{equation*}
        P(-2)=1,\quad P(-1)=4,\quad P(0)=2,\quad P(2)=4\,.
    \end{equation*}
\item Write $P$ in both the Lagrange and Newton forms.
    \begin{itemize}
    \item Lagrange: Construct $l_j$ for $j \in \{1,2,3,4\}$ 
        \begin{equation*}
            \begin{aligned}
                l_1(x) &= -\frac{1}{8}(x+1)x(x-2) \\
                l_2(x) &= \frac{1}{3}(x+2)x(x-2) \\
                l_3(x) &= -\frac{1}{4}(x+2)(x+1)(x-2) \\
                l_4(x) &= \frac{1}{24}(x+2)(x+1)x \\
                P(x)   &= l_1(x) +4l_2(x) +2l_3(x) +4l_4(x)    
            \end{aligned}
        \end{equation*}
        \item Newton: \dots
    \end{itemize}
\end{itemize}
\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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