0

I enjoy writing my math notes/lectures like so:

\documentclass[twocolumn, 10px]{article}

Before I discovered the code above I was using the package paracol to split the page whenever I want, but my professor recently started writing equations next to tabular environments. My question is there an easy way to write equations side-by-side either to the left or right of a tabular environment when already in a two-column format. For example If I wanted equations in that blue circle but still remaining in the left column:

enter image description here

Though I doubt you guys need the code for such a simple tabular I provided it just in case :)

\begin{tabular}{c|c}
 $x$ & $f(x)$ \\
   \hline
 $0$ & $1-p$ \\
 $1$ & $p$
 \end{tabular}

Edit: Further testing I realized If I add the code to the end tabular line it does produce an equation to the right and centered relative to the tabular

\begin{tabular}{c|c}
 $x$ & $f(x)$ \\
   \hline
 $0$ & $1-p$ \\
 $1$ & $p$
 \end{tabular} $f(x)=p^x(1-p)^{1-x}\enspace x=0,1$

enter image description here

But I Suppose this would work only If I needed one equation, But if I needed a couple or maybe a cases environment I am not sure this method would work.

4
  • 1
    multicol package? – Money Sets You Free Oct 22 '20 at 23:53
  • Ill try messing around with it! – Mobius.Drip Oct 23 '20 at 0:14
  • 1
    @NotAZoomedImage: Combining the multicol package with a twocolumn documentclass, results in the following warning: "Package multicol Warning: May not work with the twocolumn option" – leandriis Oct 23 '20 at 5:50
  • @leandriis: A very good info. Thank you! – Money Sets You Free Oct 23 '20 at 6:52
1

Just a suggestion: You can lose the equation number using align*.

\documentclass[twocolumn, 10pt]{article}% 10px is not supported, and would be incredibly tiny
\usepackage{amsmath}
\begin{document}
\begin{align}
  \begin{array}{c|c}
     x & f(x) \\
     \hline
     0 & 1-p \\
     1 & p
  \end{array} && % every second & separates an equation
  f(x)=p^x(1-p)^{1-x}\quad x=0,1
\end{align}
\end{document}

demo

1

Here is an alternative suggestion using two minipages:

enter image description here

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{lipsum} % just for dummy text. Do not use in actual document.
\begin{document}
\lipsum[1]
\begin{minipage}{0.25\linewidth}
  \[\begin{array}{c|c}
     x & f(x) \\
     \hline
     0 & 1-p \\
     1 & p
  \end{array}\]
\end{minipage}%
\begin{minipage}{0.75\linewidth}
  \[f(x)=p^x(1-p)^{1-x}\quad x=0,1\]
\end{minipage}

\lipsum
\end{document}

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.