Reputation
1,783
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
2 14 42
Impact
~91k people reached

Jan
26
comment Incorrect reference to a line in algorithmic using hyperref
Thanks. Unfortunately, your edited answer did not quite work for me: First, it does not print the line number automatically, and second, it does not link to it (rather, it links to the algorithm itself). However, I took your excellent idea of using \phantomsections, and turned it into a working solution. Please check my answer.
Jan
26
answered Incorrect reference to a line in algorithmic using hyperref
Jan
26
comment Incorrect reference to a line in algorithmic using hyperref
Thanks for the quick response. Actually, a \phantomsection helps in jumping to the beginning of the algorithm, but not the specified line. Try adding a few more \States, and add a \label to the last one. You will see that a \ref will print the correct line number, but clicking it does not jump to the right one. (Though we can add a \phantomsection to each referenced line.)
Jan
26
awarded  Investor
Jan
21
revised The scope of LaTeX commands
added 4 characters in body
Jan
20
awarded  Popular Question
Jan
18
accepted Splitting an algorithm across two columns
Jan
18
asked Splitting an algorithm across two columns
Jan
14
comment Linebreak in Package algorithm2e
See also the related question if you want to skip line numbers for manually wrapped lines.
Jan
14
accepted Algorithm2e - Disabling line numbers for specific lines
Jan
13
revised Algorithm2e - Disabling line numbers for specific lines
edited body
Jan
12
asked Algorithm2e - Disabling line numbers for specific lines
Dec
14
awarded  Good Question
Dec
9
accepted algorithm2e: Applying color to an entire line, excluding the line number
Dec
9
asked algorithm2e: Applying color to an entire line, excluding the line number
Nov
15
awarded  Nice Answer
Oct
24
awarded  Famous Question
Oct
21
awarded  Famous Question
Oct
3
awarded  Nice Question
Oct
2
comment How to ensure that 2 couples of figures are on 2 facing pages?
To prevent errors like Output loop---200 consecutive dead cycles, you can increase the maximum dead cycles by inserting something like \maxdeadcycles=1000 in the preamble.