1

I am using the algorithmic and algorithm2e package to write the algorithm. I want to use the chapter number in algorithm number. for example for chapter number 3 the first algorithm should be 3.1 and so on. This can be achieved in algorithm package as

\usepackage[chapter]{algorithm}

How to do this for algorithmic and algorithm2e package.

  • 1
    See e.g. here. –  Jun 14 '18 at 04:02
  • @marmot: it worked. you can write it as an answer. Much thanks! – Amarjit Dhillon Jun 14 '18 at 04:11
  • 1
    But this is not my answer. (As long as your problem is solved, it is fine ;-) –  Jun 14 '18 at 04:13
  • This question is much higher quality than the linked one. It contains a minimal reproducible example which clearly relates the problem to someone searching for how to add chapter numbering. The linked answer has multiple packages and package options causing confusion for the simple use-case. – JoshB Jan 04 '24 at 14:35

1 Answers1

2

Problem is solved by using algochapter as shown below.

\usepackage[algochapter]{algorithm2e}