Graphics, Figures & Tablesorientation of figure and text

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
bhuyantrinanda1212
Posts: 2
Joined: Thu May 18, 2023 11:51 am

orientation of figure and text

Post by bhuyantrinanda1212 »

How to obtain the image in the right and the text in left as in the attachment.
The figure has been drawn using tikzpicture. I do not know how to put the image in the right and text in the
left. The sentences under emurate should be on the left and the figure on the right.

Code: Select all

\documentclass[]{report}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{physics}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{float}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{tikz}
\usepackage{wrapfig}
\usetikzlibrary{shapes.geometric, arrows.meta}
\tikzstyle{startstop} = [circle, radius=6cm, text centered, draw=black, fill=red!30]
\tikzstyle{arrow} = [thick,->,>=stealth]

\begin{document}
\begin{figure}[H]
    \centering
    \begin{tikzpicture}[node distance=1.5cm]
        \node (start) [startstop] {5};
        \node (second) [startstop, below of=start] {16};
        \node (third) [startstop, below of=second] {8};
        \node (fourth) [startstop, below of=third] {4};
        \node (fifth) [startstop, below of=fourth] {2};
        \node (sixth) [startstop, below of=fifth] {1};
        \draw [arrow] (start) -- node[anchor=east] {$3n+1$} (second);
        \draw [arrow] (second) -- node[anchor=east] {$n/2$}(third);
        \draw [arrow] (third) -- node[anchor=east] {$n/2$}(fourth);
        \draw [arrow] (fourth) -- node[anchor=east] {$n/2$} (fifth);
        \draw [arrow] (fifth) -- node[anchor=east] {$n/2$} (sixth);
        \draw[arrow] (sixth.east) edge[bend right=50] node[anchor=west] {$3n+1$} (fifth.east);
    \end{tikzpicture}
    \caption{ The problem of $3n+1$ for the number 5}
    \label{fig:3n-1_5}
\end{figure}

\begin{enumerate}
    \item $n=5$ is odd, so multiply it by 3 and add 1 to get $n=16$.
    \item $n=16$ is even, so divide it by 2 to get $n=8$.
    \item $n=8$ is even, so divide it by 2 to get $n=4$.
	\item $n=4$ is even, so divide it by 2 to get $n=2$.
    \item $n=2$ is even, so divide it by 2 to get $n=1$.
\end{enumerate}

\end{document}[
Attachments
Screenshot (226).png
Screenshot (226).png (212.95 KiB) Viewed 2114 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply