LaTeX forum ⇒ Math & ScienceBlock of Equations Alignment \begin{equation*}

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Darkoni
Posts: 4
Joined: Mon Oct 11, 2021 4:21 pm

Block of Equations Alignment \begin{equation*}

Postby Darkoni » Mon Oct 11, 2021 5:59 pm

HI!

Please, help me with finishing document with some physics formulas.

All what has to be done is to align by equal sign.

Please, see the pictures.

current.png
current.png (45.88 KiB) Viewed 452 times


desired.png
desired.png (48.02 KiB) Viewed 452 times


\documentclass{article}

\usepackage[most]{tcolorbox}

\pagenumbering{gobble}

\begin{document}

\begin{equation*}
	\bar {v} = \frac{s_{uk}}{t_{uk}}
\end{equation*}

\begin{equation*}
	\left.\begin{aligned}
		s_{uk} &= s_1 + s_2 \\
		t_{uk} &= t_1 + t_2 
	\end{aligned}
	\right\}
	\quad \bar{v} = \frac{s_1 + s_2}{t_1+t_2}
\end{equation*}

\bigskip

\begin{equation*}
	\left.\begin{aligned}
		s_1 &= v_1 \cdot t_1 \\
		s_2 &= v_2 \cdot t_2
	\end{aligned}
	\right\}
	\quad t_{uk} \cdot \bar{v} = v_1 \cdot t_1 + v_2 \cdot t_2
\end{equation*}

\bigskip

\centerline{	\color[HTML]{DD0000}{\textbf{Current document}}}

\bigskip

%\centerline{ \color[HTML]{00BB00}{\textbf{Desired centered equations}}}

\end{document}


Many thanks!

Darko

PS: Stefan, many thanks for explaining me about attachments - i did not see tab. Silly me :-)
Last edited by Darkoni on Mon Oct 11, 2021 7:21 pm, edited 2 times in total.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9785
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Oct 11, 2021 6:42 pm

Hi Darko,

welcome to the forum!

The imgshare.io links are dead, no images there. But you can post the images here as attachments. The "Attachments" link is below the text edit field, when you write a post.

Stefan
LaTeX.org admin

Bartman
Posts: 240
Joined: Fri Jan 03, 2020 2:39 pm

Postby Bartman » Mon Oct 11, 2021 8:01 pm

The content of the last equation environment is different from the output in the attached figures.

You can replace the three equation environments by an alignat environment.

The mathmode document by Mr. Voß on CTAN may help to understand how this and other environments of the mathematical mode work.

Darkoni
Posts: 4
Joined: Mon Oct 11, 2021 4:21 pm

Postby Darkoni » Mon Oct 11, 2021 8:36 pm

Hi Bartman

Thanks for answer.

And the equation is in did different, as i wish to show that before equal sign ( = ) could be more variables...

I did not take another screenshot. Sorry for that.

And, i really do not know how to implement alignat as after i add
\begin{alignat}{2}
and
\end{alignat}
i get an error.

Also, how to specify i wish to align on = ?

Again, here are equations that i wish to align on = sign.

\begin{equation*}
	\bar {v} = \frac{s_{uk}}{t_{uk}}
\end{equation*}

\begin{equation*}
	\left.\begin{aligned}
		s_{uk} &= s_1 + s_2 \\
		t_{uk} &= t_1 + t_2 
	\end{aligned}
	\right\}
	\quad \bar{v} = \frac{s_1 + s_2}{t_1+t_2}
\end{equation*}

\bigskip

\begin{equation*}
	\left.\begin{aligned}
		s_1 &= v_1 \cdot t_1 \\
		s_2 &= v_2 \cdot t_2
	\end{aligned}
	\right\}
	\quad t_{uk} \cdot \bar{v} = v_1 \cdot t_1 + v_2 \cdot t_2
\end{equation*}


Darko

Bartman
Posts: 240
Joined: Fri Jan 03, 2020 2:39 pm

