0

Code:

\documentclass[12pt,oneside,a4paper,bibliography=totoc,captions=figuresignature]{scrartcl}

\usepackage[left=3cm,right=2cm,top=2cm,bottom=2cm,includeheadfoot]{geometry}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[dvipdfmx]{graphicx}
\usepackage{moresize}
\usepackage{pstricks-add}
\usepackage{amssymb}
\usepackage{setspace} 
\usepackage{mathtools}
\usepackage{stmaryrd}
\usepackage{textcomp}
\usepackage[normalem]{ulem}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{siunitx}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{bmpsize}
\usepackage{subcaption}
\usepackage{float}

\renewcommand{\figurename}{Tabelle}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\setkomafont{sectioning}{\rmfamily\bfseries} 
\begin{document}
\begin{titlepage}
\thispagestyle{empty}
\begin{center}
\textbf{\LARGE Wie prägt der sozioökonomische Status die}
\vspace{1cm}
\textbf{\LARGE Persönlichkeit eines Kindes?}
\vspace{5.5cm}
\large
Bachelorarbeit zur Erlangung des Grades \\
\vspace{0.75cm}
Bachelor of Science (B.Sc.) \\
\vspace{0.75cm}
Topic \\
\vspace{0.75cm}
Uni
\vspace{5.5cm}

Themenstellerin: Professor
\vspace{2cm}

vorgelegt im Juni 2017 von:
\\
Name
\\
Matrikelnummer: 5555555
\end{center}
\end{titlepage}
\onehalfspacing
\newpage
\thispagestyle{empty}
\tableofcontents
\newpage
\pagenumbering{arabic}
\section{Einleitung}
\subsection{Ökonomische Präferenzen und IQ}
\newpage
\begin{figure}[h]
   \caption{Standardnormalverteilungen der ökonomischen Präferenzen}  
   \begin{subfigure}[!htp]{0.5\textwidth}
      \includegraphics[scale=0.69]{zeit.eps} 
      \subcaption{Zeitpräferenzen}
            \label{subfig:time}
   \end{subfigure}\hfill%
   \begin{subfigure}[!htp]{0.5\textwidth} 
      \includegraphics[scale=0.69]{risiko.eps} 
      \subcaption{Risikopräferenzen}
            \label{subfig:risk}
   \end{subfigure}\\[9.757pt]%
   \centering 
   \begin{subfigure}[!htp]{0.5\textwidth} 
      \includegraphics[scale=0.69]{altru.eps} 
      \subcaption{Altruismus}
            \label{subfig:alt}
   \end{subfigure}
    \label{fig:pref}
\end{figure}
\addtocounter{figure}{-1}
\newpage

Zur Quantifizierung des IQ des Kindes wird ebenfalls ein Proxy verwendet. Hierzu wird auf die vom Kind zuletzt erreichte Note in den Fächern Mathematik und Deutsch zurückgegriffen. Die Ergebnisse der Mathe- und Deutschnote wurden standardisiert. In Abbildung 2 sind die Histogramme der Mathenote (a) und Deutschnote (b) zu sehen.

\begin{figure}[h]
   \caption{Standardnormalverteilungen der Mathe- und Deutschnoten}  
   \begin{subfigure}[!htp]{0.49\textwidth} 
      \includegraphics[scale=0.69]{mathe.eps} 
      \subcaption{Mathenoten}
            \label{subfig:mat}
   \end{subfigure}
   \begin{subfigure}[!htp]{0.49\textwidth} 
      \includegraphics[scale=0.69]{deutsch.eps} 
      \subcaption{Deutschnoten}
            \label{subfig:ger}
     \end{subfigure}
    \label{fig:grades}
\end{figure}

\end{document}

Not sure whether I've posted it appropriately. My issue is the placement of the figures (subfigures). They are on the last page and not where they should be. In this example I am using [h] but I've also tried [!h], [!htp] and so on. Anyone an idea what I am perhaps doing wrong? Many thanks in advance!

Stefan Pinnow
  • 29,535
xarife
  • 1
  • Ok... this looks already horrible. How can I post the code properly? – xarife Jun 09 '17 at 08:27
  • 1
    Highlight it and hit ctrl-k. Also h does not mean "here!" it means here of possible (plus there has to be text above and below it). If h is not possible here it is discarded. Try instead htbp and it should appear as close as possible – daleif Jun 09 '17 at 08:29
  • 1
    If images get pasted in the back, it can be an indication that the images are too big. Try \includegraphics[width=\textwidth]. It should take the text width of the subfigure; if not, try [width=0.5\textwidth]. – Huang_d Jun 09 '17 at 08:33
  • 2
    Don't use [h], but [htp] – egreg Jun 09 '17 at 08:40
  • Thanks a lot guys. Alex solution was so simple and worked really well. Appreciate your assistance! – xarife Jun 09 '17 at 14:43
  • [htp] works for me, for some reason Latex interprets it as "next page". – Yan King Yin Oct 01 '18 at 05:48

1 Answers1

3

Since my reputation does not allow simple commenting, here just a quick idea. You might want to look into \FloatBarrier from the placeinspackage. See here for more info.

KyuMirthu
  • 131
  • Thanks man! It worked! And what a simple command. Have a nice day mate! – xarife Jun 09 '17 at 14:39
  • Do you know how I set my question as answered? – xarife Jun 09 '17 at 14:42
  • 1
    I think there should be a tick symbol on the left side of my answer. If you click that, the tick should become green and the answer is marked as accepted. Glad I could help you out! – KyuMirthu Jun 10 '17 at 15:33