I use this command for 4 and 5 tiered subsections:
%-----------------------------------------------------------------------------
% add subsubsubsection
\newcommand{\subsubsubsection}[1]{\paragraph{#1}\mbox{}\\}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
% add subsubsubsubsection
\newcommand{\subsubsubsubsection}[1]{\paragraph{#1}\mbox{}\\}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
%-----------------------------------------------------------------------------
My problem is that the pdf has the order wrong. The table comes after some of the subsubsubsection instances in the pdf in spite of preceding them in the code.
I assume that the command lacks the necessary parts to control position and make it act like a normal subsection.
Please help me complete the missing parts to make this command work better.
Edit: an example for the table I'm using:
\begin{table}[h]
\begin{tabular}{lll}
& & \\
& & \\
& &
\end{tabular}
\end{table}
2nd edit: How can I add a positional argument for my command to be implemented like:
\subsubsubsection{some title}[h]
Edit 3: requested minimal example
\documentclass[
paper=a4, % Papierformat
oneside, % einseitig
fontsize=13pt, % Schriftgröße
headsepline=.5pt, % untere Kopfzeilenlinie
numbers=noenddot, % 1.1.1. --> 1.1.1
parskip=half, % halber Absatz
captions=tableheading, % Tabellenüberschriften
DIV=12, % Satzspiegel (KOMA-Script)
% toc=bibliography, % Quellenverzeichnis ins Inhaltsverzeichnis aufnehmen
%tocdepth=3, % Begrenzung der Ebenen im Inhaltsverzecihnis
%headings=normal, % Größe der überschriften verkleinern
final % Status des Dokuments (final/draft)
]{scrartcl}
%-----------------------------------------------------------------------------------------------------------
\begin{document}
%-----------------------------------------------------------------------------
%add subsubsubsection
\newcommand{\subsubsubsection}[1]{\paragraph{#1}\mbox{}\\}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
%add subsubsubsubsection
\newcommand{\subsubsubsubsection}[1]{\paragraph{#1}\mbox{}\\}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
%-----------------------------------------------------------------------------
\section{1st tier}
\begin{table}[h]
\begin{tabular}{lll}
a & a & a \\
a & a & a \\
a & a & a \\
\end{tabular}
\end{table}
\subsection{2nd tier}
\begin{table}[h]
\begin{tabular}{lll}
a & a & a \\
a & a & a \\
a & a & a \\
\end{tabular}
\end{table}
\subsubsection{3rd tier}
\begin{table}[h]
\begin{tabular}{lll}
a & a & a \\
a & a & a \\
a & a & a \\
\end{tabular}
\end{table}
\subsubsubsection{4th tier}
\begin{table}[h]
\begin{tabular}{lll}
a & a & a \\
a & a & a \\
a & a & a \\
\end{tabular}
\end{table}
\subsubsubsubsection{5th tier}
\begin{table}[h]
\begin{tabular}{lll}
a & a & a \\
a & a & a \\
a & a & a \\
\end{tabular}
\end{table}
\end{document}
\paragraphIS already defined as the 4th level of document depth, not\subsubsubsection. – Steven B. Segletes Dec 22 '21 at 16:17tableenvironment, that is by definition a float, and will not necessarily appear in the same order you have input it. To determine whether that is the case, more information is needed. (What you have provided regarding sub...sections in that case may be entirely irrelevant.) – barbara beeton Dec 22 '21 at 18:20\newcommand{\subsubsubsection}[1]{\paragraph{#1}\mbox{}\\}breaks most of latex's section handling controlling page breaking after the section head. Just use\paragraphbut declare it to be a display heading rather than run-in which you can do by directly modifying the definition or using titelsec – David Carlisle Dec 22 '21 at 21:10tabularwould not move, the only function of thetableenvironment is to allow the table to move, that is unrelated to your definitions – David Carlisle Dec 22 '21 at 21:11secnumdepthandtocdepthto 4 or 5? – David Carlisle Dec 22 '21 at 21:14