May I suggest an alternative. Use algorithmic
package where you can find more information here Algorithms. Two images are generated: one from your code, the other is an example based on OP image.
\documentclass[10pt,a4paper]{article}
\usepackage{algorithmic}
\usepackage{algorithm}
\begin{document}
% Your code
\noindent\rule[0.5ex]{\linewidth}{1pt}
Algorithm Use iteration to find general solution
\noindent\rule[0.5ex]{\linewidth}{1pt}
factor $a$,$b$
$y=a+bx$
\noindent\rule[0.5ex]{\linewidth}{1pt}
% alternative
\begin{algorithm}
\caption{Use iteration to find the general solution of the ODE in Example 1.4}\label{abc}
\begin{algorithmic}[1]
\STATE factor \textbf{a,b};
\STATE {\textbf {y:=a+b*x}};
\FOR {\textbf{n:=1:4 do write}}
\STATE {\textbf{y:=a+b*x-int(int(y,x),x)}}
\ENDFOR
\end{algorithmic}
\end{algorithm}
\end{document}
You can use the angles
library which defines a pic
for this purpose. The quotes
library is used for ease of labelling.
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{calc,patterns,angles,quotes}
\begin{document}
\begin{tikzpicture}
\coordinate (origo) at (0,0);
\coordinate (pivot) at (1,5);
% draw axes
\fill[black] (origo) circle (0.05);
\draw[thick,gray,->] (origo) -- ++(4,0) node[black,right] {$x$};
\draw[thick,gray,->] (origo) -- ++(0,-4) node (mary) [black,below] {$y$};
% draw roof
\fill[pattern = north east lines] ($ (origo) + (-1,0) $) rectangle ($ (origo) + (1,0.5) $);
\draw[thick] ($ (origo) + (-1,0) $) -- ($ (origo) + (1,0) $);
\draw[thick] (origo) -- ++(300:3) coordinate (bob);
\fill (bob) circle (0.2);
\pic [draw, ->, "$\theta$", angle eccentricity=1.5] {angle = mary--origo--bob};
\end{tikzpicture}
\end{document}
If you want the angle in red with two-way arrows, just modify the last line:
\pic [draw=red, <->, "$\theta$", angle eccentricity=1.5] {angle = mary--origo--bob};
EDIT (Respond to query in comments)
To change the colour of the label as well, just set the text
key:
\pic [draw=red, text=blue, <->, "$\theta$", angle eccentricity=1.5] {angle = mary--origo--bob};
Best Answer
May be some thing like this:
If you don't mind using
tikz
, you may usematrix
library oftikz
and draw the lines in any way you like. This method is highly versatile.