7

I am trying to arrange the image to be on the left of the equations, and I'd be grateful if someone could point me in the right direction. I have tried wrapfig, but I really couldn't manage to integrate it with equations, only text.

enter image description here

Here is the relevant piece of code:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=2cm,top=3cm]{geometry}
\usepackage[nottoc,notlof,notlot]{tocbibind}
\usepackage[titles,subfigure]{tocloft}
 \usepackage{amssymb,amsmath,fancyhdr,graphicx,booktabs,array,paralist,verbatim,subfig,sectsty,mathtools,hyperref,tikz}
\usepackage[long]{datetime}
\usetikzlibrary{decorations.markings}
\geometry{a4paper}
\begin{document}

\begin{center}
\begin{tikzpicture}[arrowmark/.style 2 args={decoration={markings,mark=at     position #1 with \arrow{#2}}}] 
 \draw[-latex] (-0.5,0) -- (3,0)node[right]{$x$};
 \draw[-latex] (0,-0.5) -- (0,3)node[above]{$y$};
 \filldraw[fill=gray] ({0.4*sqrt(5)},{0.2*sqrt(5)}) arc [radius=1, start     angle=atan(0.5), delta angle=atan(2)-atan(0.5)]
                           -- ({0.4*sqrt(5)},{0.8*sqrt(5)}) arc [radius=2,     start angle=atan(2), delta angle=-atan(2)+atan(0.5)]
                           -- cycle;
 \draw[dashed] (0,0) -- (1.5,3)node[right] {$y=\frac{x}{a}$};
 \draw[dashed] (0,0) -- (3,1.5)node[right] {$y=ax$};
 \draw (1,0) arc (0:90:1cm); 
 \draw (2,0) arc (0:90:2cm); 
 \node [font=\small] [below] at (-0.1,1.24) {1};
 \node [font=\small] [below] at (-0.1,2.24) {2};
 \draw[<-,rotate=45] (2.1,0) -- +(0.5,0) node[anchor=west,pos=0.7,above right]    {$\partial S$};   
 \draw[thick,postaction={decorate}, arrowmark={0.09}{<},arrowmark={0.3}{<},     arrowmark={0.7}{<},arrowmark={0.5}{<},arrowmark={.875}{<}
    ]  ({0.4*sqrt(5)},{0.2*sqrt(5)}) arc [radius=1, start angle=atan(0.5),     delta angle=atan(2)-atan(0.5)]
                           -- ({0.4*sqrt(5)},{0.8*sqrt(5)}) arc [radius=2,     start angle=atan(2), delta angle=-atan(2)+atan(0.5)]
                  -- cycle;
\end{tikzpicture}
\end{center}
\begin{equation*}
\begin{aligned}[c]
\text{The lower line:}& ~~\textbf{r}_1(t)=(t,at) \text{ for } t \in     \bigg{[}\frac{1}{\sqrt{1+a^2}},\frac{2}{\sqrt{1+a^2}}\bigg{]}\\
\text{The outer circle:}& ~~\textbf{r}_2(t)=(2\cos t,2\sin t) \text{ for }  t     \in \bigg{[}\arctan{a},\arctan{\frac{1}{a}}\bigg{]}\\
\text{The upper line:}&~~\textbf{r}_3(t)=(at,t) \text{ for } t \in \bigg{[}\frac{1}{\sqrt{1+a^2}},\frac{2}{\sqrt{1+a^2}}\bigg{]}\\
\text{The inner circle:}&~~\textbf{r}_4(t)=(\cos t,-\sin t) \text{ for } t \in     \bigg{[}-\arctan{\frac{1}{a}},-\arctan{a}\bigg{]}
\end{aligned}
\end{equation*}
\end{document}

1 Answers1

6

You can use minipages:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=2cm,top=3cm]{geometry}
\usepackage[nottoc,notlof,notlot]{tocbibind}
\usepackage[titles,subfigure]{tocloft}
 \usepackage{showframe,amssymb,amsmath,fancyhdr,graphicx,booktabs,array,paralist,verbatim,subfig,sectsty,mathtools,hyperref,tikz}
\usepackage[long]{datetime}
\usetikzlibrary{decorations.markings}
\geometry{a4paper}
\begin{document}
\noindent
\begin{minipage}{0.3\textwidth}
\centering
\begin{tikzpicture}[arrowmark/.style 2 args={decoration={markings,mark=at     position #1 with \arrow{#2}}}]
 \draw[-latex] (-0.5,0) -- (3,0)node[right]{$x$};
 \draw[-latex] (0,-0.5) -- (0,3)node[above]{$y$};
 \filldraw[fill=gray] ({0.4*sqrt(5)},{0.2*sqrt(5)}) arc [radius=1, start     angle=atan(0.5), delta angle=atan(2)-atan(0.5)]
                           -- ({0.4*sqrt(5)},{0.8*sqrt(5)}) arc [radius=2,     start angle=atan(2), delta angle=-atan(2)+atan(0.5)]
                           -- cycle;
 \draw[dashed] (0,0) -- (1.5,3)node[right] {$y=\frac{x}{a}$};
 \draw[dashed] (0,0) -- (3,1.5)node[right] {$y=ax$};
 \draw (1,0) arc (0:90:1cm);
 \draw (2,0) arc (0:90:2cm);
 \node [font=\small] [below] at (-0.1,1.24) {1};
 \node [font=\small] [below] at (-0.1,2.24) {2};
 \draw[<-,rotate=45] (2.1,0) -- +(0.5,0) node[anchor=west,pos=0.7,above right]    {$\partial S$};
 \draw[thick,postaction={decorate}, arrowmark={0.09}{<},arrowmark={0.3}{<},     arrowmark={0.7}{<},arrowmark={0.5}{<},arrowmark={.875}{<}
    ]  ({0.4*sqrt(5)},{0.2*sqrt(5)}) arc [radius=1, start angle=atan(0.5),     delta angle=atan(2)-atan(0.5)]
                           -- ({0.4*sqrt(5)},{0.8*sqrt(5)}) arc [radius=2,     start angle=atan(2), delta angle=-atan(2)+atan(0.5)]
                  -- cycle;
\end{tikzpicture}
\end{minipage}%
\begin{minipage}{0.7\textwidth}
\begin{equation*}
\begin{aligned}[c]
\text{The lower line:}& ~~\textbf{r}_1(t)=(t,at) \text{ for } t \in     \bigg{[}\frac{1}{\sqrt{1+a^2}},\frac{2}{\sqrt{1+a^2}}\bigg{]}\\
\text{The outer circle:}& ~~\textbf{r}_2(t)=(2\cos t,2\sin t) \text{ for }  t     \in \bigg{[}\arctan{a},\arctan{\frac{1}{a}}\bigg{]}\\
\text{The upper line:}&~~\textbf{r}_3(t)=(at,t) \text{ for } t \in \bigg{[}\frac{1}{\sqrt{1+a^2}},\frac{2}{\sqrt{1+a^2}}\bigg{]}\\
\text{The inner circle:}&~~\textbf{r}_4(t)=(\cos t,-\sin t) \text{ for } t \in     \bigg{[}-\arctan{\frac{1}{a}},-\arctan{a}\bigg{]}
\end{aligned}
\end{equation*}
\end{minipage}
\end{document}

enter image description here

If you don't want to find out the widths by yourself, use tabularx:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=2cm,top=3cm]{geometry}
\usepackage[nottoc,notlof,notlot]{tocbibind}
\usepackage[titles,subfigure]{tocloft}
 \usepackage{showframe,amssymb,amsmath,fancyhdr,graphicx,booktabs,array,paralist,verbatim,subfig,sectsty,mathtools,hyperref,tikz}
\usepackage[long]{datetime}
\usetikzlibrary{decorations.markings}
\geometry{a4paper}
\usepackage{tabularx}
\def\tabularxcolumn#1{b{#1}}
\begin{document}
\begin{tabularx}{\textwidth}{@{}c@{}X@{}}
\begin{tikzpicture}[arrowmark/.style 2 args={decoration={markings,mark=at     position #1 with \arrow{#2}}}]
 \draw[-latex] (-0.5,0) -- (3,0)node[right]{$x$};
 \draw[-latex] (0,-0.5) -- (0,3)node[above]{$y$};
 \filldraw[fill=gray] ({0.4*sqrt(5)},{0.2*sqrt(5)}) arc [radius=1, start     angle=atan(0.5), delta angle=atan(2)-atan(0.5)]
                           -- ({0.4*sqrt(5)},{0.8*sqrt(5)}) arc [radius=2,     start angle=atan(2), delta angle=-atan(2)+atan(0.5)]
                           -- cycle;
 \draw[dashed] (0,0) -- (1.5,3)node[right] {$y=\frac{x}{a}$};
 \draw[dashed] (0,0) -- (3,1.5)node[right] {$y=ax$};
 \draw (1,0) arc (0:90:1cm);
 \draw (2,0) arc (0:90:2cm);
 \node [font=\small] [below] at (-0.1,1.24) {1};
 \node [font=\small] [below] at (-0.1,2.24) {2};
 \draw[<-,rotate=45] (2.1,0) -- +(0.5,0) node[anchor=west,pos=0.7,above right]    {$\partial S$};
 \draw[thick,postaction={decorate}, arrowmark={0.09}{<},arrowmark={0.3}{<},     arrowmark={0.7}{<},arrowmark={0.5}{<},arrowmark={.875}{<}
    ]  ({0.4*sqrt(5)},{0.2*sqrt(5)}) arc [radius=1, start angle=atan(0.5),     delta angle=atan(2)-atan(0.5)]
                           -- ({0.4*sqrt(5)},{0.8*sqrt(5)}) arc [radius=2,     start angle=atan(2), delta angle=-atan(2)+atan(0.5)]
                  -- cycle;
\end{tikzpicture}
&
\begin{equation*}
\begin{aligned}[c]
\text{The lower line:}& ~~\textbf{r}_1(t)=(t,at) \text{ for } t \in     \bigg{[}\frac{1}{\sqrt{1+a^2}},\frac{2}{\sqrt{1+a^2}}\bigg{]}\\
\text{The outer circle:}& ~~\textbf{r}_2(t)=(2\cos t,2\sin t) \text{ for }  t     \in \bigg{[}\arctan{a},\arctan{\frac{1}{a}}\bigg{]}\\
\text{The upper line:}&~~\textbf{r}_3(t)=(at,t) \text{ for } t \in \bigg{[}\frac{1}{\sqrt{1+a^2}},\frac{2}{\sqrt{1+a^2}}\bigg{]}\\
\text{The inner circle:}&~~\textbf{r}_4(t)=(\cos t,-\sin t) \text{ for } t \in     \bigg{[}-\arctan{\frac{1}{a}},-\arctan{a}\bigg{]}
\end{aligned}
\end{equation*}
\end{tabularx}
\end{document}

note that showframe package is used only for demonstration. Don't use it in your actual case.