TransWikia.com

write equations into a 2 column table with left column showing the left side of the equation and right column showing the right side of the equation

TeX - LaTeX Asked by user3406764 on October 21, 2020

I am writing a 2 column paper and I would like to organize my formulas into a table with 2 columns with the cells of the left column containing the left side of the equation and the cells in the right column containing the right side of the equation.

I would like to achieve this with the right side of each equation inside each of the cells of the right columns.

enter image description here

Here is what my equations currently look like:

enter image description here

Here is the source code I am using:

    documentclass[sigconf]{acmart}

usepackage{booktabs} % For formal tables
usepackage{algorithmic}
usepackage{fixltx2e}
usepackage{algorithm}
usepackage{enumitem}
usepackage{multirow}
usepackage{hhline}
usepackage{amsmath}
usepackage{lmodern}
usepackage[T1]{fontenc}

newcommandvn[1]{mathit{#1}} % or: mathrm{#1}
newcommandOr{mathrel{bigVert}}

setcopyright{acmcopyright}


% DOI
acmDOI{xx.xxx/xxx_x}

% ISBN
acmISBN{978-1-4503-8104-8/21/03}

%Conference
acmConference[SAC'21]{ACM SAC Conference}{March 22-March 26, 2021}{Gwangju, South Korea}
acmYear{2021}
copyrightyear{2021}

%thispagestyle{plain} 

acmArticle{4}
acmPrice{15.00}


pagestyle{plain}
settopmatter{printfolios=true}
begin{document}

title{test}

author{Anonymous Author(s)}





begin{abstract}
abstract

end{abstract}




maketitle




begin{gather*}
vn{NoCallersU} + vn{NoCalleesU}
=vn{Callers}^{vn{N}} 
  And vn{Callees}^{vn{N}} [1ex]
begin{aligned}
vn{Low}&vn{Combination} 
&=bigl(vn{Callers}^{vn{L}} And bigl(vn{Callees}^{vn{L}} 
  Or vn{Callees}^{vn{N}})bigr)bigr) 
&quad Orbigl( vn{Callers}^{vn{N}} And vn{Callees}^{vn{L}} bigr) [1ex]
vn{Medium}&vn{Combination}
&=bigl(vn{Callers}^{vn{M}}Andbigl(vn{Callees}^{vn{M}}  
&quad Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}bigr) bigr) 
&quad Or bigl(( vn{Callers}^{vn{N}} Or bigl(vn{Callers}^{vn{L}} ) 
 And vn{Callees}^{vn{M}}bigr)bigr)[1ex]
vn{High}&vn{Combination}
&=bigl(vn{Callers}^{vn{H}}Andbigl(vn{Callees}^{vn{H}} Orvn{Callees}^{vn{M}}  
&quad Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}bigr) bigr) 
&quadOr bigl(vn{Callers}^{vn{H}}Andbigl(vn{Callees}^{vn{M}}  
&quad Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}) bigr)bigr)
end{aligned}
end{gather*}





end{document}

One Answer

Like this?

enter image description here

For this you not need a table, Just use align* math environment defined in the amsmathpackage:

documentclass[sigconf]{acmart}
%usepackage{booktabs, hhline, multirow} % For formal tables
%usepackage{algorithmic}
%usepackage{fixltx2e}
%usepackage{algorithm}
%usepackage{enumitem}
usepackage{amsmath}
usepackage{lmodern}
usepackage[T1]{fontenc}

newcommandvn[1]{mathit{#1}} % or: mathrm{#1}
newcommandOr{mathrel{bigVert}}

begin{document}

begin{align*}
vn{NoCallersU} + vn{NoCalleesU}
    & = vn{Callers}^{vn{N}} And vn{Callees}^{vn{N}} [1ex]
%
vn{Low}vn{Combination} 
    & = bigl(vn{Callers}^{vn{L}} And bigl(vn{Callees}^{vn{L}}
        Or vn{Callees}^{vn{N}})bigr)bigr) 
    &quad Orbigl( vn{Callers}^{vn{N}} And vn{Callees}^{vn{L}} bigr) [1ex]
%
vn{Medium}vn{Combination}
    & = bigl(vn{Callers}^{vn{M}}Andbigl(vn{Callees}^{vn{M}} 
    &quad Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}bigr) bigr) 
    &quad Or bigl(( vn{Callers}^{vn{N}} Or bigl(vn{Callers}^{vn{L}} ) And vn{Callees}^{vn{M}}bigr)bigr)[1ex]
