-1

I would like to add an image to a document I am working on. However I am having problems with the text positioning after the inserted picture. This latter keeps pushing whatever text I write at the end of the page.

Here is the code (I also ask to please tell me how to paste TeX code into Stack Exchange):

\documentclass[11pt, hungarian, german]{article}
\usepackage[utf8]{inputenc}
\renewcommand*\rmdefault{ppl}
\usepackage{geometry}
% \usepackage{tasks} 
% \usepackage{caption}
% \usepackage{fixltx2e}
% \usepackage[hang,flushmargin, norule]{footmisc}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{array}
\usepackage{verbatim}
\usepackage{lipsum} 
\usepackage{multicol}
\usepackage{framed}
% \usepackage{mathtools}
\graphicspath{ {/home/eslukasiew/.Document/Hungarian} }

\begin{document}

\setlength{\columnseprule}{0.2pt}
\pagenumbering{gobble}

\begin{center}
    \textsc{\Huge Országismeret}\\[1.5cm]
\end{center}

\begin{large}

\begin{multicols*}{2}

\begin{center}
    \textbf{\Large Olaszország}\\[.8cm]
\end{center}

\includegraphics[width=6.4cm, height=4cm]{cupolone}

\begin{center}
    {\footnotesize A "cupolone" Firenzeben}\\[.8cm]
\end{center}

\vspace*{\fill}
\columnbreak

\noindent
\begin{center}
    \textbf{\Large Szótár}\\[.8cm]
\end{center}

\end{multicols*}

\end{large}

\end{document}
Dan
  • 3,699
eslukas
  • 177
  • to make a code block just indent by four spaces (which you can do by selecting the code and using the {} button in the editor) – David Carlisle Nov 08 '16 at 21:10

1 Answers1

1

Your code example has a lot of code that is not needed in order to reproduce your problem. Next time please "clean" the code.

In addition don't use pictures that we cannot access - you can use the demo option of the graphicx package, see Compile a file when images are missing/not available.

I assume that you are a beginner since you use a lot of unconventional stuff in your code. I suggest that you start reading a recent book in order to get to know the basic principles of LaTeX.

Now to your question - when you load the float package than you can use the so-called H placement option as you can see in the code below. With the H option (meaning Here and nowhere else) you can force LaTeX to place a figure exactly where you put it in the code flow.

\documentclass[]{article}
\usepackage[demo]{graphicx}

\usepackage{multicol}

% provides the H placement option for the figure environment
\usepackage{float}

\begin{document}

\setlength{\columnseprule}{0.2pt}

\begin{center}
    \textsc{\Huge test}\\[1.5cm]
\end{center}

\begin{large}

    \begin{multicols*}{2}

        \begin{center}
            \textbf{\Large test}\\[.8cm]
        \end{center}

        Text before.        

        \begin{figure}[H]
        \centering
        \includegraphics{demo}
        \caption{A "cupolone" Firenzeben}
        \end{figure}

        Text after.             

        \vspace*{\fill}
        \columnbreak

        \noindent

        \begin{center}
            \textbf{\Large test}\\[.8cm]
        \end{center}

    \end{multicols*}

\end{large}

\end{document}

enter image description here

Make sure that you also read How to influence the position of float environments like figure and table in LaTeX?.

Some people dislike to use the H placement option but I do not want to get into that.