I'm working on an assignment, and I've been working on this specific typographic issue on and off now for two'ish days. Having google'd a lot, read a lot, and tried a lot of the suggestions posted here, I've learned that I'm not the first person searching for an answer to this question, but I haven't managed solve it myself and make the assignment look like anything worth submitting.
What I'm looking for is preferably a way to assign a figure and a figure text to a certain set of pixels at the page and having them stay fixed in place no matter what else might be going on at the page.
What I have made so far looks like this:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{relsize}
\usepackage{physics}
\usepackage{setspace}
\usepackage{graphicx}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage[a4paper, margin={2cm,1.5cm}]{geometry}
\spacing{1.33}
% pictu{picture.png}{right/left}{size}{ref-label}{figure text}
\newcommand{\pictu}[5]{\begin{wrapfigure}{#2}{#350\textwidth}
\includegraphics[width=#350\textwidth]{#1}
\caption{\setstretch{1}\centering\label{#4}#5}
\end{wrapfigure}}
\title{lipsum}
\author{lipsum}
\date{lipsum}
\begin{document}
\maketitle
\section{lipsum mania}
\subsection{subsection 1.1}
\pictu{pic.png}{R}{0.35}{fig:pic1}{figure text.}
Short text here.
\quad
\newline
\lipsum[1]
\subsection{subsection 1.2}
Some more short text here.
\pictu{pic1.png}{L}{0.35}{fig:pic}{Fig text.}
\quad
\newline
\lipsum[1]
\quad
\newline
For some reason the margin set in the beginning doesn't apply to this page... \lipsum[1]
\pictu{picture_related_to_section_1_2.png}{R}{0.35}{fig:pic}{Picture related to subsection 1.2 ... one of which I'd really like to force the placement}
\lipsum[1]
\subsection{Subsection 1.3}
\pictu{picture_with_a_big_fat_unwanted_blank_area_above.png}{R}{0.4}{fig:picx}{Apparently there's a no man's land for text aboce this figure... I assume, it's because the figures are to close, making the program 'think' there's no room for text.}
A bit longer section of short text... which is right now annoying close to the figure text of the misplaced figure.
\lipsum[1]
\subsection{Last subsection so far}
\pictu{picture_related_to_the_last_subsection.png}{R}{0.35}{fig:PnxX}{This picture should preferably be above "Section 2" ... which is it in the code.}
\lipsum[1]
\section{Section 2}
\end{document}
I have included an example of the current typography of a page produced by the code in the end of this novel.
To make the code look cleaner, I made a \newcommand, \pictu, which (to my knowledgde works exactly like just pasting the wrapfig environment each time - neither works ideally though). Feel free to question or correct the code. I'm not looking for fixes - I'm convinced that I'm not anywhere near the right track of a pretty solution. I won't hesitate to abandon this code for something that works.
I've often read that one should just let "LaTex do its thing" and place the figures, where they fit best with the rest of the text, but this has not worked for my case. That's why I initially began to deal with wrapfig.
What I need is to know, if there is a way to force images to remain fixed at specific pixels of the page, or if I have to resign and invest in a Microsoft Office license (I really do want this to work, but so far I'm incapable).
Sorry, for any possible mistakes or lack of knowledge or etiquette regarding my question - I'm new to both latex and to the forum. And if this question has already been answered, do let me know!
And thanks in advance!
\maketitle
in the preamble which generates an error and if you move it after\begin{document}
you get an error from\centering
mis-used in\caption
:! Undefined control sequence. \\->\let \reserved@e
\maketitle
correction. @Au101 What do you mean by "not really what LaTex is meant for"? Out of sincere curiosity. LaTex has been presented to me as "the 'everything is possible'-typesetting tool", just a question of will and the right packages. And speaking of: "There are all kinds of packages to force the floats to come before or after x or y", do you by any chance know something I can look for?