2

Issue

First, I'm sorry: I didn't manage to produce a MWE. I hope some of you will still be able to help.

I use the multicol package to create list of exercises. An exercise is an environment which is within a minipage (to prevent column breaks). Something like

\newenvironment{exo}
{\begin{minipage}{\columnwidth}}
{\end{minipage}}

Quite often, the first exercise of a new column is not aligned with the top of the column:

enter image description here

Idea 1

I have noticed that putting \setlength{\topskip}{0pt} helps a lot but still, it is not perfectly aligned.

enter image description here

Idea 2

Quite surprisingly, I change \begin{minipage}{\columnwidth} to \begin{minipage}{0.97\columnwidth} (in the current example), the issue disappears:

enter image description here

Idea 3

If I delete the newlines between two exercise environments (in the source), the problem disappears but that makes the source file less readable:

\begin{exercise}
bla bla bla
\end{exercise}
\begin{exercise}
bla bla bla
\end{exercise}

Question

So, do you have any hint?

File

The source files (not MWE at all) are there https://we.tl/Hbap24qlw2

2

The problem doesn't come from the multicol environment, it comes from the minipage environment that adds a space before.

The removal of the space located before the minipage environment is given in this response: How to reduce space before minipage

You can undo either of these vertical spaces by issuing \vspace{-\parskip} or \vspace{-\abovedisplayskip} just before the minipage.

Just delete the space before the minipage environment, which is before begin{exo}:

\vspace{-\abovedisplayskip}
\vspace{-\parskip}
\begin{exo} 
Vous voulez acheter un billet de loterie. Le buraliste,
logicien à ses heures perdues, vous en présente cinq numérotés de 1
à 5, et vous déclare :
\begin{itemize}
 \item si 5 est perdant, alors 1 est gagnant ;  
\item si 4 est perdant, alors 2 est gagnant ;    
 \item si 3 est perdant, alors 5 aussi ;    
 \item si 1 est gagnant, alors 2 aussi ;    
 \item si 3 est gagnant, alors 4 est perdant.
\end{itemize}
%\noindent 
Quel billet choisissez-vous ?

\end{exo}
  • Thanks, it worked. But I had to increase the space after exo so that two exercises don't overlap. – Colas Apr 16 '18 at 16:52
  • This code should only be placed before exo environments that require it as I did in the example (and it works very well). But if you want to integrate it in the exo environment code, you will have to add an equivalent spacing at the end of the environment. – AndréC Apr 16 '18 at 18:24
  • Yep, that’s what I did. – Colas Apr 16 '18 at 20:09
  • Just to say, the space above minipage is not always added when a new column is started. – Colas Apr 19 '18 at 21:25
  • Interesting, have you found under what conditions this space is added? – AndréC Apr 20 '18 at 5:40

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.