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.

Consider the following example and notice the different vertical spacings between the theorem caption and the text. Is there a way to get the same spacing when using minipage as in the case of normal text?

\documentclass[english]{article}
\usepackage{babel}
\usepackage{blindtext}
\usepackage{lipsum}

\usepackage{amsmath}
\usepackage[amsmath]{ntheorem}%

\makeatletter
\newtheoremstyle{mystyle}%
  {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont%
          ##1\ ##2\theorem@separator}\hbox{\strut}}}]}%}
  {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]%
    \hfill{\normalfont(##3)}\newline}
  \theorembodyfont{\normalfont}
  \theoremindent0cm
\makeatother
\theoremstyle{mystyle}

\usepackage[demo]{graphicx}

\newtheorem{test}{test}
\begin{document}
   \begin{test}
      \begin{minipage}[t]{0.6\linewidth}
         \vspace{0cm}
         %\lipsum[40]
         test
      \begin{itemize}
      \item test
      \item test
      \end{itemize}
   \end{minipage}
   \begin{minipage}[t]{0.4\linewidth}
      \vspace{0cm}
      \includegraphics[draft,height=4cm, width=5cm]{imageName}
   \end{minipage}
    \end{test}
    \begin{test}
       test
    \end{test}
\end{document}

spacing

share|improve this question

1 Answer 1

up vote 3 down vote accepted

I would not fiddle with adding \vspace{0cm} at the start of the minipage, since this screws up the vertical alignment. Rather adjust the image's alignment manually:

enter image description here

\begin{document}
   \begin{test}
      \begin{minipage}[t]{0.6\linewidth}
         test
      \begin{itemize}
      \item test
      \item test
      \end{itemize}
   \end{minipage}%
   \begin{minipage}[t]{0.4\linewidth}
      \null\hfill\\[-\dimexpr\baselineskip+2em\relax]
      \includegraphics[draft,height=4cm, width=5cm]{imageName}
   \end{minipage}
    \end{test}
    \begin{test}
       test
    \end{test}
\end{document}

I've pushed it up by roughly the same amount as seemed to be the case in your MWE. Adjust as necessary.

share|improve this answer

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.