Page LayoutText aligned to first Line of Table or System of Equations

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
collertom
Posts: 1
Joined: Sun May 06, 2012 7:40 pm

Text aligned to first Line of Table or System of Equations

Post by collertom »

I need to place text (one word or string) near align* or tabular environment. String (in example Test) must be in the same line as fist line of environment (in example aa=bb).

I know that I can whole put inside table or minipage but I need some simple solution.

Second problem is, that I don't know how can manage to break this environments on multiple pages.

Code: Select all

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{amsmath, amsfonts}

\begin{document}


\textbf{Test} \begin{align*}
aa &= dd \\
bb &= ee \\
cc &= ff
\end{align*}

\textbf{Test} \begin{tabular}{r @{=} l}
$aa$ & $bb$ \\
$cc$ & $dd$\\
$ee$ & $ff$ \\
\end{tabular}


\end{document}

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

Text aligned to first Line of Table or System of Equations

Post by Stefan Kottwitz »

Hi,

welcome to the board!

Very good, that you posted a complete minimal example. So I can show the solution on it - use aligned instead of align*, and both with aligned and tabular use the [t] option for aligning at the top:

Code: Select all

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{amsmath, amsfonts}

\begin{document}

\textbf{Test} $\begin{aligned}[t]
aa &= dd \\
bb &= ee \\
cc &= ff
\end{aligned}$

\textbf{Test} \begin{tabular}[t]{r @{=} l}
$aa$ & $bb$ \\
$cc$ & $dd$\\
$ee$ & $ff$ \\
\end{tabular}

\end{document}
Regarding the second problem: for page breaks in multi-line math environments you could use \allowdisplaybreaks or \displaybreak, as described here: How can I make a page break within an align environment?

Stefan
LaTeX.org admin
Post Reply