0

I have probably a stupid question and how do I get rid of the extra space in this extra space on top of my table. enter image description here

This is what I wrote in latex.

\documentclass[11pt]{scrartcl}

\usepackage[utf8]{inputenc} %set encoding
\usepackage[T1]{fontenc}    %fonts

\usepackage{lipsum}

%languages
\usepackage{lmodern}
\usepackage[ngerman]{babel}

\usepackage{scrlayer-scrpage}

\usepackage{graphicx} %for including graphics
\usepackage{lastpage} %for inserting the lastpage number
\usepackage{pdfpages} %for including pdfs
\usepackage{wrapfig}  %for better text wrapable figures

\usepackage[labelsep=colon,justification=justified,labelfont=bf,textfont=sl]{caption,subcaption}
\usepackage[margin=3cm,a4paper]{geometry} %for layout
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{multirow}

% double Table caption fix
\usepackage[
singlelinecheck=false,
justification=centering
]{caption}

\newpage
\lipsum

\begin{wrapfigure}{l}{.6\linewidth}
\captionof{table}{Messreihe und Histogramm von 10 Schwingungsperioden bei der}
\begin{minipage}[t]{\linewidth}
    \rule{\textwidth}{5cm}
\end{minipage}
\end{wrapfigure}
\begin{wraptable}{r}{.3\linewidth}
\centering
\caption{Table inside a wraptable}
\begin{tabular}{lr}
    \toprule
    {} &    $T$ \\
    \midrule
    0  &  29.63 \\
    1  &  29.70 \\
    2  &  29.62 \\
    3  &  29.65 \\
    4  &  29.38 \\
    5  &  29.75 \\
    6  &  29.73 \\
    7  &  29.62 \\
    8  &  29.71 \\
    9  &  29.82 \\
    10 &  29.89 \\
    11 &  29.76 \\
    12 &  29.60 \\
    13 &  29.68 \\
    14 &  29.82 \\
    15 &  29.62 \\
    16 &  29.80 \\
    17 &  29.87 \\
    18 &  29.62 \\
    19 &  29.76 \\
    20 &  29.52 \\
    21 &  29.79 \\
    22 &  29.66 \\
    23 &  29.81 \\
    24 &  29.73 \\
    25 &  29.80 \\
    26 &  29.73 \\
    27 &  29.53 \\
    28 &  29.77 \\
    29 &  29.60 \\
    \bottomrule
\end{tabular}
\label{table:ta2}
\end{wraptable}

\lipsum

Can somebody help?

8
  • 1
    wrapfig is 18 years old. It has very unstable behavior. It often requires dances with tambourine and singing shaman songs to make it work. Therefore, a working minimum example reproducing the problem would be a good helper for others.
    – facetus
    Commented Apr 8, 2021 at 23:40
  • thanks didn't realise that the formatting was of and I could have given a more general example
    – xyhlon
    Commented Apr 9, 2021 at 0:07
  • This is not going to work. wrapfig uses parshape to adjust text lines around a figure. It cannot place two figures side by side.
    – facetus
    Commented Apr 9, 2021 at 0:20
  • It worked with vspace :)
    – xyhlon
    Commented Apr 9, 2021 at 0:24
  • 1
    you are totally right. sorry that I didn't include the packages I used
    – xyhlon
    Commented Apr 9, 2021 at 0:36

1 Answer 1

1

I found an answer but it might not be pretty

\newpage
\lipsum

\begin{wrapfigure}{l}{.6\linewidth}
\captionof{table}{Messreihe und Histogramm von 10 Schwingungsperioden bei der}
\begin{minipage}[t]{\linewidth}
    \rule{\textwidth}{5cm}
\end{minipage}
\end{wrapfigure}
\begin{wraptable}{r}{.3\linewidth}
\vspace{6cm} % here is my dirty fix
\centering
\caption{Table inside a wraptable}
\begin{tabular}{lr}
    \toprule
    {} &    $T$ \\
    \midrule
    0  &  29.63 \\
    1  &  29.70 \\
    2  &  29.62 \\
    3  &  29.65 \\
    4  &  29.38 \\
    5  &  29.75 \\
    6  &  29.73 \\
    7  &  29.62 \\
    8  &  29.71 \\
    9  &  29.82 \\
    10 &  29.89 \\
    11 &  29.76 \\
    12 &  29.60 \\
    13 &  29.68 \\
    14 &  29.82 \\
    15 &  29.62 \\
    16 &  29.80 \\
    17 &  29.87 \\
    18 &  29.62 \\
    19 &  29.76 \\
    20 &  29.52 \\
    21 &  29.79 \\
    22 &  29.66 \\
    23 &  29.81 \\
    24 &  29.73 \\
    25 &  29.80 \\
    26 &  29.73 \\
    27 &  29.53 \\
    28 &  29.77 \\
    29 &  29.60 \\
    \bottomrule
\end{tabular}
\label{table:ta2}
\end{wraptable}

\lipsum

You must log in to answer this question.

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