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?

xyhlon
  • 23
  • 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 Apr 08 '21 at 23:40
  • thanks didn't realise that the formatting was of and I could have given a more general example – xyhlon Apr 09 '21 at 00: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 Apr 09 '21 at 00:20
  • It worked with vspace :) – xyhlon Apr 09 '21 at 00:24
  • Well, the code you posted is not a working example. Working example is what I can copy&paste without guessing what packages, fonts, paper size you used. I guess I guessed wrong. Good you found a trick. However, it would be really helpful if you post an MWE next time. – facetus Apr 09 '21 at 00:29
  • 1
    you are totally right. sorry that I didn't include the packages I used – xyhlon Apr 09 '21 at 00:36
  • No worries. Welcome to the forum. :) I have an urge to write my own wrapfig in Lua. The existing package is unbearable. – facetus Apr 09 '21 at 01:04
  • Try using paracol instead. See https://tex.stackexchange.com/questions/591115/how-to-put-side-caption-in-a-figure-that-is-wrapped-inside-a-a-text/591155?r=SearchResults&s=1|0.0000#591155 for example. – John Kormylo Apr 09 '21 at 22:59

1 Answers1

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

xyhlon
  • 23