I am having trouble placing TikZ inside a multicol latex without introducing unwanted whitespaces.
main.tex:
\documentclass[10pt]{article}
% Packages
\usepackage{multicol,caption}
\usepackage{graphicx}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{lipsum}
\newenvironment{Figure}
{\par\medskip\noindent\minipage{\linewidth}}
{\endminipage\par\medskip}
\newcommand\myfigure[1]{%
\medskip\noindent\begin{minipage}{\columnwidth}
\centering%
#1%
%figure,caption, and label go here
\end{minipage}\medskip}
\usepackage{titlesec}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\titleclass{\subsubsubsection}{straight}[\subsection]
\newcounter{subsubsubsection}[subsubsection]
\renewcommand\thesubsubsubsection{\thesubsubsection.\arabic{subsubsubsection}}
\renewcommand\theparagraph{\thesubsubsubsection.\arabic{paragraph}} % optional; useful if paragraphs are to be numbered
\titleformat{\subsubsubsection}
{\normalfont\normalsize\bfseries}{\thesubsubsubsection}{1em}{}
\titlespacing*{\subsubsubsection}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\makeatletter
\renewcommand\paragraph{@startsection{paragraph}{5}{\z@}%
{3.25ex @plus1ex @minus.2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\renewcommand\subparagraph{@startsection{subparagraph}{6}{\parindent}%
{3.25ex @plus1ex @minus .2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\def\toclevel@subsubsubsection{4}
\def\toclevel@paragraph{5}
\def\toclevel@paragraph{6}
\def\l@subsubsubsection{@dottedtocline{4}{7em}{4em}}
\def\l@paragraph{@dottedtocline{5}{10em}{5em}}
\def\l@subparagraph{@dottedtocline{6}{14em}{6em}}
\makeatother
% Uses alphabets instead of numbers for the subsubsubsection
\def\thesubsubsubsection{\alph{subsubsubsection}}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows, arrows.meta}
\usepackage{makecell}
\tikzstyle{startstop} = [draw, rounded rectangle, minimum width=3cm, minimum height=1cm, text width=3cm, text centered, draw=black]
\tikzstyle{object} = [draw, trapezium, trapezium left angle=70, trapezium right angle=-70, minimum width=3cm, minimum height=1cm, text centered, draw=black]
\tikzstyle{process} = [draw, rectangle, minimum width=3cm, minimum height=1cm, text width=3cm, text centered, draw=black]
\tikzstyle{arrow} = [thick,->,>=Triangle]
\usepackage{subfiles}
\providecommand{\main}{.}
\geometry{a4paper, margin = 1in}
% Document
\begin{document}
\begin{multicols}{2}
\subfile{sample/sample.tex}
\bibliography{main}
\end{multicols}
\end{document}
How the sample.tex looks like.
Figure Solution:
% Preamble
\providecommand{\main}{..}
\documentclass[\main/main.tex]{subfiles}
% Packages
% Document
\begin{document}
\section{Section}
\lipsum[1][1-2]
\subsection{Subsection}
\lipsum[2][2-5]
\subsubsection{Subsubsection}
\lipsum[3][1-3]
\subsubsubsection{subsubsubsection}
\lipsum[3-4][1-4]
\begin{Figure}
\centering
\begin{tikzpicture}[node distance=2cm]
\node(start)[startstop]{Start};
\node(nd1)[object, below of=start]{Node1};
\node(nd2)[process, below of=nd1]{\makecell[c]{Node \ 2}};
\node(nd3)[process, below of=nd2]{Node3};
\node(nd4)[object, below of=nd3]{\makecell[c]{Node4}};
\node(end)[startstop, below of=nd4]{End};
\draw[arrow](start)--(nd1);
\draw[arrow](nd1)--(nd2);
\draw[arrow](nd2)--(nd3);
\draw[arrow](nd3)--(nd4);
\draw[arrow](nd4)--(end);
\end{tikzpicture}
\captionof{figure}{Some text describing the Figure}
\end{Figure}
\lipsum[4-6]
\begin{Figure}
\centering
\begin{tikzpicture}[node distance=2cm]
\node(start)[startstop]{Start};
\node(nd1)[object, below of=start]{Node1};
\node(nd2)[process, below of=nd1]{\makecell[c]{Node \ 2}};
\node(nd3)[process, below of=nd2]{Node3};
\node(nd4)[object, below of=nd3]{\makecell[c]{Node4}};
\node(end)[startstop, below of=nd4]{End};
\draw[arrow](start)--(nd1);
\draw[arrow](nd1)--(nd2);
\draw[arrow](nd2)--(nd3);
\draw[arrow](nd3)--(nd4);
\draw[arrow](nd4)--(end);
\end{tikzpicture}
\captionof{figure}{Some text describing the Figure}
\end{Figure}
\lipsum[6-7]
\end{document}
The solution suggested here does not wrap the text as expected and leaves large chunks of white space in-between paragraphs as shown by the purple arrows. A similar method also does not work and exhibits the same white spaces.

figure[H] Method:
% Same as before
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance=2cm]
\node(start)[startstop]{Start};
\node(nd1)[object, below of=start]{Node1};
\node(nd2)[process, below of=nd1]{\makecell[c]{Node \ 2}};
\node(nd3)[process, below of=nd2]{Node3};
\node(nd4)[object, below of=nd3]{\makecell[c]{Node4}};
\node(end)[startstop, below of=nd4]{End};
\draw[arrow](start)--(nd1);
\draw[arrow](nd1)--(nd2);
\draw[arrow](nd2)--(nd3);
\draw[arrow](nd3)--(nd4);
\draw[arrow](nd4)--(end);
\end{tikzpicture}
\caption{Some text describing the figure}
\end{figure}
\lipsum[4-6]
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance=2cm]
\node(start)[startstop]{Start};
\node(nd1)[object, below of=start]{Node1};
\node(nd2)[process, below of=nd1]{\makecell[c]{Node \ 2}};
\node(nd3)[process, below of=nd2]{Node3};
\node(nd4)[object, below of=nd3]{\makecell[c]{Node4}};
\node(end)[startstop, below of=nd4]{End};
\draw[arrow](start)--(nd1);
\draw[arrow](nd1)--(nd2);
\draw[arrow](nd2)--(nd3);
\draw[arrow](nd3)--(nd4);
\draw[arrow](nd4)--(end);
\end{tikzpicture}
\caption{Some text describing the figure}
\end{figure}
\lipsum[6-7]
\begin{figure}[H]
\centering
\begin{tikzpicture}[node distance=2cm]
\node(start)[startstop]{Start};
\node(nd1)[object, below of=start]{Node1};
\node(nd2)[process, below of=nd1]{\makecell[c]{Node \ 2}};
\node(nd3)[process, below of=nd2]{Node3};
\node(nd4)[object, below of=nd3]{\makecell[c]{Node4}};
\node(end)[startstop, below of=nd4]{End};
\draw[arrow](start)--(nd1);
\draw[arrow](nd1)--(nd2);
\draw[arrow](nd2)--(nd3);
\draw[arrow](nd3)--(nd4);
\draw[arrow](nd4)--(end);
\end{tikzpicture}
\caption{Some text describing the figure}
\end{figure}
% Same as before
I also tried this method involving the float package but have the same issues. It might work for a single figure but multiple figures break it since it is removing the figure's ability to 'float' if my understanding of how figure[H] works is correct.

wrapfigure Method:
% Same as before
\begin{wrapfigure}{l}{\linewidth}
\centering
\begin{tikzpicture}[node distance=2cm]
\node(start)[startstop]{Start};
\node(nd1)[object, below of=start]{Node1};
\node(nd2)[process, below of=nd1]{\makecell[c]{Node \ 2}};
\node(nd3)[process, below of=nd2]{Node3};
\node(nd4)[object, below of=nd3]{\makecell[c]{Node4}};
\node(end)[startstop, below of=nd4]{End};
\draw[arrow](start)--(nd1);
\draw[arrow](nd1)--(nd2);
\draw[arrow](nd2)--(nd3);
\draw[arrow](nd3)--(nd4);
\draw[arrow](nd4)--(end);
\end{tikzpicture}
\caption{Some text describing the figure}
\end{wrapfigure}
\lipsum[4-6]
\begin{wrapfigure}{l}{1.0\linewidth}
\centering
\begin{tikzpicture}[node distance=2cm]
\node(start)[startstop]{Start};
\node(nd1)[object, below of=start]{Node1};
\node(nd2)[process, below of=nd1]{\makecell[c]{Node \ 2}};
\node(nd3)[process, below of=nd2]{Node3};
\node(nd4)[object, below of=nd3]{\makecell[c]{Node4}};
\node(end)[startstop, below of=nd4]{End};
\draw[arrow](start)--(nd1);
\draw[arrow](nd1)--(nd2);
\draw[arrow](nd2)--(nd3);
\draw[arrow](nd3)--(nd4);
\draw[arrow](nd4)--(end);
\end{tikzpicture}
\caption{Some text describing the figure}
\end{wrapfigure}
% Same as before
Wrapping the figure as shown in Overleaf does not work if the full width is desired. It also behaves funky on the end and starts of documents.

The figures do not have to be exactly in the places they are called but within the same page or thereabouts is also acceptable. Any solution is greatly appreciated.


tikzitwhich I don't find in the official TeX Live packages – Ivan Apr 25 '21 at 16:04\rule{\linewidth}{.5\textheight}as example image for a minimal (single) example . BTW, I would start staying with a truetwocolumndocument instead ofmulticol, and true standardfigurefloats instead of fake (non-floating) figure environments. – Fran Apr 25 '21 at 16:34\flushbottomso if you add non-floating large figures and specify teh baseline of the last line must be at the bottom, you force latex to stretch. Use \raggedbottom` if you want figures like that. (you could have made an example with just a few lines of text) – David Carlisle Apr 25 '21 at 16:58tikzitand all other unnecessary packages. Note: The problem is not present for small documents, small figures, or when a single large figure is used. It only appears when large figures are in proximity to each other with texts in between. I apologize for the sample code being too big. I'll try to make a smaller example. The reason I had included all the packages incase if there were package conflicts the community was aware of. I've had that happen to me and it took a long time to debug. As fortwocolumnI have other figures that cause issues with a strict two column document. – Rashiq Apr 25 '21 at 18:48