3

I'm using the Springer svjour3 template and trying to put two figures in the same level with:

\begin{minipage}{\linewidth}    % outer minipage
\begin{figure}
\centering
\begin{minipage}{.45\linewidth}
\centering
\includegraphics[width=\linewidth,trim={3.5cm 7cm 3cm 6.6cm},clip]{histk1000.eps}
\caption{My caption}
\end{minipage}
\end{figure}

\begin{figure}
\centering
\begin{minipage}{.45\linewidth}
\centering
\includegraphics[width=\linewidth,trim={3.5cm 7cm 3cm 6.6cm},clip]{histk1000.eps}
\caption{My caption}
\end{minipage}
\end{figure}

\end{minipage}  % ending outer minipage

and it doesn't show figures. They appear if I remove the outer minipage. Any idea?

This is a (min) complete script:

%
\RequirePackage{fix-cm}
%
%\documentclass{svjour3}                     % onecolumn (standard format)
%\documentclass[smallcondensed]{svjour3}     % onecolumn (ditto)
\documentclass[smallextended]{svjour3}       % onecolumn (second format)
%\documentclass[twocolumn]{svjour3}          % twocolumn
%
\smartqed  % flush right qed marks, e.g. at end of proof
%
\usepackage{graphicx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage{pgf}
\usepackage{xxcolor}
\usepackage[colorlinks=true, linkcolor=blue, urlcolor=blue, citecolor   = green]{hyperref}%pdftex,
\usepackage{hyperref}
\usepackage{epstopdf}
%\usepackage{amsmath,amssymb,amsbsy, amsthm}
\usepackage{xcolor}
\usepackage{fancyhdr, blindtext}
\usepackage{tabularx, caption}
%\usepackage{geometry}
\usepackage{multirow}
\usepackage{t1enc}
\usepackage{multicol}
\usepackage[ msc-links]{amsrefs}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usepackage{float}
\usepackage{amsrefs}
\usepackage{python}
\usetikzlibrary{shapes,arrows}
%
\begin{document}

\title{Efficient generator 
}

\author{Titus Caius
}


\date{Received: date / Accepted: date}
% The correct dates will be entered by the editor


\maketitle

\begin{abstract}
This work introduces ...
\end{abstract}

...


\begin{multicols}{2}

 \begin{minipage}{\linewidth}
\centering
  \includegraphics[width=.9\linewidth,trim={3.5cm 7cm 3cm 6.6cm},clip]{histk1000.eps}
\caption{My caption}
\end{minipage}

\begin{minipage}{\linewidth}
\centering
  \includegraphics[width=.9\linewidth,trim={3.5cm 7cm 3cm 6.6cm},clip]{histk1000.eps}
\caption{My caption}
\end{minipage}

\end{multicols}


\begin{minipage}{\linewidth}    % outer minipage

\begin{figure}
\centering
\begin{minipage}{\linewidth}
\centering
  \includegraphics[width=.9\linewidth,trim={3.5cm 7cm 3cm 6.6cm},clip]{histk1000.eps}
\caption{My caption}
\end{minipage}
\end{figure}

\begin{figure}
\centering
\begin{minipage}{\linewidth}
\centering
  \includegraphics[width=.9\linewidth,trim={3.5cm 7cm 3cm 6.6cm},clip]{histk1000.eps}
\caption{My caption}
\end{minipage}
\end{figure}

\end{minipage}  % ending outer minipage

  \begin{minipage}{\linewidth}
      \centering
      \begin{minipage}{0.45\linewidth}
    \begin{figure*}
              \includegraphics[width=\linewidth,trim={3.5cm 7cm 3cm 6.6cm},clip]{example.eps}
              \caption{Histogram of 1000000 numbers for $k=1000$; $n=100$}
                            \label{hist1}       % Give a unique label
\end{figure*}
      \end{minipage}
      \hspace{0.05\linewidth}
      \begin{minipage}{0.45\linewidth}
          \begin{figure*}[H]
              \includegraphics[width=\linewidth,trim={3.5cm 7cm 3cm 6.6cm},clip]{histk997.eps}
              \caption{Histogram of 1000000 numbers for $k=997$; $n=100$}
                            \label{hist2}
          \end{figure*}
      \end{minipage}
  \end{minipage}



      \begin{minipage}{\linewidth}
      \centering
      \begin{minipage}{0.45\linewidth}
          \begin{figure*}[H]
              \includegraphics[width=\linewidth,trim={3.5cm 7cm 3cm 6.6cm},clip]{plot100.pdf}
              \caption{Plot of pairs $(x_j,x_{j+1})$ for $k=100$; 1000 generated numbers}
                            \label{fig:1}
          \end{figure*}
      \end{minipage}
      \hspace{0.05\linewidth}
      \begin{minipage}{0.45\linewidth}
          \begin{figure*}[H]
              \includegraphics[width=\linewidth,trim={3.5cm 7cm 3cm 6.6cm},clip]{plot109.pdf}
              \caption{Plot of pairs $(x_j,x_{j+1})$ for $k=109$; 1000 generated numbers}
                            \label{fig:2}
          \end{figure*}
      \end{minipage}
  \end{minipage}


\end{document}

I just want two show side by side like in the multicols environment. It works for multicols (no caption), but not with minipage.

6
  • 1
    Welcome to TeX.SE. You're trying to take the floating environment as a prisoner inside a minipage. I suspect some messages like floats lost etc. there
    – user31729
    Commented Jun 7, 2017 at 9:21
  • 1
    Don't understand what you want. Maybe just two minipages side by side in one figure instead of two figures inside one minipage. Maybe even using package subcaption would be a suggestion. If not, you should add a minimal but working example (MWE) starting with \documentclass and ending with \end{document} and describe what you exactly except. Commented Jun 7, 2017 at 10:00
  • 1
    Related: How to use figure inside a minipage? Commented Jun 7, 2017 at 10:02
  • Off-Topic: You should not use \usepackage{t1enc} but \usepackage[T1]{fontenc}. You should load hyperref as late as possible. You should not load packages more than once with different options. For a MWE you should reduce your preamble. And for a real MWE you should replace the image files, e.g., by example-image from package mwe, because we do not have your images and so the example is not a working one. See the link in my first comment. Commented Jun 7, 2017 at 14:16
  • Your code is not minimal. Also you load many packages twice and do load hyperref last. Commented Jun 7, 2017 at 16:33

1 Answer 1

1

I solved like this:

\documentclass{article}

\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{xcolor}
\usepackage{tabularx, caption}
\usepackage{multirow}
\usepackage{t1enc}
\usepackage{multicol}
\usepackage[ msc-links]{amsrefs}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usepackage{float}
\usepackage{amsrefs}
\usepackage{python}

\begin{document}

 \begin{minipage}{\linewidth}
  \centering
  \begin{minipage}{0.45\linewidth}
      \begin{figure}[H]
          \includegraphics[width=\linewidth]{example-image}
          \caption{This is the first figure}
      \end{figure}
  \end{minipage}
  \hspace{0.05\linewidth}
  \begin{minipage}{0.45\linewidth}
      \begin{figure}[H]
          \includegraphics[width=\linewidth]{example-image}
          \caption{This is the second figure}
      \end{figure}
  \end{minipage}
  \end{minipage}

\end{document}
1
  • It looks like you have two accounts. You should ask the moderators to merge them. The fundamental approach above is wrong: minipages don't float and should not contain floats. Commented Jun 7, 2017 at 16:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .