1

I'm trying to do something I'm not sure I can. So, let me explain. I have an enumerate environment. Inside of it, there are 5 images within an array and then a table.

To the right of that table I want to write text until the table's end is reached, and continue at the next line, but what I get is that: enter image description here


EDIT 1

Werner asked if I can post my attempt to use wraptable, so here it is:

\begin{wraptable}{r}{5.5cm}
\begin{tabular}{|l|l|l|}
\hline
\multicolumn{3}{|c|}{\textbf{Coeficiente de Curtosis}} \\ \hline
 & \textbf{sexo=0} & \textbf{sexo=1} \\ \hline
\textbf{Peso} & 4,37531 & 1,21824 \\ \hline
\textbf{Altura} & -0,97849 & 0,946925 \\ \hline
\textbf{Zapato} & -0,28973 & -0,620593 \\ \hline
\textbf{Dinero} & 6,88646 & 2,99526 \\ \hline
\textbf{Tiempo} & -0,497143 & 0,106985 \\ \hline
\end{tabular}
\end{wraptable}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

EDIT 2: all the files for te example asked by Bernard - LaTeX files


And I want that but when the right side is full of text. I tried with \begin{wraptable} but It doesn't work. Could you help me?

Thank you in advance! Cheers!

  • Can you show us your attempt with wraptable? – Werner Sep 18 '15 at 22:24
  • 1
    @Werner: In the neighbourhood of (or within) an enumerate environment, there will be problems. – Bernard Sep 18 '15 at 22:28
  • ,@adolphenom Does Including wraptable in itemize list help? – AboAmmar Sep 18 '15 at 22:38
  • @Werner I editted the first post to put into it :) – user66636 Sep 19 '15 at 8:15
  • @Bernard It's possible, but I don't know :( – user66636 Sep 19 '15 at 8:18
1

Here is a solution, based on the plain tex set of macros insbox. I defined \InsertListR command, based on the original \InsertBoxR command. It takes $2$ arguments: the number of lines untouched before insertion of a box, and the inserted contents. An optional argument can be used in case the number of required shorter lines is not well calculated: the number of supplementary shorter lines. You cannot have a caption with this code.

I took the opportunity to simplify the rest of the code and improve your table, loading the siunitx package for the vertical alignment of the numbers in the cells, and cellspace, to have some vertical padding of the rows.

\documentclass[10pt,a4paper,final]{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{mathtools,stackengine,amsfonts,amssymb,graphicx,wrapfig}
\usepackage{siunitx}
\sisetup{output-decimal-marker={,}}
\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}
\addparagraphcolumntypes{S}
% # START ## Márgenes #
\usepackage{geometry}
\geometry{
    a4paper,
    height=24cm, % height of the text block
    width=17cm, % width of the text block
    top=3cm, % distance of the text block from the top of the page
    headheight=1.7cm, % height for the header block
    headsep=1.5cm, % distance from the header block to the text block1
    footskip=1cm,
}
% # END ## Márgenes #
% # START # Paquete para añadir imágenes
% Centrar imagen
%\begin{figure}[h]
%\includegraphics[scale=0.5]{logo-uc3m2}
%\centering
%\end{figure}
% # END # Paquete para añadir imágenes
% # START ## Fuente #
\usepackage{mathpazo,euler}
\linespread{1.00}
% # END ## Fuente #
% # START ## Quitar sangría inicial #
% Poner \indent para indentar.
% Poner \noindent para quitar indentación.
\newlength\tindent
\setlength{\tindent}{\parindent}
\setlength{\parindent}{0pt}
\renewcommand{\indent}{\hspace*{\tindent}}
% # END ## Quitar sangría inicial #

        \input{insbox}
        \makeatletter
        \@InsertBoxMargin = 12pt
        \makeatother
        \geometry{showframe, nomarginpar}
        \usepackage{etoolbox}

        \newcommand*{\wrapitem}{\pretocmd{\labelenumi}{\hskip\leftmargin}{}{}\item\apptocmd{\labelenumi}{\hskip-\leftmargin}{}{}}
        %
        \newcommand{\InsertListL}[3][]{%
        \setlength{\leftskip}{\leftmargin}\mbox{}\vspace*{-\baselineskip}%
        \InsertBoxL{#2}{#3}[#1]\par \hspace{\itemindent}
        }%
        \newcommand{\InsertListR}[3][]{%
        \par\mbox{}\vspace*{-\baselineskip}\setlength{\leftskip}{\leftmargin}%
        \InsertBoxR{#2}{\hskip-\leftmargin#3\hskip\leftmargin}[#1]
        }%

\begin{document}
\begin{enumerate}
  \item Algunas de las variables de este fichero presenta bimodalidad debido a diferencias entre chicos y chicas. Utilizando los histogramas y el coeficiente de curtosis, indica en qué variable es más acusada esta bimodalidad (compara sólo las variables peso, altura, zapato, dinero (que llevan en el bolsillo) y tiempo (que tardan en llegar a la universidad)). Justifica la respuesta.
        \begin{figure}[hp]
          \centering
          \begin{tabular}{cc}
            \includegraphics[width=2.85in]{DATA/histogram_peso-sexo_3-4}
            \includegraphics[width=2.85in]{DATA/histogram_altura-sexo_3-4} & \\[2ex]
            \includegraphics[width=2.85in]{DATA/histogram_zapato-sexo_3-4.png}
            \includegraphics[width=2.85in]{DATA/histogram_dinero-sexo_3-4} & \\[2ex]
            \includegraphics[width=2.85in]{DATA/histogram_tiempo-sexo_3-4}
          \end{tabular}
        \end{figure}%

        \InsertListR[4]{0}{
          \begin{tabular}{|Cl|*{2}{S[table-format =-1.6]|}}
            \hline
            \multicolumn{3}{|Cc|}{\textbf{Coeficiente de Curtosis}} \\ \hline
                            & {\textbf{sexo=0}} & {\textbf{sexo=1}} \\ \hline
            \textbf{Peso} & 4,37531 & 1,21824 \\ \hline
            \textbf{Altura} & -0,97849 & 0,946925 \\ \hline
            \textbf{Zapato} & -0,28973 & -0,620593 \\ \hline
            \textbf{Dinero} & 6,88646 & 2,99526 \\ \hline
            \textbf{Tiempo} & -0,497143 & 0,106985 \\ \hline
          \end{tabular}}

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{enumerate}

\end{document} 

enter image description here

  • That's just what I wanted, thank you so much! One more thing... How can I take off the big box you put in the paper? :-) – user66636 Sep 19 '15 at 20:22
  • 1
    Oh that's the option showframe option of the geometry package. I added it just to check everything was placed at the right place. So remove the \geometry{showframe, nomarginpar} line. – Bernard Sep 19 '15 at 20:31
  • Thank you, @Bernar. One more question, I swear. I added your changes to my final documment, but the item has been displaced to the right as I did a tabulation, but I didn't. I don't know if you know what I mean... – user66636 Sep 19 '15 at 20:37
  • I don't see very well. Which item do you mean? the \item of the enumerate environment. Could you post a link to (part of) your document,, so I can see what's happening? – Bernard Sep 19 '15 at 20:43
  • it's supposed to look like i.imgur.com/Jkr7mwo.png, but it's actually look so: i.imgur.com/tEBXlMY.png – user66636 Sep 19 '15 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy