Graphics, Figures & Tables ⇒ Aligning mathematical equations vertically in a table - Overleaf
Aligning mathematical equations vertically in a table - Overleaf
I would like to align equations - which are separately inserted into table cells - vertically along the red line - as shown in the figure below:
The above is a small excerpt of a large table with multiple rows and columns (text columns to the left and right of the image too) - I have tried a multitude of methods, but have not been successful. I am using Overleaf.
Has anybody had success in implementing this? If so, I would really appreciate the assistance of the community by means of a small minimal working code example?
Thanks a lot
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
Aligning mathematical equations vertically in a table - Overleaf

Aligning mathematical equations vertically in a table - Overleaf
Code: Select all
\documentclass[a4paper, 11pt, oneside]{scrbook}
\usepackage{adjustbox}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{makecell}
% ------------------- Begin the document -----------------------------
\begin{document}
\begin{table}[h!]
\centering
\begin{adjustbox}{center}
\begin{tabular}{c c c c c}
x &$b_{2}$ &20.25 &\multirow{4}{5cm}{\parbox{\begin{align*}
0.91 \leq &\Delta x \leq 3.30 \\
1.50 \leq &\Delta x \leq 1.83 \\
&\Delta x \leq 0.34 \\
2.17 \leq &\Delta x \leq 2.17
\end{align*}
}} & 12 \\
x &$r_{n}$ &55 & & 10 \\
x &$\Delta r_{n}$ &0 & & 4 \\
x &$r_{1}$ &105.45 & & 8
\end{tabular}
\end{adjustbox}
\end{table}%
\end{document}
Aligning mathematical equations vertically in a table - Overleaf
\parbox
command expects a length.My proposition:
Code: Select all
\documentclass[
% a4paper, fontsize=11pt,% default setting
oneside
]{scrbook}
\usepackage{amsmath}
\usepackage{siunitx}% provides S column type
% Read the manual of the array package to find out,
% how you can use >{} and <{} to set declarations.
% siunitx loads array.
\newcolumntype{C}{>{$}c<{$}}
\begin{document}
\begin{table}[htbp]
\centering
\begin{tabular}{
*2C
S[table-format=3.2]
C@{\;$\Delta x\leq$\;}
C
S[table-format=2]
}
x & b_2 & 20.25 & 0.91 \leq & 3.30 & 12 \\
x & r_n & 55 & 1.50 \leq & 1.83 & 10 \\
x & \Delta r_n & 0 & & 0.34 & 4 \\
x & r_1 & 105.45 & 2.17 \leq & 2.17 & 8
\end{tabular}
\end{table}
\end{document}
Aligning mathematical equations vertically in a table - Overleaf
Aligning mathematical equations vertically in a table - Overleaf
Code: Select all
\documentclass[
% a4paper, fontsize=11pt,% default setting
oneside
]{scrbook}
\usepackage{amsmath}
\usepackage{siunitx}% provides S column type
% Read the manual of the array package to find out,
% how you can use >{} and <{} to set declarations.
% siunitx loads array.
\newcolumntype{C}{>{$}c<{$}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% Bartman's method, changed a bit - below %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{table}[htbp]
\centering
\begin{tabular}{
c
c %*2C
c %S[table-format=3.5]
C@{\;$\Delta x\leq$\;}
c %C
c %S[table-format=3]
}
x & $b_2$ & 20.25 & 0.91 \leq & 3.30 & 12 \\
x & $r_n$ & 55 & 1.50 \leq & 1.83 & 10 \\
x & $\Delta r_n$ & 0 & & 0.34 & 4 \\
x & $r_1$ & 105.45 & 2.17 \leq & 2.17 & 8
\end{tabular}
\end{table}
\end{document}
Code: Select all
\documentclass[
% a4paper, fontsize=11pt,% default setting
oneside
]{scrbook}
\usepackage{amsmath}
\usepackage{siunitx}% provides S column type
% Read the manual of the array package to find out,
% how you can use >{} and <{} to set declarations.
% siunitx loads array.
\newcolumntype{R}{>{\raggedright\arraybackslash}r@{\hspace{3pt}}} %New column type, change right spacing and left align
\newcolumntype{L}{>{\raggedleft\arraybackslash}l} %New column type, right align, no change in left spacing
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%% My method - below %%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{table}[htbp]
\centering
\begin{tabular}{
c
c %*2C
c %S[table-format=3.5]
R %C@{\;$\Delta x\leq$\;}
L %c %C
c %S[table-format=3]
}
x & $b_2$ & 20.25 & $0.91 \leq$ & $\Delta x\leq 3.30$ & 12 \\
x & $r_n$ & 55 & $1.50 \leq$ & $\Delta x\leq 1.83$ & 10 \\
x & $\Delta r_n$ & 0 & & $\Delta x\leq 0.34$ & 4 \\
x & $r_1$ & 105.45 & $2.17 \leq$ & $\Delta x\leq 2.17$ & 8
\end{tabular}
\end{table}
\end{document}
Aligning mathematical equations vertically in a table - Overleaf
document
environment is missing.