2

I want to show two equations in two columns in a document. Using multicols with the following code compiling with LuaLaTex:

\documentclass[12pt]{article}
\usepackage{multicol}
% Load of many other packages

\begin{document}

% Text

\begin{multicols}{2} [k_{t}=\alpha mc_{t}\frac{y_{t}}{r_{t}}] \break [y_{t}^{L}=(1-\alpha)mc_{t}\frac{y_{t}}{p_{t}^{L}}] \end{multicols}

% Text

\end{document}

compiles like this:

enter image description here

Note that the second equation is not in the same exact horizontal alignment as the first one, since it is slightly further below, even though there is plenty of space. What should I do in order to make them be aligned properly in the same horizontal line?

Thank you.

manifold
  • 175
  • 3
    This doesn't answer your question, but have you considered not having columns and just doing \begin{align*} k_{t}&=\alpha mc_{t}\frac{y_{t}}{r_{t}} & y_{t}^{L}&=(1-\alpha)mc_{t}\frac{y_{t}}{p_{t}^{L}}\end{align*} (with amsmath loaded) to have the two equations side by side aligned? (You could put three &s between them if you want them a little further apart.) – frabjous Jun 19 '22 at 03:04
  • I am unable to reproduce your screenshot on a fully up-to-date MaCTeX2022 system -- LuaHBTeX 1.15.0, LaTeX2e <2022-06-01> patch level 1, multicol 2021/11/30 v1.9d. Which TeX distribution do you employ, and when did you last update it? – Mico Jun 19 '22 at 04:14
  • With recent MiKTeX (LuaHBTeX, Verson 1.15.0 (MiKTeX 22.3)) I cant reproduce your problem. – Zarko Jun 19 '22 at 06:38
  • Take a look at this question-answer: https://tex.stackexchange.com/questions/298162/how-do-you-place-texts-side-by-side – S. Venkataraman Jun 19 '22 at 06:54
  • @Mico I'm using compiling it in Overleaf, with compiler LuaLatex and Tex Live version: 2020. Nevertheless, reproducing the code myself with the example I gave I'm also unable to reproduce this misalignment, probably because the entire context of the document is needed. – manifold Jun 21 '22 at 02:21
  • The previous comment was also for @Zarko – manifold Jun 21 '22 at 02:21
  • @frabjous This actually works fine for this case. Do you know if there's a way to use this method for expressing two equations in two columns with each equation being numbered? – manifold Jun 21 '22 at 02:24
  • This should be helpful regarding the vertical positioning: Spurious space above align environment at top of page/minipage – barbara beeton Oct 31 '22 at 16:02

2 Answers2

2

The OP asked in a comment,

Do you know if there's a way to [place] two equations in two columns with each equation being numbered?

There's no need for the considerable overhead that's associated with setting up a two-column page layout. Instead, just place 2 minipage environments, each of width 0.5\textwidth, next to each other, and place an equation-like environment in each minipage.

enter image description here

In the above screenshot, there's zero separation between the minipages. If you prefer a horizontal separation of, say, 0.1\textwidth, all you'd have to do is set the widths of the minipages to 0.45\textwidth and insert an \hfill directive at the end of the first minipage:

enter image description here


Here's the code that generates the first screenshot:

\documentclass[12pt]{article}
\usepackage{showframe} % draw framelines around textblock

\begin{document}

\noindent \begin{minipage}{0.5\textwidth} \begin{equation} k_{t}=\alpha mc_{t}\frac{y_{t}}{r_{t}} \end{equation} \end{minipage}% <-- the '%' symbol assures zero separation \begin{minipage}{0.5\textwidth} \begin{equation} y_{t}^{L}=(1-\alpha)mc_{t}\frac{y_{t}}{p_{t}^{L}} \end{equation} \end{minipage}

\end{document}

Mico
  • 506,678
0
\begin{multicols}{2}
  \begin{equation}
    \omega^{2} = g k \tanh{\left(kh\right)}
    \label{eq:dispersion}
  \end{equation}\vspace{-6mm}
  \begin{equation}
    \lambda = \frac{g T^{2}}{2\pi}\left(\frac{2\pi h}{\lambda}\right)
\label{eq:dispersion-lambda}
  \end{equation}
\end{multicols}
Gerard
  • 1