As a beginner, I will ask a question from a beginner. And I am a little bit lost with Latex packages documentation since there is, well, a lot of text ! (I prefer figures).
I read in Koma-Script manual this:
But often these floating environments are slightly misunderstood by beginners. They often ask for a fixed position of a table or figure within the text.
I need to write course materials (but not a book) with a lot figures and images and maths formulas. I would like to position the figures in the order and as close as possible from the text that reference them.
Having an image at the top or at the bottom of the page is sometimes not correct for me.
I tried to do this:
\documentclass[fontsize=12,a4paper,twoside,headheight=0.5cm,headsepline]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[bottom=2cm,footskip=15mm]{geometry}
\usepackage{scrlayer-scrpage}
\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}
\usepackage{lipsum}
\usepackage{a4}
\title{Trying to Latexize my materials}
\KOMAoptions{BCOR=2mm,DIV=22}
\usepackage{eso-pic}
\usepackage{graphicx}
\usepackage{geometry,color,float}
\AddToShipoutPictureBG{%
\AtPageUpperLeft{
\put(10,-10){%
\raisebox{-\height}{\includegraphics[width=2cm]{example-image-c}}
}
}
}
\usepackage{mwe} % for blindtext and example-image-a in example
\usepackage{wrapfig} %not KOMA: is it compatible ?
\pagestyle{scrheadings}
\cfoot{Le pied de page}
\rehead{En haut à droite pair}
\rohead{En haut à droite impair}
\cehead{centre pair}
\cohead{centre impair}
\begin{document}
\maketitle
\chapter{Starting}
\section{My first section}
\subsection{a subsection: introduction}
This is my first \LaTeX document !
\begin{figure}[th]
\centering
\includegraphics[width=300pt]{example-image-a}
\caption{capt}
\end{figure}
\lipsum[2]
\subsection{an image in this section}
There is an image below I want to comment now.
\begin{wrapfigure}{l}{0.5\textwidth}
\centering
\includegraphics[width=.98\linewidth]{example-image-a}
\caption{A caption}
\end{wrapfigure}
\lipsum[4]
\subsection{another image in this section}
And another one here
\begin{wrapfigure}{r}{0.5\textwidth}
\centering
\includegraphics[width=.98\linewidth]{example-image-b}
\caption{A caption}
\end{wrapfigure}
\lipsum[6]
\fbox{\begin{minipage}{0.9\textwidth}
''text''
\end{minipage}}
\end{document}
But as you can see in document which is here (to download the document follow the link and then click the download button, do not right-click then "Save target as...").
the second A image is misplaced at the bottom (as well as the following text). And I don't want the second A image (left placed) to be so close to the bottom. I don't want neither the 1.1.3 subsubsection to be shifted to the right like this. I would like the paragraph to be wrapped and the the 1.1.3 section to be left justified.
I am less interested in a perfect typographic layout than in a technical documentation layout with, sometimes, more text (I have 30% text, 70% figures/tables/images).
What is a good way to do this using KOMA-script ? Or am I on a wrong path and should I change my way of writing it ?
My target type of document can be found here this.
\captionof{figure}{actual caption}to get a caption. You might want to put this inside a minipage. – Johannes_B Feb 13 '14 at 10:07floatpackage and its[H]("HERE") position specifier? – Mico Feb 13 '14 at 10:22\captionof. This sledgehammer method is in general absolutely obsolete nowadays. – Thorsten Donig Feb 13 '14 at 15:13[H]method to specify the location of a float. Incidentally, as a matter of logic, I fail to see how putting a table or figure inside aminipageenvironment (and using the\captofinstruction to generate a numbered caption) is less of a sledgehammer solution to the problem of placing these items on a page than the[H]method is supposed to be. – Mico Feb 13 '14 at 16:51[H]method is that if the user changes his/her mind at some point in the future and decides to let afigureortableenvironment "float around" after all, it's trivially easy to do so by deleting the associated[H]placement specifier (and replacing it, if needed, with[t]or something more appropriate); no further editing required. :-) For what it's worth, in my own papers I never use either the[H]or the\captionofmethod; however, the needs of other writers will almost certainly differ from mine. – Mico Feb 13 '14 at 17:38