{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.

learn more… | top users | synonyms (1)

2
votes
1answer
76 views

Make the some parts of pseudocode bold

I just want some piece of pseudo code (below) to stand out in my algorithm. So I made the all the keywords (if, end for etc) unbold with \AtBeginEnvironment{algorithmic}{\let\textbf\relax}. Now how ...
0
votes
1answer
28 views

how to insert protocol in Lyx?

I know how to insert "algorithm" in Lyx. But how to insert "protocol" as shown in the following figure?
3
votes
0answers
177 views

Custom text instead of line numbers in algorithmic

In an algorithm using the algorithmic package, I would like to display for some lines a special symbol (e.g. a +), instead of their line number. Is this possible? Edit: Here's a minimal working ...
2
votes
0answers
31 views

Using special characters with lstlisting

I am using the Algorithm2e package to use code in my LaTeX document. However, the code contains special characters such as à, é, è etc. Those characters causes errors such as Unicode character x not ...
2
votes
0answers
213 views

Algorithm keeps appearing on the last page of my latex document

I am writing an algorithm with the algorithmic environment and Latex keeps pushing it on the last page, no matter what I do, this is just a short example. \documentclass[a4paper,10pt, twoside]{book} ...
2
votes
0answers
73 views

How to complete the algorithm using algorithm2e

I wanted to write this flowchart using \usepackage[linesnumbered,ruled,vlined]{algorithm2e} However, I couldn't get what I want, please refer to my code in below \begin{algorithm} ...
2
votes
0answers
76 views

The algorithms' captions appear in the list of abbreviations

I have a problem with the list of abbreviations. The problem is that the algorithms' captions appear in the list of abbreviations! I use the loabbrv package for the abbreviations, and by the command ...
2
votes
0answers
210 views

Divide algorithm inside If EndIf

This is a follow-up question to Option in the algorithm with Latex. This is the code: \begin{document} \begin{algorithm} \caption{My algorithme} \begin{algorithmic}[1] \Donnees: My data ...
1
vote
0answers
6 views

algorithm and controlling comment lines (shifting right or left)

I need to shift a comment to the right. Basically, in the below picture The comment is distracting the pseudocode, therefore, I'm hoping to get the below picture How to shift the comment to ...
1
vote
0answers
38 views

Error with algorithm and algorithmic packages

I have the following problem that involves the algorithm and algorithmic packages with the garamondx font. This is a minimal example: \documentclass[letterpapet,10pt]{article} \usepackage{garamondx} ...
1
vote
0answers
45 views

Too long algorithm

I would like to know how it is to write a long algorithm beyond the edges of a page, knowing I used algorithm and algorithmic packages?
1
vote
0answers
42 views

Creating sub-algorithms

I want to have two algorithms together that I can refer to as 1a and 1b (rather than seperately as Algorithm 1 and 2). So very similar to how subfigures work. Is this possible using any of the ...
1
vote
0answers
202 views

Publication style for Algorithms

I want to make own paragraphs for algorithms by numbering them appropriately. I do not need any fancy things - white background, no borders and black font are ok. I am trying to write in Springer ...
1
vote
0answers
69 views

make latex to automatically choose the placement of algorithms

I have several algorithms written down in a single file and would like latex to spread them across the document to save spaces. For example an algorithm can be just 3 or 4 lines and another can be 20 ...
1
vote
0answers
112 views

Algorithm Environment

I want to write an algorithm into my paper but it is just a pseudocode and none of the fancy if-then loops etc. Instead, I want it to look something like Algorithm 11.1 here: What environment ...
1
vote
0answers
146 views

algorithm2e with RevTex

Note: I have seen the previous answer to this problem here and it doesn't work for my purposes. I suspect that others are in the same boat. I'm writing a paper for which the publisher requires the ...
1
vote
0answers
176 views

Reduce space below an algorithm

I am using the algorithm package for my algorithms in the paper. I find that the space below the algorithm is very large after generating a PDF, so I want to shrink the space. Firstly, I come to add ...
0
votes
0answers
25 views

Is there a nice way to split an algorithm float over multiple pages?

I am using the algorithm float with an lstlisting in it containing the code. Unfortunately, the code is just a little too long to fit on one page. I'd like to keep the layout provided by the ...
0
votes
0answers
10 views

combining pictures and algorithm in two columns document

I tried a lot to prepare such a following format for my paper but it always put algorithm in a separated place. here is \begin{algorithm*}[] \KwIn{$L_1$, $L_2$ } \Return{$F$} ...
0
votes
0answers
14 views

How to write “for” block with counter by Algorithmic package

How can I write a code like below using algorithmic package for (int i = 0; i < node.children; ++i) ..... I can't use foreach or forall because in a point inside the loop I should decrement i ...
0
votes
0answers
13 views

How can I include specific lines of pseudocode from a file?

In my document, I use the listings package to include listings from separate files: \lstinputlisting[firstline=6, lastline=11, firstnumber=6]{myprogram.c} (This shows the lines 6 to 11 from the ...
0
votes
0answers
14 views

Algorithm formatting

\begin{algorithmic} \For{$i,j\gets 0, 255$} \State $j\gets (j + key [i mod keylen] + S[i] ) mod 256$ \EndFor \end{algorithmic} I want to print j= (j + key [i mod keylen]+s[i]) mod 256 My code ...
0
votes
0answers
95 views

Split algorithm over two pages in a loop, algcompatible not working, float env. needed

My question before has been deleted, however the answers suggested are not solving my problem. So I want to split a really long algorithm onto two pages, the thing is, i want also the loop contained ...
0
votes
0answers
68 views

Error trying to align series of equations

I am new to LaTex and I am using TexWorks and PDFLaTeX. This is the following code that I am trying to compile. El Random Fores es muy basico y intuitivo:%$$ \begin{gather} \text{Dado que tienes el ...