Postby Bartman » Mon Oct 11, 2021 9:50 pm

Please post a complete Infominimal working example with the added alignat environment (in your case the starred version) that generates the error message.

Darkoni
Posts: 4
Joined: Mon Oct 11, 2021 4:21 pm

Postby Darkoni » Mon Oct 11, 2021 10:18 pm

current.png
current.png (35.72 KiB) Viewed 427 times


centered.png
centered.png (38.62 KiB) Viewed 427 times


Here is the code, with remarked \begin{alignat} and \end{alignat}

\documentclass{article}

\usepackage[most]{tcolorbox}

\pagenumbering{gobble}

\begin{document}

% \begin{alignat}

\begin{equation*}
	\bar {v} = \frac{s_{uk}}{t_{uk}}
\end{equation*}

\begin{equation*}
	\left.\begin{aligned}
		s_{uk} &= s_1 + s_2 \\
		t_{uk} &= t_1 + t_2 
	\end{aligned}
	\right\}
	\quad \bar{v} = \frac{s_1 + s_2}{t_1+t_2}
\end{equation*}

\bigskip

\begin{equation*}
	\left.\begin{aligned}
		s_1 &= v_1 \cdot t_1 \\
		s_2 &= v_2 \cdot t_2
	\end{aligned}
	\right\}
	\quad t_{uk} \cdot \bar{v} = v_1 \cdot t_1 + v_2 \cdot t_2
\end{equation*}

% \end{alignat}

\bigskip

\centerline{	\color[HTML]{DD0000}{\textbf{Current document}}}

\bigskip

\centerline{ \color[HTML]{00BB00}{\textbf{Desired centered equations}}}

\end{document}


I am really stucked on this, as I can not find solution. I can not find similar example.

Darko

Bartman
Posts: 240
Joined: Fri Jan 03, 2020 2:39 pm

Postby Bartman » Mon Oct 11, 2021 10:28 pm

I'd like to recommend using the second solution with the alignat environment:

\documentclass{article}
\usepackage[most]{tcolorbox}% option most loads amsmath

\begin{document}
\begin{align*}
	\bar{v} & = \frac{s_{uk}}{t_{uk}}\\
	\left.\begin{aligned}
		s_{uk} &= s_1 + s_2 \\
		t_{uk} &= t_1 + t_2 
	\end{aligned}
	\right\}
	\quad\bar{v} & =  \frac{s_1 + s_2}{t_1+t_2}\\
	\left.\begin{aligned}
		s_1 &= v_1 \cdot t_1 \\
		s_2 &= v_2 \cdot t_2
	\end{aligned}
	\right\}
	\quad t_{uk} \cdot \bar{v} & = v_1 \cdot t_1 + v_2 \cdot t_2
\end{align*}

\begin{alignat*}{2}
	&& \quad\bar{v} & = \frac{s_{uk}}{t_{uk}}\\
	\left.\begin{aligned}
		s_{uk} &= s_1 + s_2 \\
		t_{uk} &= t_1 + t_2 
	\end{aligned}
	\right\}
	&& \quad\bar{v} & =  \frac{s_1 + s_2}{t_1+t_2}\\
	\left.\begin{aligned}
		s_1 &= v_1 \cdot t_1 \\
		s_2 &= v_2 \cdot t_2
	\end{aligned}
	\right\}
	&& \quad t_{uk} \cdot \bar{v} & = v_1 \cdot t_1 + v_2 \cdot t_2
\end{alignat*}
\end{document}

Darkoni
Posts: 4
Joined: Mon Oct 11, 2021 4:21 pm

Postby Darkoni » Mon Oct 11, 2021 10:48 pm

Bartman, I am amazed !!!

Will use the second solution :-)

Many thanks !!!

bartman.png
bartman.png (53.74 KiB) Viewed 425 times


Return to “Math & Science”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 3 guests