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

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

Block of Equations Alignment \begin{equation*}

Post by Darkoni »

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

Code: Select all

\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.

Recommended reading 2024:

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

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

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

Block of Equations Alignment \begin{equation*}

Post by Stefan Kottwitz »

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: 369
Joined: Fri Jan 03, 2020 2:39 pm

Block of Equations Alignment \begin{equation*}

Post by Bartman »

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

Block of Equations Alignment \begin{equation*}

Post by Darkoni »

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

Code: Select all

\begin{alignat}{2}
and

Code: Select all

\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.

Code: Select all

\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: 369
Joined: Fri Jan 03, 2020 2:39 pm

Block of Equations Alignment \begin{equation*}

Post by Bartman »

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

Block of Equations Alignment \begin{equation*}

Post by Darkoni »

current.png
current.png (35.72 KiB) Viewed 11514 times
centered.png
centered.png (38.62 KiB) Viewed 11514 times
Here is the code, with remarked \begin{alignat} and \end{alignat}

Code: Select all

\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: 369
Joined: Fri Jan 03, 2020 2:39 pm

Block of Equations Alignment \begin{equation*}

Post by Bartman »

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

Code: Select all

\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

Block of Equations Alignment \begin{equation*}

Post by Darkoni »

Bartman, I am amazed !!!

Will use the second solution :-)

Many thanks !!!
bartman.png
bartman.png (53.74 KiB) Viewed 11512 times
Post Reply