Text FormattingEnumerate and Equation

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
limus
Posts: 2
Joined: Sun Aug 08, 2021 7:01 pm

Enumerate and Equation

Post by limus »

Hello, I'm new to latex. I want to use latex in my website (wordpress based). Is there any way to create such equation? I need the equation starts right after numbering and align the = sign
image_2021-08-09_001831.png
image_2021-08-09_001831.png (10.33 KiB) Viewed 3816 times
Note: the equal = in number 1 and 2 doesn't need to be in same align

Thanks in advance

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Enumerate and Equation

Post by Stefan Kottwitz »

Hi Limus,

welcome to the forum!

Sure, what's the specific question? Is it about aligning the equal signs of the first equation? Or about typing all code? If you show is the code you have, we can help improving it and give working code.

Do you use a LaTeX Wordpress plugin? Btw. you can use a LaTeX compiler right on your wordpress website, such as on LaTeX-Cookbook.net.

Stefan
LaTeX.org admin
limus
Posts: 2
Joined: Sun Aug 08, 2021 7:01 pm

Enumerate and Equation

Post by limus »

Stefan Kottwitz wrote:Hi Limus,

welcome to the forum!

Sure, what's the specific question? Is it about aligning the equal signs of the first equation? Or about typing all code? If you show is the code you have, we can help improving it and give working code.

Do you use a LaTeX Wordpress plugin? Btw. you can use a LaTeX compiler right on your wordpress website, such as on LaTeX-Cookbook.net.

Stefan
I use Simple Mathjax since it works best with Gutenberg Block. Sorry, I forgot to mention that I wrote the equation in Ms. Word.

I tried this code

\begin{enumerate}
\item \begin{flalign*}f(x)g(x)&=\left(2x^2+3x-4\right)\left(3x^2-2x\right)&\\
&=6x^4-4x^3+9x^3-6x^2-12x^2+8x&\\
&=6x^4+5x^3-18x^2+8x&\end{flalign*}
\item $f(x)g(x)=\left(2x^2+3x-4\right)\left(3x^2-2x\right)\\
=6x^4-4x^3+9x^3-6x^2-12x^2+8x\\
=6x^4+5x^3-18x^2+8x\\D_{f\times g}=D_{f}+D_{g}=2+2=4$
\end{enumerate}

I want the equal sign (=) align like number 1 and the equation start after the numbering like number 2, is there any way to handle it? Again, thank you for your response
Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Enumerate and Equation

Post by Bartman »

Please try to provide a Infominimal working example.

The aligned environment could fit these requirements.

Code: Select all

\documentclass{article}
\usepackage{mathtools}% loads amsmath

\begin{document}
\begin{enumerate}
\item $\begin{aligned}[t] 
f(x)g(x)&=\left(2x^2+3x-4\right)\left(3x^2-2x\right)\\
        &=6x^4-4x^3+9x^3-6x^2-12x^2+8x\\
        &=6x^4+5x^3-18x^2+8x
\end{aligned}$
\end{enumerate}
\end{document}
Post Reply