Simple solution to wrap a paragraph around a box flushed to the right (or left) margin, and aligned at the top with the start of the paragraph. No other packages were needed.
To automate the procedure, the command \InsertBox was defined, with 4 parameters.
\InsertBox[<l or r (default} >]{<box content>}{<box width>}{<text to be shaped>}
- (optional) where to place the box in the text area:
r or l
(r,right, is the default);
- content of the box (it is not a float!);
- desired box width;
- paragraph to be shaped.
Everything else follows from them.
The lines to do the formatting of the shape are generated using the macro \newparshape taken from condensed-version-of-parshape
UPDATE After Peter Wilson's comment.
Now \parindent can take any value, so the starting of the paragraphs are clear.
So far it won't behave properly on page breaks.



\documentclass{article}
\usepackage{kantlipsum}% dummy text
\usepackage{graphicx}% insert figures
%***************************************************************************************************
\newlength{\AboveSkipbox}
\setlength{\AboveSkipbox}{0.7\baselineskip} % above space <<<<
\newlength{\Sidesepbox}
\setlength{\Sidesepbox}{1.5em} % side space <<<
\newlength{\BoxHeight}
\newlength{\ParHeight}
\newlength{\FirstIndent}
\newlength{\FigureBoxWidth}
\newlength{\FigIndent}
\newsavebox{\mybox}
\newsavebox{\tmpbox}
%% From https://tex.stackexchange.com/questions/127504/more-condensed-version-of-parshape
\makeatletter
\let\SavedIndent\parindent
\let@afterindentfalse@afterindenttrue
@afterindenttrue
\def\newparshape{\parshape@npshape0{}}
\def@npshape#1#2#3{\ifx\#3\expandafter@@@npshape\else\expandafter@@npshape\fi
{#1}{#2}{#3}}
\def@@npshape#1#2#3#4#5{%
\ifnum#3>\z@\expandafter@firstoftwo\else\expandafter@secondoftwo\fi
{\expandafter@@npshape\expandafter{\the\numexpr#1+1\relax}{#2 #4 #5}{\numexpr#3-1\relax}{#4}{#5}}%
{@npshape{#1}{#2}}}
\def@@@npshape#1#2#3{#1 #2}
\def\SetFirstIndent{\if@afterindent\FirstIndent\SavedIndent\else\FirstIndent\z@\fi}
\makeatother
\newcommand{\nlines}[1]{\the\numexpr#1/\baselineskip +1 \relax}
\newcommand{\TypesetBox}[1]{\makebox[\linewidth][#1]{\raisebox{\dimexpr-\ht\mybox-\AboveSkipbox\relax}[0pt][0pt]{\usebox{\mybox}}}}
\newcommand{\TypesetTextShortLong}[1]{%
\hspace*{\parindent}
\ifdim\dimexpr\ht\tmpbox+\dp\tmpbox<\dimexpr\ht\mybox+\dp\mybox+2\baselineskip\relax%short
\hspace{-\parindent}\usebox{\tmpbox}\vspace{\dimexpr\ht\mybox+\dp\mybox+\AboveSkipbox-\ht\tmpbox-\dp\tmpbox\relax}
\else%long
#1\fi
}
\newcommand{\MakeFigureSpace}[1]{%
\ifx#1l% left
\setlength{\FigIndent}{\FigureBoxWidth}
\else% right
\setlength{\FigIndent}{0pt}
\fi
}
\newcommand{\InsertBox}[4][r]{%
\SetFirstIndent%
\setlength{\FigureBoxWidth}{\dimexpr#3+\Sidesepbox\relax}
\sbox{\tmpbox}{\parbox[t]{\dimexpr\linewidth-\FigureBoxWidth\relax}{\hspace{\FirstIndent}#4}}
\sbox{\mybox}{\fbox{\parbox{#3}{#2}}}%
\MakeFigureSpace{#1}% Figure Indent = \parindent or Fig Box width
\vspace{-\baselineskip}
\hspace{\dimexpr-\FigIndent-\parindent\relax}\TypesetBox{#1}
\newparshape% shape paragraph text
{\nlines{\dimexpr\ht\mybox+\dp\mybox+\baselineskip\relax}}{\FigIndent}{\dimexpr\linewidth-\FigureBoxWidth\relax}%
{1}{0pt}{\linewidth}\
\TypesetTextShortLong{#4}
}
%***************************************************************************************************
\begin{document}
\InsertBox{It is not a floating \\ \\ \\ \\ frame}{0.5\textwidth}{\kant[2]}
\kant[9]
\InsertBox{\bfseries \large As I have shown elsewhere, Aristotle tells
us that the objects in space and time, in the full sense of these
terms, would be falsified.}{0.4\textwidth}{\kant[4]}
\newpage
\section*{Right side}
\noindent \kant[9]
\InsertBox{\centering\includegraphics[scale=0.35]{example-image}}{0.35\textwidth}{\kant[9]}
\section*{Left side}
\InsertBox[l]{\centering\includegraphics[scale=0.4]{example-image}}{0.4\textwidth}{\kant[9]}
\newpage
\section*{Right side, short paragraph}
\noindent \kant[9]
\InsertBox{\centering\includegraphics[scale=0.4]{example-image}}{0.4\textwidth}{As any dedicated reader can clearly see, the Ideal of
practical reason is a representation of, as far as I know, the things
in themselves; as I have shown elsewhere, the phenomena should only be
used as a canon for our understanding. }
\kant[9]
\section*{Left side, short paragraph}
\InsertBox[l]{\centering\includegraphics[scale=0.4]{example-image}}{0.4\textwidth}{As any dedicated reader can clearly see, the Ideal of
practical reason is a representation of, as far as I know, the things
in themselves; as I have shown elsewhere, the phenomena should only be
used as a canon for our understanding.}
\kant[9]
\end{document}
insboxoverwrapfig. – Skillmon Nov 11 '21 at 18:16\InsertBoxRcommand, from theinsboxplain TeX macros package. – Bernard Nov 11 '21 at 18:23\raisebox{\dimexpr-\height+\ht\strutbox}. – Ulrike Fischer Nov 11 '21 at 18:32wrapfigthan just incompatibility with lists. – Alexey Nov 11 '21 at 19:21texdoc insboxbut got a document calleddemo.pdfwhich spoke vaguely about things like\InsertBoxRbut no real help about the package. How do I get the package's manual? – Peter Wilson Nov 12 '21 at 18:37wrapfig? You can always insert a package's (pack) code into your document's preamble and then not\usepackage{pack}. – Peter Wilson Nov 13 '21 at 19:48wrapfigbehaves more like a bug than like a package. – Alexey Nov 14 '21 at 09:35