You could specify the algorithm exactly as written between
\begin{verbatim}
my algorithm here
\end{verbatim}
however it does not seem to work here but works fine in TeXnic Center under Windows.
i want to type an algorithm in latex
i have a mac and i am using texshop
i want to display the algorithm as seen in the attachment
do i need to download and install soltware?
please help me type it or explain to me how to load the picture into my paper!
i need a step by step guide here!
thanks in advance
I can not get this to display properly, i kee running into a problem on the bolded line....
can anyone tell me when my "error" is?
\documentclass[11 pt]{article}
\author{Emily}
\title{An Algorithm for Computing Gr\"obner Bases}
\renewcommand{\baselinestretch}{1.5}
\newtheorem{ex}{Example}[section]
\newtheorem{thm}{Theorem}[section]
\newtheorem{deff}{Definition}[section]
\usepackage{algorithm}
\usepackage{algorithmic}
\begin{document}
\maketitle
\section{Algorithm}
\begin{algorithm}
\caption{Buchberger's Algorithm}
\begin{algorithmic}
\REQUIRE A polynomial set $F = \{f_1, \dots ,f_n\}$, that generates an ideal $I $
\ENSURE A Gr\"obner basis $G = \{g_1, \dots , g_t\}$, that generates the same ideal $I$ with $F \subset G$
\STATE $G := F$
\STATE $M := \{f_i, f_j\} | f_i, f_j \in G$ and $f_i \neq f_j\}
\REPEAT
\STATE $\{p, q\} :=$ a pair in $M$
\STATE $M := M – \{\{p, q\}\}$
\STATE $S := Spoly(p, q)$
\STATE $h := NormalForm(S, G)$
\IF{$h \neq 0$}
\STATE $M := M \cup \{\{ g , h \}\} \forall g\in G \}$
\ENDIF
\UNTIL{M=0}
\end{algorithmic}
\end{algorithm}
\end{document}
When LaTeX stops compiling at line it does not mean that there is an error on line , it means that there is an error before line .
You just forgot the closing $ at the end of line #24, two lines before the bolded one.
Code:\STATE $G := F$ \STATE $M := \{f_i, f_j\} | f_i, f_j \in G$ and $f_i \neq f_j\}$ \REPEAT \STATE $\{p, q\} :=$ a pair in $M$