Example: quiz answers

algorithm2e.sty | package for algorithms - CTAN

package for algorithmsrelease (c) 1995-1997 Christophe Fiorio, Tu-Berlin, Germany(c) 1998-2017 Christophe Fiorio, LIRMM, Montpellier University, FranceReport bugs and comments to mailing list for mailing list for discussion July 18 2017 Contents1 Introduction32 How to use it: abstract33 Two more detailed Algorithm disjoint decomposition .. Algorithm: IntervalRestriction ..64 Genericity and example of languages85 Compatibility issues126 Environments defined in the package177 The options of the language option.

1 Introduction Algorithm2e is an environment for writing algorithms in LATEX2e.An algorithm is de ned as a oating object like gures. It provides macros …

Tags:

  Algorithm2e

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of algorithm2e.sty | package for algorithms - CTAN

1 package for algorithmsrelease (c) 1995-1997 Christophe Fiorio, Tu-Berlin, Germany(c) 1998-2017 Christophe Fiorio, LIRMM, Montpellier University, FranceReport bugs and comments to mailing list for mailing list for discussion July 18 2017 Contents1 Introduction32 How to use it: abstract33 Two more detailed Algorithm disjoint decomposition .. Algorithm: IntervalRestriction ..64 Genericity and example of languages85 Compatibility issues126 Environments defined in the package177 The options of the language option.

2 Compatibility issue .. environment display and use .. , ruled, plain environment .. numbering .. and toc .. code typesetting .. of long statements .. display .. keywords .. numbers .. of algorithms ..21 The author is very grateful to David Carlisle, one of the authors of the LaTeX Companion book, for his advices Martin Blais for his suggestions David A. Bader for his new optionnoend Gilles Geeraerts for his new commandSetKwIfElseIf Ricardo Fukasawa for the portuguese keywords Christian Icking for the german translation of keywords Arnaud Giersch for his suggestions and corrections on SetKwComments and the many users as Jean-Baptiste Rouquier for their remarks18 Typesetting219 Commands provided with the global code typesetting commands.

3 Algorithm environment, caption, list of algorithms , .. , title and changind reference of algorithms .. style and layout of algorithm, caption and title .. line numbering .. and numbering lines .. style of lines numbers .. math display .. standard styles .. font shapes and styles .. and title font style .. font standard font shapes and styles .. caption and title font style .. controlling the layout of algorithms .. comments ..3110 The predefined language Input, output .. basic keywords and blocks.

4 Comments .. if-then-else macros .. multiple condition selection: .. loops with end condition test at the beginning .. loops with end condition test at the end .. how default keywords are obtained ..3411 To define your own language to define Input, output .. to define basic keywords or blocks .. to define keywords as function .. to define comments .. to define if-then-else macros .. to define multiple condition selection: .. to define loops with end condition test at the beginning .. to define loops with end condition test at the end.

5 4112 Other language predefined French keywords .. German keywords .. Spanish keywords .. Italian keywords .. Portuguese keywords .. Some Czech keywords ..4913 Known bugs4921 IntroductionAlgorithm2e is an environment for writing algorithms in LATEX2e. An algorithm is defined as afloating object like figures. It provides macros that allow you to create different sorts of key words,thus a set of predefined key words is given. You can also change the typography of the section 3 for two long examples of algorithms written with this can subscribe toalgorithm2e-announcemailing list to receive announcements aboutrevisions of the package and toalgorithm2e-discussionto discuss, send comments, ask questionsabout the package .

6 In order to subscribe to the mailing lists you have to send an email algorithm2e -announce Firstname Nameorsubscribe algorithm2e -discussion Firstname Namein the body of the from one release to the next are indicated in release notes at the beginning of thepackages. For this release ( ), changes are indicated at the end of this How to use it: abstractYou must set\usepackage[options]{ algorithm2e }befo re\begin{document}command. Theavailable options are described in section optional arguments [Hhtbp] works like those of figure environment.

7 TheHargumentforces the algorithm to stay in place. If used, an algorithm is no more a floating object. Caution: algorithms cannot be cut, so if there is not enough place to put an algorithm with H option at agiven spot, LATEX will place a blank and put the algorithm on the following is a quick example1:\begin{algorithm}[H]\SetAlgoLin ed\KwData{this text}\KwResult{how to write algorithm with \LaTeX2e }initialization\;\While{not at end of this document}{read current\;\eIf{understand}{go to next section\;current section becomes this one\;}{go back to the beginning of current section\.}}

8 }}\caption{How to write algorithms }\end{algorithm}1 For longer and more complexe examples see section 33which givesData:this textResult:how to write algorithm with LATEX2einitialization;whilenot at end of this documentdoread current section;ifunderstandthengo to next section;current section becomes this one;elsego back to the beginning of current section;endendAlgorithm 1:How to write algorithmsVery Important: each lineMUSTend with\;only those with a macro beginning a blockshould not end with\;. Note then that you can always use the\;command in math mode to seta small caption works as in a figure environment, except that it should be located at the end ofthe algorithm.

9 It is used by\listofalgorithmsas a reference name for the list of can also use the title macro given with the package , but this macro doesn t insert an entryin the list of Two more detailed examplesThe algorithm 2 and algorithm 3 are written with this Algorithm disjoint decompositionHere we suppose that we have done:\usepackage[linesnumbered,lined,box ed,commentsnumbered]{ algorithm2e }The algorithm 2 was written in LATEX2e code as presented next page. You can label lines, and forexample line 4 denotes the secondFor(see\labelcommand in the example).

10 Notice also someways of doing comments at lines 8, 12, 14 and 16. Star comment commands are for comment onlines of code, else comment is a line by itself as at line 14. The different option in star commentsdefines if it is left (landh) or right justified (randf). The first ones (landr) add ; at the endof line code, the second ones (fandh) doesn t. These last are useful when used in side comment(introduced by()) of alternatives of loops keyword :A bitmapImof sizew loutput:A partition of the bitmap1special treatment of the first line;2fori 2toldo3special treatment of the first element of linei;4forj 2towdo5left FindCompress(Im[i,j 1]);6up FindCompress(Im[i 1,]);7this FindCompress(Im[i,j]);8ifleftcompatible withthisthen// O(left,this)==19ifleft<thisthenUnion(lef t,this);10elseUnion(this,left);11end12if upcompatible withthisthen// O(up,this)==113ifup<thisthenUnion(up,thi s).


Related search queries