I'm quite new to latex and need help making my equations in enumerate aligned by "b" for school project.
Thank you for your help!
I'm quite new to latex and need help making my equations in enumerate aligned by "b" for school project.
Thank you for your help!
A solution with listliketab in the place of `enumerate:
\documentclass[11pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{listliketab}
\begin{document}
\storestyleof{enumerate}
\newcounter{tabenum}\setcounter{tabenum}{0}
\newcommand{\tabitem}{\refstepcounter{tabenum}\thetabenum)}
\setlength{\tabcolsep}{1em}
\begin{listliketab}
\begin{tabular}{L*{2}{>{$}l<{$}}}
\tabitem & a = 5, & b = 3 \,; \\
\tabitem & a = 4, & b = 6 \,; \\
\tabitem & a =3{,}2, & b = 2{,}3 \,; \\
\tabitem & a = 2\sqrt{5}, & b = 3\sqrt{5} \,; \\
\tabitem & a = \sqrt{3}, & b = \sqrt{7} \,; \\
\tabitem & a = 1, & b = √{0{,}1}.
\end{tabular}
\end{listliketab}
\end{document}
Another solution, based on a code by @Werner for switching between left and right equation numbers within the same document, and the fleqn environment from nccmath. The = signs will be aligned in both columns:
\documentclass[11pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{nccmath}
\makeatletter
\newcommand{\leqnomode}{\tagsleft@true}
\newcommand{\reqnomode}{\tagsleft@false}
\makeatother
\begin{document}
\begin{fleqn}[2em]
\leqnomode
\begin{alignat}{2}
a &= 5, & b & = 3 \,; \\
a & = 4, & b & = 6 \,; \\
a & =3{,}2, & b & = 2{,}3 \, ; \\
a & = 2\sqrt{5}, &\qquad b & = 3\sqrt{5} \, ; \\
a & = \sqrt{3}, & b & = \sqrt{7} \, ; \\
a & = 1, & b & = \sqrt{0{,}1}.
\end{alignat}
\end{fleqn}
\begin{align}
f(x) &= ax^2 + bx + c \\
g(x) &= dx^2 + ex + f
\end{align}
\end{document}
./ListLikeTab-ex.tex:20: Package inputenc Error: Unicode char √ (U+221A) (inputenc) not set up for use with LaTeX. Using MacTeX 2017 updated this morning.
– sgmoye
Dec 17 '17 at 12:20
https://ctan.org/tex-archive/macros/latex/contrib, but it's better to install it via your package manager.
– Bernard
Dec 17 '17 at 18:21