TeX - LaTeX Asked on June 26, 2021
When using latex to write pseudo-code, using loops in the function, the vertical line position is wrong.
usepackage[ruled,lined]{algorithm2e}
usepackage{algorithmicx}
usepackage{algpseudocode}
begin{document}
begin{algorithm} [t]
begin{algorithmic}
Function{victim_func1}{a}
eIf{sec[i]}{
A
}{
B
}
EndFunction
end{algorithmic}
end{algorithm}
end{document}
The vertical line on the left should belong to if-else, but the position is wrong. How can I solve it? Thank you!
algorithm2e
provides a function
environment. You can set the name of the function with caption
(no underscores allowed!):
documentclass{article}
usepackage[ruled,lined]{algorithm2e}
begin{document}
begin{function}caption{VictimFunc1(a)}
eIf{sec[i]}{
A
}{
B
}
end{function}
end{document}
Correct answer by DG' on June 26, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP