1

The code section is:

\begin{itemize}
\item....
\begin{minipage}[t]{0.7\textwidth}
\includegraphics[width=0.7\textwidth]{Pic/Ciclo cardiaco.png}
\end{minipage}
\item.....
\end{itemize}

I need text on the side.

enter image description here

JamesT
  • 3,169
  • 2
    Welcome to tex.sx. Please extend your code so that it is compilable, beginning with \documentclass and ending with \end{document} so that a potential helper doesn't ave to do any guessing. – barbara beeton Jun 19 '23 at 15:48
  • This looks like a job for wrapfig. See also https://tex.stackexchange.com/questions/669240/latex-wrapfigure/669294?r=SearchResults&s=3%7C16.9111#669294 to put the figure at the top of the column. – John Kormylo Jun 19 '23 at 16:49
  • you don't need minipage \includegraphics[width=0.7\textwidth]{Pic/Ciclo cardiaco.png}hello would put text next to an image – David Carlisle Jun 19 '23 at 16:51

1 Answers1

1

This solution uses tikz to place the side text.

(You don't need to understand tikz code)

The command \InsertImageText{<image name>}{<side text>} places the image and text on its right side.

You can set the width of the image and the width of the text, its font, and its x-y position relative to the center of the right side of the image.

c

\documentclass{article}

\usepackage{graphicx}

\usepackage{kantlipsum} % ONLY for dummy text

%**************************************** added \usepackage{tikz} \newlength{\imageheight} \newlength{\imagewidth} \newlength{\TextWidth} \newlength{\TextXshift} \newlength{\TextYshift} % define the parameters here <<<<<<<<<<<<<<< \setlength{\imagewidth}{0.7\textwidth} % set the image width \newcommand{\TextFont}{\sffamily\small}% set the side text font \setlength{\TextWidth}{0.2\textwidth}% set the width of the side text \setlength{\TextXshift}{2ex}% horizontal shift of the side text \setlength{\TextYshift}{0pt}% vertical shift of the side text

\newcommand{\InsertImageText}[2]{% \InsertImageText{<image name>}{<side text>} \begin{tikzpicture} \node (A)[inner xsep=0pt,inner ysep=2ex] {\includegraphics[width=\imagewidth]{#1}}; \node[% font=\TextFont, align =flush left, text width=\TextWidth, right= \TextXshift, yshift =-\TextYshift, inner sep= 0pt] at (A.east) {#2}; \end{tikzpicture}
} %****************************************

\begin{document} \begin{itemize} \item \textbf{Fase B--C} -- \kant[1]

\InsertImageText{example-image}{As we have already seen, what we have alone been able   to show is that the objects in space and time would be falsified.}

\item \textbf{Fase C--D} -- \kant[2]

\end{itemize}

\end{document}

OPTION

An equivalent result can be achieved using a tabular environment, in this example using the nicematrix package and its convenient \Block command to insert vertically centered content into the tabular cell.

\documentclass{article}

\usepackage{graphicx}

\usepackage{kantlipsum} % ONLY for dummy text

%**************************************** added \usepackage{nicematrix}

\newlength{\imageheight} \newlength{\imagewidth} \newlength{\TextWidth} \newlength{\TextXshift} \newlength{\TextYshift} % define the parameters here <<<<<<<<<<<<<<< \setlength{\imagewidth}{0.7\textwidth} % set the image width \newcommand{\TextFont}{\sffamily\small}% set the side text font \setlength{\TextWidth}{0.2\textwidth}% set the width of the side text \setlength{\TextXshift}{2ex}% horizontal shift of the side text

\newcommand{\InsertImageText}[2]{% \InsertImageText{<image name>}{<side text>} \vspace{2ex}\setlength{\tabcolsep}{0pt} \begin{NiceTabular}{l@{\hspace{\TextXshift}}Wc{\TextWidth}} \Block{1-1}{\includegraphics[width=\imagewidth]{#1}} & \Block[l]{1-1}{\TextFont #2}\ \end{NiceTabular} } %***************************************

\begin{document} \begin{itemize} \item \textbf{Fase B--C} -- \kant[1]

\InsertImageText{example-image}{As we have already seen, what we have alone been able   to show is that the objects in space and time would be falsified.}

\item \textbf{Fase C--D} -- \kant[2]

\end{itemize}

\end{document}

Simon Dispa
  • 39,141