0

my Page starts with a picture then some text and after that i created a table. But after the build, the table is in front of the picture. At the beginning of the page...

\newpage

\begin{figure}[ht] \centering \includegraphics[scale=0.8]{./supply} \caption{Some Caption} \end{figure}

Text.... Text.... Text....

\begin{table} \centering \begin{tabular}{|l|l|} \hline Pin & Beschreibung \ \hline Conn2.1 & Positive Versorgungsspannung\ \hline Conn2.2 & Ground\ \hline Conn2.3 & Negative Versorgungsspannung\ \hline \end{tabular} \caption{other caption} \end{table}

\newpage

2 Answers2

2

Let me spell out my comment ... If you not specify position of floats (figure, table) they will float to the top of page, so your case you only need to specify positioning for table too:

\documentclass{article}
\usepackage{graphicx}
\usepackage{lipsum} % for dummy text

\begin{document} \begin{figure}[ht] % <--- \centering \includegraphics[scale=0.8]{example-image-duck}%{./supply} \caption{Some Caption} \end{figure} \lipsum[1]

\begin{table}[htb] % <--- \centering \begin{tabular}{|l|l|} \hline Pin & Beschreibung \ \hline Conn2.1 & Positive Versorgungsspannung\ \hline Conn2.2 & Ground\ \hline Conn2.3 & Negative Versorgungsspannung\ \hline \end{tabular} \caption{other caption} \end{table} \end{document}

enter image description here

For details about float positioning and meaning of (positions) specifier h (here) , t (top), b (bottome) p (page); see comprehensive description in the Frank Mittelbach answer float positioning. BTW, it is recommended that you use h in pair with t or b etc, since otherwise can happen that float will be pushed to the end of document, if in the page after its inserting will not be enough space for it placement.

Zarko
  • 296,517
0

enter image description here

\documentclass{article}
\usepackage{titlesec}
%1inch=25,4mm
%\titlelabel{{\hspace*{1cm}\makebox[1cm][l]{\thetitle}}}
%\usepackage{indentfirst}
\usepackage{lipsum}
\usepackage{showframe}
\usepackage[demo]{graphicx}
\begin{document}
    \newpage
\begin{figure}[]
    \centering
    \includegraphics[scale=0.8]{./supply}
    \caption{Some Caption}
\end{figure}

Text....
Text....
Text....

\begin{table}
    \centering
    \begin{tabular}{|l|l|}
        \hline
        Pin &amp; Beschreibung \\ \hline
        Conn2.1 &amp; Positive Versorgungsspannung\\ \hline
        Conn2.2 &amp; Ground\\ \hline
        Conn2.3 &amp; Negative Versorgungsspannung\\ 
        \hline
    \end{tabular}
    \caption{other caption}
\end{table}

\newpage

\end{document}

EDIT

\documentclass{article}
\usepackage{titlesec}
%1inch=25,4mm
%\titlelabel{{\hspace*{1cm}\makebox[1cm][l]{\thetitle}}}
%\usepackage{indentfirst}
\usepackage{lipsum}
\usepackage{showframe}
\usepackage[demo]{graphicx}
\begin{document}
    \newpage
\begin{figure}[]
    \centering
    \includegraphics[scale=0.8]{./supply}
    \caption{Some Caption}
\end{figure}

Text....
Text....
Text....

\begin{table}[htbp]
    \centering
    \begin{tabular}{|l|l|}
        \hline
        Pin &amp; Beschreibung \\ \hline
        Conn2.1 &amp; Positive Versorgungsspannung\\ \hline
        Conn2.2 &amp; Ground\\ \hline
        Conn2.3 &amp; Negative Versorgungsspannung\\ 
        \hline
    \end{tabular}
    \caption{other caption}
\end{table}

\newpage

\end{document}

enter image description here

js bibra
  • 21,280