%
vn{High}vn{Combination}
    & = bigl(vn{Callers}^{vn{H}}Andbigl(vn{Callees}^{vn{H}} Orvn{Callees}^{vn{M}} 
    &quad Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}bigr) bigr) 
    &quadOr bigl(vn{Callers}^{vn{H}}Andbigl(vn{Callees}^{vn{M}} 
    &quad Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}) bigr)bigr)
end{align*}

end{document}

Edit (1): In two column document you equation in form as is, is to wide that can be fit in one column, You need to reorganize it for example as follows:

[
begin{aligned}
vn{NoCallersU} + vn{NoCalleesU}
    & = vn{Callers}^{vn{N}} And vn{Callees}^{vn{N}} [1ex]
%
vn{Low}vn{Combination} 
    & = bigl(vn{Callers}^{vn{L}} And bigl(vn{Callees}^{vn{L}}
    &quad Or vn{Callees}^{vn{N}})bigr)bigr) 
    &quad Orbigl( vn{Callers}^{vn{N}} And vn{Callees}^{vn{L}} bigr) [1ex]
%
vn{Medium}vn{Combination}
    & = bigl(vn{Callers}^{vn{M}}Andbigl(vn{Callees}^{vn{M}} 
    &quad Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}bigr) bigr) 
    &quad Or bigl(( vn{Callers}^{vn{N}} Or bigl(vn{Callers}^{vn{L}} ) 
    &quadAnd vn{Callees}^{vn{M}}bigr)bigr)[1ex]
%
vn{High}vn{Combination}
    & = bigl(vn{Callers}^{vn{H}}Andbigl(vn{Callees}^{vn{H}} 
    &quad Orvn{Callees}^{vn{M}} 
    &quad Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}bigr) bigr) 
    &quadOr bigl(vn{Callers}^{vn{H}}Andbigl(vn{Callees}^{vn{M}} 
    &quad Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}) bigr)bigr)
end{aligned}
]

enter image description here

Edit (2): After your editing of question, the desired presentation of your equation can be as:

enter image description here

[
begin{array}{|l|l|}
hline
text{combination}
    &  text{definition}    
hline
vn{NoCallersU} + vn{NoCalleesU}
    & vn{Callers}^{vn{N}} And vn{Callees}^{vn{N}} [1ex]
hline
vn{Low}vn{Combination} 
    & bigl(vn{Callers}^{vn{L}} And bigl(vn{Callees}^{vn{L}}
    & Or vn{Callees}^{vn{N}})bigr)bigr) 
    & Orbigl( vn{Callers}^{vn{N}} And vn{Callees}^{vn{L}} bigr) [1ex]
hline
vn{Medium}vn{Combination}
    & bigl(vn{Callers}^{vn{M}}Andbigl(vn{Callees}^{vn{M}} 
    & Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}bigr) bigr) 
    & Or bigl(( vn{Callers}^{vn{N}} Or bigl(vn{Callers}^{vn{L}} ) 
    &quadAnd vn{Callees}^{vn{M}}bigr)bigr)[1ex]
hline
vn{High}vn{Combination}
    & bigl(vn{Callers}^{vn{H}}Andbigl(vn{Callees}^{vn{H}} 
    & Orvn{Callees}^{vn{M}} 
    & Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}bigr) bigr) 
    & Or bigl(vn{Callers}^{vn{H}}Andbigl(vn{Callees}^{vn{M}} 
    & Or vn{Callees}^{vn{L}}  Or vn{Callees}^{vn{N}}) bigr)bigr) 
hline
end{array}
]

Note, your MWE still produce one column document (not two column as you mentioned in comment). Please, clarify this par of your question too.

Answered by Zarko on October 21, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP