Latex which package for algorithm




















Your pseudocode There are also other layouts, such as: algcompatible fully compatible with the algorithmic package , algpascal aims to create a formatted pascal program, you can transform a pascal program into an algpascal algorithm description with some basic substitution rules. This layout is incomplete. See the example for algorithmicx , it uses the algpseudocode layout. The documentation says: Algorithm2e is an environment for writing algorithms in LaTeX2e. Improve this answer. Augustin Augustin 4, 1 1 gold badge 15 15 silver badges 22 22 bronze badges.

A lovely, detailed answer! Your discussion is very clear about why, and whether, to prefer algorithmicx to algorithmic , but doesn't offer much comparison to algorithm2e.

Is that because you are less familiar with it, because it is well known to be inferior, or something else? Yes, you are right: I am not very familiar with algorithm2e. I think they should offer similar functionality, but I prefer the syntax of algorithmicx.

I edited my answer to make it clear that it is only my subjective preference. Even if you load algorithmicx I understand you still have to load algorithm too?

Extensive answer! For a quick decision it may be helpful to include pictures the compiled outputs for each package — dopexxx. When I read the section about algorithmicx , I didn't immediately get that algpseudocode should also be loaded in order to use the package.

Maybe I'm the only one who experienced that, otherwise it could maybe be added somewhere. Show 4 more comments. That package combines nicely some features e. Mario Mario 4 4 silver badges 12 12 bronze badges. Thanks for sharing. I don't think that algorithm2e is hard to use: it uses a C-like syntax easy to learn. The main drawback of algorithm2e is that it uses floating environments Manuel Kuehner. True, I modified my explanation. Kuehner: Great, thx!

I just removed the quoted forest as I am not referring to a LaTeX package. Sign up or log in Sign up using Google. Sign up using Facebook. The CTAN-manual provides a comprehensible list of examples and full set of controls. More details are in the manual hosted on the ctan website. The algorithmicx package provides a number of popular constructs for algorithm designs. The LaTeX source can be written to a format familiar to programmers so that it is easy to read.

This will not, however, affect the final layout in the document. Note to users who switched from the old algorithmic package: comments may be placed everywhere in the source; there are no limitations as in the old algorithmic package. The algorithmicx package allows you to define your own environments.

To define blocks beginning with a starting command and ending with an ending command, use. In the text the n-th parameter is referenced by n. The program package provides macros for typesetting algorithms. Each line is set in math mode, so all the indentation and spacing is done automatically.

Package page. Package documentation. It is often useful for the algorithm produced by algorithmic to be "floated" to the optimal point in the document to avoid it being split across pages. The legal values for this option are: part, chapter, section, subsection, subsubsection or nothing default. For example:.

When you use figures or tables, you can add a list of them close to the table of contents; the algorithm package provides a similar command. Just put. This is an example taken from the manual official manual, p.

From Wikibooks, open books for an open world. Category : Book:LaTeX. Hidden categories: Pages with dead external links Wikibooks pages with to-do lists. Namespaces Book Discussion. Views Read Edit Edit source View history. Reading room forum Community portal Bulletin Board Help out!

Policies and guidelines Contact us. To do: write more and add some pictures for example code; how to generate pngs?

Previous: Chemical Graphics. Next: Source Code Listings.



0コメント

  • 1000 / 1000