1

I want the two equations to be treated separately i.e I want to follow-up the steps to formulate each equation till bottom of the page, on each minipage as defined. I tried using different math modes \(...\), \[...\], \begin{align*}...\begin{align*} etc. but I get the equations (along with text) displayed at the center, right below each other.

How can I fix this?

\usepackage{multicol}
\setlength{\columnsep}{1cm}

\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]} \let\endchangemargin=\endlist

\begin{document}

\begin{changemargin}{1in}{1in}

\noindent \begin{minipage}{0.45\textwidth}

Equation 1 \begin{align} x+y=z \end{align}

\end{minipage}

\hfill

\begin{minipage}{0.45\textwidth}

Equation 2 \begin{align} a+b=c \end{align}

\end{minipage}

\end{changemargin}

References

  1. How can I change the margins for only part of the text?
kedarb
  • 63

1 Answers1

2

You need to (a) delete the blank lines before and after \hfill and (b) change the instances of \textwidth to \linewidth. Why? Because \textwidth is not affected by the switch into a list-like environment, whereas \linewidth is.

The framelines in the following screenshot are inserted by the showframe package. The filler text before and after the minipage environments is generated by \lipsum directives.

enter image description here

\documentclass{article}
\usepackage{amsmath,showframe,lipsum}
%\setlength{\columnsep}{1cm}

\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]} \let\endchangemargin=\endlist

\begin{document} \lipsum[1][1-5]

\begin{changemargin}{1in}{1in}

\noindent \begin{minipage}{0.45\linewidth} Equation 1 [ x+y=z ] \end{minipage} \hfill \begin{minipage}{0.45\linewidth} Equation 2 [ a+b=c ] \end{minipage}

\end{changemargin}

\lipsum[1][1-5] \end{document}

Mico
  • 506,678
  • 1
    I was exactly looking for this line-to-line matching in minipage. Got to practically learn something new today about \textwidth versus linewidth which in simple words keeps a track every step performed in math mode. Thank you. – kedarb May 11 '21 at 21:06