Skip to main content

Questions tagged [algorithms]

{algorithms} is about the presentation, numbering, and layout of algorithms or pseudocode in documents. Popular packages are algorithms, {algorithmicx}, {algorithm2e} and {listings}. For questions about the specific package, use the appropriate tag instead.

3 votes
0 answers
38 views

\documentclass{article} \usepackage{amsmath} \usepackage[nothing, ruled]{algorithm} \usepackage[noend]{algpseudocode} \let\Algorithm\algorithm \renewcommand\thealgorithm{} \newcommand{\setalgolineno}[...
Johan's user avatar
  • 297
0 votes
0 answers
30 views

I'm trying to write an algorithm. I don't understand what's wrong at the very last equation (line 4:), there is =0 in the end for some reason after [:,perm]. Below is the exact reproducible code along ...
Destr's user avatar
  • 31
6 votes
1 answer
170 views

What I'm trying to do: I'm trying to change the text color of specific lines to highlight them in an algorithmic environment (using algpseudocodex package). \documentclass[12pt]{article} \usepackage{...
M. McIlree's user avatar
1 vote
1 answer
168 views

I am writing the pseudocode with latex.I need to find a way to make multiple lines of require.Basically, I tried to use \\ but it does not work. Please help me do that. Here is my code. \begin{...
Ricky W.'s user avatar
  • 125
0 votes
0 answers
68 views

I have the following problem. I have a relatively long pseudocode, and when I have text before it, either 1) there is a lot of white space, or 2) the text on the previous page is stretched out, or the ...
Iris Der's user avatar
1 vote
1 answer
76 views

I wrote this code: \begin{algorithm} \caption{SBX Operator}\label{alg:sbx} \begin{algorithmic} \State $\eta_{SBX} \gets 5$ \For{i=1:L} \State sample $u \in [0,1]$ ...
David Peña's user avatar
3 votes
1 answer
196 views

I am very new to LaTeX and its surrounding infrastructure. I am trying to write a technical paper on LaTeX using the TikZ package. However, I am finding it difficult to draw the images in the format I ...
Towfiq Ahmed's user avatar
1 vote
2 answers
71 views

I am writing an algorithm where some parts slightly change depending on the variant, but are mostly the same. I have found a very clear way to do this is with side by side lines, colour coded for the ...
spectabilis's user avatar
3 votes
1 answer
80 views

I am writing an article in which I use the algorithm environment. When I put a numbered equation in the algorithm (sorry computer science people), the equation number is not aligned properly. Very ...
seaver's user avatar
  • 595
4 votes
1 answer
268 views

I've noticed an apparent regression when using cleveref to reference lines of algorithms with the combination of algorithm and algcompatible. Below is an example: \documentclass{article} \usepackage{...
Bruno's user avatar
  • 2,203
1 vote
1 answer
58 views

For my course material, I "abuse" the algorithm floats, since my knowledge of LaTeX is too poor to do this "better". I hope you can forgive me for that 😉. (Actually, I'm all doing ...
Stef Pillaert's user avatar
0 votes
1 answer
70 views

can you help me fix the error, also please help me make two algorithm consistent in format (with line number) for the second algorithm I don't know why it render number 0 after update lambda. I'm so ...
jupyter's user avatar
  • 147
1 vote
1 answer
76 views

I am using the algorithmic environment in LaTeX and want to color both the line numbers and the corresponding content of specific lines. Here's the code snippet I'm working on: \Procedure{\writetxn}{$...
Eagle Bear's user avatar
1 vote
2 answers
106 views

We need the box with dotted rules around the algorithm. I tried using \usepackage[boxruled]{algorithm2e}. The rule comes as solid rule instead of dotted what I required. Can you please check and ...
Rajasekar's user avatar
  • 113
2 votes
1 answer
167 views

I am currently working with the algorithmic package and need to modify the output of an algorithm such that each line starts with the word Step followed by the step number. The goal is to have the ...
Vivek Harshey's user avatar

15 30 50 per page
1
2 3 4 5
78