1

I am trying to create more space between the words and my table. Does anyone know how to do this? Thank you in advance!

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[sf,sl,outermarks,noindentafter,nobottomtitles]{titlesec}
\usepackage[table]{xcolor} % F�r farbige Tabellenzellen
\usepackage{colortbl} % F�r farbige Tabellenzellen mit cellcolor

\title{h} \author{gh} \date{February 2021}

\begin{document} In der Tabelle \ref{tab:x:Komplexität} ist die Komplexität der einzelnen Frequenzschätzungsverfahren aufgelistet. \begin{table}[ht!] \begin{center} \centering \caption{Komplexität der Frequensschätzungsverfahren} \renewcommand{\arraystretch}{1.5} \begin{tabular}{c|c|c|c|c} \rowcolor[gray]{.8} \hline Verfahren & \textbf{FFT} & \textbf{STFT} & \textbf{Pspectrum} & \textbf{Welch}\ \hline Komp & $O(N\cdot log(N))$ & $O(\Delta t\cdot N\cdot log(N))$& - & $O(N\cdot log(L))$ \ \rowcolor[gray]{.8} \hline Verfahren & \textbf{Periodogram} & \textbf{Lomb-Scargle} & \textbf{Kreuzkorrelation} & \textbf{Zero-Crossing} \ \hline Komp & $O(N\cdot log(N))$ & $O(N\textsuperscript{2})$ & $O(N\cdot N\textsubscript{S})$ & -\ \rowcolor[gray]{.8} \hline Verfahren & \textbf{Burg-Methode} & \textbf{Yule-Walker} & \textbf{MUSIC} & \textbf{Eigenvektor} \ \hline Komp &$O(N\cdot log(N) + p\textsuperscript{2})$& $O(p\textsuperscript{2}+N\cdot p)$ & $O(N\textsubscript{Kor}\textsuperscript{3})$ & $O(N\textsubscript{Kor}\textsuperscript{3})$ \ \hline \end{tabular} \end{center} \label{tab:x:Komplexität} \renewcommand{\arraystretch}{1} \end{table} \begin{center}\begin{tabular}{rclcrcl} \renewcommand{\arraystretch}{1.5} $N$ & = & Signallänge &$\qquad$& $\Delta t$ &=& Zeitfenster \ $L$ & = & Länge der Überlappung & & $N\textsubscript{S}$ &=& Verzögerungslänge\ $p$ & = & Ordnung &$\qquad$& Komp & = & Komplexität\ $N\textsubscript{kor}$ & = & gewählte Länge der Korrelationsmatrix\ \end{tabular}\end{center} afhkf

\section{Introduction}

\end{document}

enter image description here

Adam
  • 95
  • 2
    Put the label just after the captions. And don't use the center environment within table: you'll have a spurious vertical spacing – \centering is enough. – Bernard Feb 15 '21 at 23:48
  • Thank you! @Bernard Do you know how to create more space between the text and table I marked with green? – Adam Feb 15 '21 at 23:52
  • You could add a \ over your afhkf to create an empty line. – TornaxO7 Feb 16 '21 at 00:07
  • Unfortunately, that's not possible @TornaxO7 – Adam Feb 16 '21 at 00:15

1 Answers1

1

Like this?

enter image description here

Your table is wider than default article text width. So I add in preamble \usepackage{geometry}. For table I suggest to use tabularx and for legend below table align defined in amsmath package:

\documentclass{article}
\usepackage{geometry}
\usepackage[sf,sl,outermarks,noindentafter,nobottomtitles]{titlesec}
\usepackage[table]{xcolor} % Für farbige Tabellenzellen
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcounter{tblerows}% see https://tex.stackexchange.com/questions/297345/
                     % why-is-the-start-row-of-rowcolors-ignored-in-tabularx
\expandafter\let\csname c@tblerows\endcsname\rownum
\usepackage{amsmath}

\usepackage{lipsum}

\title{h} \author{gh} \date{February 2021}

\begin{document} In der Tabelle \ref{tab:x:Komplexität} ist die Komplexität der einzelnen Frequenzschätzungsverfahren aufgelistet. \begin{table}[ht!] \centering \caption{Komplexität der Frequensschätzungsverfahren} \label{tab:x:Komplexität} \renewcommand{\arraystretch}{1.5} \rowcolors{1}{gray!30}{white} \begin{tabularx}{\linewidth}{|c|*{4}{C|} } % <--- \hline Verfahren & \textbf{FFT} & \textbf{STFT} & \textbf{Pspectrum} & \textbf{Welch}\ \hline Komp & $O(N{\cdot}log(N))$ & $O(\Delta t{\cdot}N{\cdot}log(N))$& -- & $O(N{\cdot}log(L))$ \ \hline Verfahren & \textbf{Periodogram} & \textbf{Lomb-Scargle} & \textbf{Kreuzkorrelation} & \textbf{Zero-Crossing} \ \hline Komp & $O\bigl(N{\cdot}log(N)\bigr)$ & $O(N^2)$ & $O(N{\cdot}N_{\text{S}})$ & -\ \hline Verfahren & \textbf{Burg-Methode} & \textbf{Yule-Walker} & \textbf{MUSIC} & \textbf{Eigenvektor} \ \hline Komp &$O(N{\cdot}log(N) + p^2)$& $O(p^{2}+N{\cdot}p)$ & $O(N_{\text{Kor}}^{3})$ & $O(N_{\text{Kor}}^{3})$ \ \hline \end{tabularx}

\begin{align*}

N & = \text{Signallänge}
& \Delta t & = \text{Zeitfenster} \ L & = \text{Länge der Überlappung}
& N_{\text{S}}& = \text{Verzögerungslänge} \ p & = \text{Ordnung} & \text{Komp} & = \text{Komplexität} \ N_{\text{kor}} & = \text{gewählte Länge der Korrelationsmatrix}
& &
\end{align*} \end{table}

\lipsum[11]

\section{Introduction}

\end{document}

Edit (1): added is vertical line at left side of the table and improved table code.

Edit (2): improved table coloring.

Zarko
  • 296,517