## LaTeX forum ⇒ Math & Science ⇒ Block 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*}

HI!

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

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

current.png (45.88 KiB) Viewed 451 times

desired.png (48.02 KiB) Viewed 451 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.

Stefan Kottwitz
Posts: 9785
Joined: Mon Mar 10, 2008 9:44 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

Bartman
Posts: 240
Joined: Fri Jan 03, 2020 2:39 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
Hi Bartman

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
Please post a complete minimal 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
current.png (35.72 KiB) Viewed 426 times

centered.png (38.62 KiB) Viewed 426 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
I'd like to recommend using the second solution with the alignat environment:

\documentclass{article}

\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}
\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
Bartman, I am amazed !!!

Will use the second solution

Many thanks !!!

bartman.png (53.74 KiB) Viewed 424 times