Generalabout Algorithm

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
starnjust
Posts: 2
Joined: Sat Jul 05, 2014 12:58 pm

about Algorithm

Post by starnjust »

Hi.
I have a problem in formatting an algorithm.

How can I generate an algorithm which have the following two features:
1) A title is in the top of the algorithm, not in the bottom;
2) There is no horizontal lines in the algorithm.

I have tried algorithmicx, but it either had three horizontal lines or its tile was at the bottom. When I used pseudocode, it title is in its top and had no such lines, but its title must be a function name with some input parameters, not a title in the form of a sentence.

Could anybody give me some suggestions?

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

about Algorithm

Post by Stefan Kottwitz »

It's actually not algorithmicx that prints the lines. It's the algorithms environment. You can use different styles,
  • plain
  • ruled
  • boxed
by adding them as package option, such as

Code: Select all

\usepackage[boxed]{algorithm}
Furthermore, you could define your own style. Let me know if you still need it.

Stefan
LaTeX.org admin
Post Reply