Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Hello i am using a line of code to draw 2 equations next to eachother using \minipage{}:

\begin{minipage}{0.5\textwidth}
\small
\begin{equation}\label{e3}
\begin{split}
\frac{\mathrm d x'}{\mathrm d t} &= \frac{\mathrm d x}{\mathrm d t} - \frac{\mathrm d}    {\mathrm d t}(ut)\\
\frac{\mathrm d x'}{\mathrm d t} &= \frac{\mathrm d x}{\mathrm d t} - u \, \frac{\mathrm d}{\mathrm d t}(t)\\
\frac{\mathrm d x'}{\mathrm d t} &= \frac{\mathrm d x}{\mathrm d t} - u \, \frac{\mathrm d t}{\mathrm d t}\\
v' &= v - u
\end{split}
\end{equation}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\small
\begin{equation}\label{e4}
\begin{split}
\frac{\mathrm d x}{\mathrm d t} &= \frac{\mathrm d x'}{\mathrm d t} + \frac{\mathrm d}{\mathrm d t}(ut)\\
\frac{\mathrm d x}{\mathrm d t} &= \frac{\mathrm d x'}{\mathrm d t} + u \, \frac{\mathrm d}{\mathrm d t}(t)\\
\frac{\mathrm d x}{\mathrm d t} &= \frac{\mathrm d x'}{\mathrm d t} + u \, \frac{\mathrm d t}{\mathrm d t}\\
v &= v' + u
\end{split}
\end{equation}
\end{minipage}

After compiling, using PDFLaTeX i get a resulting document which looks like this: too small spacing after minipage

What can i do to increase vertical spacing after minipage, which is very small? I would also like to know, how can i take care of an annoying \small comand which i have to put inside every \minipage{} for my equations to look smaller? Can it be done in preamble?

Thank you.

share|improve this question
    
I've updated my answer with a possible solution. –  Gonzalo Medina Aug 28 '12 at 0:12
add comment

3 Answers

up vote 7 down vote accepted

Below there's one possible solution; the key ideas were:

  1. I used the solution given in How to keep a constant baselineskip when using minipages (or \parboxes)? to guarantee spacing after the minipages.

  2. Before the minipages I used \smallskip\nointerlinespacing.

  3. I defined a newenvironment sminipage (to apply \small inside minipage); the optional argument (set by default to t) controls the alignment of the minipage and the mandatory argument sets the width of the minipage.

I also made some other modifications to improve your code:

  1. I removed the spurious blank space after the first \end{minipage}.

  2. I defined a \Pder command to facilitate the writing of the partial derivatives.

The idea was to obtain (approximately) the same spacing around the equations inside the minipage as the one used for regular equations not inside a minipage (I added a regular equation environment at the end just for comparison purposes):

    \documentclass{article}
    \usepackage{amsmath}
    \usepackage[nopar]{lipsum}% just to generate text for the example

    \newcommand\Pder[2]{%
      \frac{\mathrm{d}#1}{\mathrm{d}#2}}

    \newenvironment{sminipage}[2][t]
      {\minipage[t]{#2}\small}
      {\endminipage}

    \begin{document}

    \lipsum*[4]\par\smallskip\nointerlineskip
    \noindent\begin{sminipage}[t]{0.5\textwidth}
    \begin{equation}\label{e3}
    \begin{split}
    \Pder{x'}{t} &= \Pder{x}{t} - \Pder{\phantom{x}}{t} (ut) \\
    \Pder{x'}{t} &= \Pder{x}{t} - u\,\Pder{\phantom{x}}{t} (t) \\
    \Pder{x'}{t} &= \Pder{x}{t} - u\,\Pder{t}{t} \\
    v' &= v - u
    \end{split}
    \end{equation}
    \end{sminipage}%
    \begin{sminipage}{0.5\textwidth}
    \begin{equation}\label{e4}
    \begin{split}
    \Pder{x}{t} &= \Pder{x'}{t} - \Pder{\phantom{x}}{t} (ut) \\
    \Pder{x}{t} &= \Pder{x'}{t} - u\,\Pder{\phantom{x}}{t} (t) \\
    \Pder{x}{t} &= \Pder{x'}{t} - u\,\Pder{t}{t} \\
    v &= v' + u
    \end{split}
    \end{equation}\null
    \par\xdef\tpd{\the\prevdepth}
    \end{sminipage}

    \prevdepth\tpd
    \noindent\lipsum[2]
    \begin{equation}
    a=b
    \end{equation}
    \lipsum[4]

    \end{document}

![enter image description here][1]

I defined now (as was requested in a comment) a new environment eqmpage which basically is a top aligned minipage with constant width of \linewidth which automates all the preparations mentioned above:

\documentclass{article}
\usepackage{amsmath}
\usepackage[nopar]{lipsum}% just to generate text for the example

\newcommand\Pder[2]{%
  \frac{\mathrm{d}#1}{\mathrm{d}#2}}

\newenvironment{sminipage}[2][t]
  {\minipage[t]{#2}\small}
  {\endminipage}

\newenvironment{eqmpage}
  {\par\smallskip\nointerlineskip%
    \noindent\minipage[t]{\textwidth}}
  {\par\xdef\tpd{\the\prevdepth}\endminipage\par\prevdepth\tpd}

\begin{document}

\lipsum*[4]

\begin{eqmpage}
\begin{sminipage}[t]{0.5\textwidth}
\begin{equation}\label{e3}
\begin{split}
\Pder{x'}{t} &= \Pder{x}{t} - \Pder{\phantom{x}}{t} (ut) \\
\Pder{x'}{t} &= \Pder{x}{t} - u\,\Pder{\phantom{x}}{t} (t) \\
\Pder{x'}{t} &= \Pder{x}{t} - u\,\Pder{t}{t} \\
v' &= v - u
\end{split}
\end{equation}
\end{sminipage}%
\begin{sminipage}{0.5\textwidth}
\begin{equation}\label{e4}
\begin{split}
\Pder{x}{t} &= \Pder{x'}{t} - \Pder{\phantom{x}}{t} (ut) \\
\Pder{x}{t} &= \Pder{x'}{t} - u\,\Pder{\phantom{x}}{t} (t) \\
\Pder{x}{t} &= \Pder{x'}{t} - u\,\Pder{t}{t} \\
v &= v' + u
\end{split}
\end{equation}\null
\end{sminipage}
\end{eqmpage}
\noindent\lipsum[2]
\begin{equation}
a=b
\end{equation}
\lipsum[4]

\end{document}
share|improve this answer
    
But this still has to have \small written in each minipage environment every time which is part of the problem of the OP. From what I understand, OP likes to have this thing taken care of in the preamble. –  hpesoj626 Aug 27 '12 at 6:47
    
@hpesoj626 I've updated my answer. –  Gonzalo Medina Aug 27 '12 at 11:59
    
Nice. I am trying to learn how to write packages and this example helps a lot. Thanks. –  hpesoj626 Aug 28 '12 at 0:16
    
I love the idea about partial derivatives TY! –  71GA Aug 28 '12 at 17:03
    
@71GA You're welcome! I'm glad I could help. –  Gonzalo Medina Aug 28 '12 at 17:10
show 3 more comments

I have upvoted @Sigur's answer. But you might also want to look at genmpage package. It adds additional options to your minipage environment and you can also write the options in the preamble.

To set your minipage text to small, put the following into your preamble:

\usepackage{genmpage}
\setkeys{GenMP}{resetfont,fsize=small,inner=s}

Then write your minipage environment as you usually do and you can use \medskip and \bigskip as suggested by @Sigur.

share|improve this answer
    
Nice package. Thanks. –  Sigur Aug 26 '12 at 15:00
    
@Sigur: You are welcome. –  hpesoj626 Aug 26 '12 at 15:28
add comment

You can make use of the command \bigskip or \medskip.

If you will always use the same size, you can define

\def\bmp{\begin{minipage}{0.48\linewidth}\small} 
\def\emp{\end{minipage}\smallskip}

for begin and end. Note the use of 48% for the width. You can change. You just need to put some \hfill between them.

\bmp \emp
\hfill
\bmp \emp
% this paragraph is important

text here....
share|improve this answer
1  
For some reason this doesnt work. Makes absolutely no change to my document. –  71GA Aug 26 '12 at 19:57
    
@71GA: Write \bmp\begin{equation}...\end{equation}\emp instead of \begin{minipage}\begin{equation}...\end{equation}\end{minipage} –  hpesoj626 Aug 26 '12 at 23:43
    
@Sigur: Maybe editing the answer so that the modified MWE with your solution is shown will help. –  hpesoj626 Aug 27 '12 at 0:10
    
I know. The problem is that you should use 2 consecutive, to produce the 2 minipage side by side. But the \par does not allow this. I am thinking about. –  Sigur Aug 27 '12 at 11:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.