0

I followed the code from Numbering side-by-side equations or inline equations, got:

enter image description here

However, I desire for:

enter image description here Meaning, the tabular is aligned to the left (or center), and numbering is before the equation, without a lot of space between the number and the equation.

How can I achieve this result? My code:

\documentclass{article}

\usepackage{amsmath}


\begin{document}
\section{Stackexchange Question}
The equations are:

\begin{tabular}{p{7cm}p{7cm}}
{\begin{align}
&\bar{U_i} = \frac{1}{m}\sum_{j=1}^m U_{ij} \\
&\tilde{{U_{i}}} = \bar{{U_{i}}} + z_{\alpha \slash 2} \cdot \sigma_{U_{i}} 
\end{align}}
&
{\begin{align}
&\sigma_{foo}^2 = \sigma_{U_{i}}^2 = \frac{1}{m-1}\sum_{j=1}^m(U_{m}-\bar{U_{i}})^2 \\ 
&\tilde{y_i} = \frac{1}{m}\sum_{j=1}^m v_{ij} \cdot U_{ij} + (1-v_{ij})\cdot L_{ij} 
\end{align}}
\end{tabular}


\end{document}

Any help would be appreciated. Thanks!

9
  • My humble opinion: why do you use a table? With the enumitem package you can create a columned numbered equations where there are no spaces.
    – Sebastiano
    Sep 26, 2020 at 15:40
  • 1
    Thanks for your answer. I'm actually not familiar with enumitem, and found the above as quick solution Sep 26, 2020 at 15:45
  • Do you want a right-hand numbering for all equations in your document, or just for this group?
    – Bernard
    Sep 26, 2020 at 15:53
  • @EliSimhayev Excuse me, my was only a suggestion. All the best.
    – Sebastiano
    Sep 26, 2020 at 15:54
  • 1
    @Sebastiano: That's precisely what I was thinking of – the shortlst is still another possibility, but it's not in the official distributions for copyright reasons, and still another, Olga Lapko's tablists.
    – Bernard
    Sep 26, 2020 at 16:49

3 Answers 3

3

I have used tasks package using manual enumeration to have the same enumerate list of your image. Now it is perfect. :-)

\documentclass[12pt]{article}  
\usepackage[margin=2.5cm]{geometry}
\usepackage{tasks,amsmath,amssymb} 
\begin{document}
\section{Stackexchange Question}
The equations are:
\begin{tasks}[counter-format=(tsk[1]),label-width=4.5em, column-sep =4.4pt](2)
\task $\displaystyle \tilde{{U_{i}}} = \bar{{U_{i}}} + z_{\alpha \slash 2} \cdot \sigma_{U_{i}}$ 
\task[(3)] $\displaystyle \sigma_{\text{foo}}^2 = \sigma_{U_{i}}^2 = \frac{1}{m-1}\sum_{j=1}^m(U_{m}-\bar{U_{i}})^2$
\task[(2)] $\displaystyle \bar{U_i} = \frac{1}{m}\sum_{j=1}^m U_{ij}$
\task[(4)] $\displaystyle \tilde{y_i} = \frac{1}{m}\sum_{j=1}^m v_{ij} \cdot U_{ij} + (1-v_{ij})\cdot L_{ij}$
\end{tasks}

\end{document}

enter image description here

2

A code with tabularx and align, using the \leqnomode command, defined in Werner's answer to this question. It uses the equation counter. The vertical spacing between the first & second line of align in the left column had to be found by trial and error:

\documentclass{article}
\usepackage{geometry}
\usepackage{amsmath}
\makeatletter
\newcommand{\leqnomode}{\tagsleft@true}%
\makeatother
\usepackage{tabularx}

\usepackage{tasks}

\begin{document}

\section{Stackexchange Question}
The equations are:

{\noindent\setlength{\tabcolsep}{0pt}\begin{tabularx}{\textwidth}{*2{>{\leqnomode\arraybackslash}X}}
{\begin{align}
& \bar{U_i} = \frac{1}{m}\sum_{j=1}^m U_{ij} \\[1.6ex]
& \tilde{{U_{i}}} = \bar{{U_{i}}} + z_{\alpha \slash 2} \cdot \sigma_{U_{i}}
\end{align}}
&
{\begin{align}
& \sigma_{foo}^2 = \sigma_{U_{i}}^2 = \frac{1}{m-1}\sum_{j=1}^m(U_{m}-\bar{U_{i}})^2 \\
& \tilde{y_i} = \frac{1}{m}\sum_{j=1}^m v_{ij} \cdot U_{ij} + (1-v_{ij}) \cdot L_{ij}
\end{align}}
\end{tabularx}}

\end{document}

enter image description here

1

enter image description here

\documentclass{article}
\usepackage{multicol}
\setlength{\columnsep}{-10mm}
%\setlength{\columnseprule}{1pt}
\usepackage{enumitem}
\usepackage{amsmath}

\begin{document}
\section{Stackexchange Question}
The equations are:
\begin{multicols}{2}
\begin{enumerate}[label={(\arabic*)}]
\item $\bar{U_i} = \frac{1}{m}\sum_{j=1}^m U_{ij}$
\item $\tilde{{U_{i}}} = \bar{{U_{i}}} + z_{\alpha \slash 2} \cdot 
 \sigma_{U_{i}} $ 
\columnbreak
\item $\sigma_{foo}^2 = \sigma_{U_{i}}^2 = \frac{1}{m-1}\sum_{j=1}^m(U_{m}- 
\bar{U_{i}})^2$
\item $\tilde{y_i} = \frac{1}{m}\sum_{j=1}^m v_{ij} \cdot U_{ij} + (1- 
v_{ij})\cdot L_{ij}$

\end{enumerate}
\end{multicols}

\end{document}
2
  • 1
    In the enumerate list there are the rounded brackets in the image of the user.
    – Sebastiano
    Sep 26, 2020 at 16:08
  • Very good :-) +1
    – Sebastiano
    Sep 26, 2020 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.