1

How can I get rid of vertical extra space in latex? I am getting unnecessary space between the table and the figure in the latex appendix.

\documentclass{scrbook}

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{tabularray}


\begin{document}
\chapter{Appendix}
 \begin{table}[!ht]
    \centering
    \begin{tabular}{|l|l|l|l|}
    \hline
        Sender & Receiver & Total(Bits) &  Frame Rate (ms)  \\ \hline
        VCU & ACU & 88 &  10  \\ \hline
        VCU & BCU & 488 &  10  \\ \hline
        VCU & DataRecorder & 536 &  10  \\ \hline
   

    \end{tabular}
\end{table}

\begin{figure}
    \centering
    \includegraphics[width = \textwidth,trim={2.3cm 2.3cm 2.3cm 2.3cm},clip]{Device Graphics.pdf}
    \caption{Device Block}
    \label{fig:DeviceOverview}
\end{figure}
\end{document}

enter image description here

I tried using [H] in front of image but did not work instead [H] got printed in script

1 Answers1

0

You have to specify where your images is allowed to be placed. To give latex the best possible chances to find a good location, you can use [htbp] to allow the image to be placed here, at the top, at the bottom or on a separate float page:

\documentclass{scrbook}

%\usepackage[utf8]{inputenc} % default since several years

%\usepackage{tabularray} % nothing to do with the question
\usepackage{graphicx}

\begin{document}
\chapter{Appendix}
 \begin{table}[!ht]
    \centering
    \begin{tabular}{|l|l|l|l|}
    \hline
        Sender & Receiver & Total(Bits) &  Frame Rate (ms)  \\ \hline
        VCU & ACU & 88 &  10  \\ \hline
        VCU & BCU & 488 &  10  \\ \hline
        VCU & DataRecorder & 536 &  10  \\ \hline
    \end{tabular}
\end{table}

\begin{figure}[htbp]
    \centering
    \includegraphics[width=\textwidth,trim={2.3cm 2.3cm 2.3cm 2.3cm},clip]{example-image-duck}
    \caption{Device Block}
    \label{fig:DeviceOverview}
\end{figure}
\end{document}

enter image description here