Math & Science\multicols environment & how to decrease horitzonal space between cols

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
WyoTeacher
Posts: 3
Joined: Wed Apr 22, 2020 6:55 am

\multicols environment & how to decrease horitzonal space between cols

Post by WyoTeacher »

The MWE code below executes perfectly to generate a very simple multiple choice maths quiz. But I need to reduce by 50% the horizontal space between the 2 cols so the quiz image can be viewed on student's cell phone screen.

Have tried pasting the "\setlength" string below at different places in the preamble and after[/code]\begin{document}]

Nothing works.

If possible, please explain why

Code: Select all

\setlength\columnsep{10pt}
not working.

Also (and this is being really OCD), is it possible to correct the horizontal alignment between the 2 cols? I suspect the use of both fractions and non-fraction answer choices in the same line is messing up the alignment.

screenshot of horizontal misalignment = [https//imgur.com/hSk6fGw]

Your help is sincerely appreciated, mates!

MWE

Code: Select all

\documentclass[addpoints]{exam}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{multicol}

\newlist{options}{enumerate}{1}
\setlist[options]{label*=(\Alph*)}
\newcommand{\option}{\item}

\SetEnumitemKey{twocol}{
  before=\raggedcolumns\begin{multicols}{2},
  after=\end{multicols}}

\begin{document}

 %This code creates the text before the first question
%-------------------------------------------------------------------
\begin{center}
 \fbox{\fbox{\parbox{5.5in}{\centering
    Pre-Algebra Covid: Week 4 Item 2}}}
\end{center}

\vspace{5mm}

%Here, the questions begin
\begin{questions}

 % Q 1
 \question $\displaystyle\frac{4x^4y^3}{2x^3}$
 \bigskip

 \begin{options}[twocol]
  \option $2xy^3$\\
  \option $\displaystyle\frac{4x^2y^3}{2}$\\
  \option $\displaystyle\frac{24x^7}{y^2}$\\
  \option $\displaystyle\frac{4x}{9y^2}$\\
 \end{options}

\end{questions}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

WyoTeacher
Posts: 3
Joined: Wed Apr 22, 2020 6:55 am

\multicols environment & how to decrease horitzonal space between cols

Post by WyoTeacher »

Never before occurred to me to use negative units to adjust the column separation. That's what going too long without the EPL will do to a bloke's mind.

Inserting this line of code (see below) did the trick!

Code: Select all

\setlength{\columnsep}{-10cm}
The relevant 2 lines of code are:
\usepackage{multicol}
\setlength{\columnsep}{-10cm} Hope this helps some other Covid-closed school teacher! :)

h/t ghostanime2001 @ latex.org/forum/viewtopic.php?t=15664
Post Reply