Algorithm as figure and without italic and bold formatting?
I want to include an algorithm in my latex document, however without
printing most of it in italic and all the keywords in bold font like it's
done by default by e.g. the algorithmicx package. I like this simple
style:
(screenshot of a part of page 3 of
http://research.microsoft.com/pubs/68869/naacl2k-proc-rev.pdf)
The only thing I'd like to add to this style are line numbers. Can anyone
help me, how I get the formatting of the screenshot and the line numbers?
Thanks :-)
So, here is what I have until now:
\documentclass{article}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{algpascal}
\begin{document}
\alglanguage{pascal}
\begin{algorithm}
\caption{Paull's algorithm}
\begin{algorithmic}[1]
\State Assign an ordering $A_{1}, ..., A_{n}$ to the nonterminals of the
grammar.
\For{i = 1}{n}
\Begin
\For{j = 1}{i-1}
\Begin
\State for each production of the form $A_{i} \rightarrow A_{j} \alpha$
\End
\End
\end{algorithmic}
\end{algorithm}
\end{document}
This ends up as
Based on this I want the following changes:
do and begin shall be on the same line
end shall be vertically aligned to it's associated for (see first
screenshot of this post).
Integration as a figure or at least without a black border and with a
caption below the algorithm would be prefered
bold formatting for keywords should be turned off
No comments:
Post a Comment