{pseudocode} is a compact and informal description of a computer programming algorithm.

learn more… | top users | synonyms

1
vote
1answer
34 views

Genetic Algorithm pseudocode

Hi everyone, this is my first post, so apologise if not doing it properly. I need the following GA pseudocode (Photo) in LaTex, but couldn't do it very well. I really appreciate your help.
1
vote
0answers
30 views

Automatic line break in writing pseudo-code using algorithm package

I am going to write a pseudo-code using the algorithm package. Everything is fine, however, I am not able to automatically break lines and you see what happens in the picture below: I am wondering ...
2
votes
1answer
34 views

Writting Pseudocode by using package algorithmic

I have a questions, why give me a clear line at fourth line? Can i delete "statement" end while and end for? \begin{algorithmic} [1] \FOR{$j \gets 0$ \TO $n - 1$ } \STATE{$t \gets A[j]$ \STATE ...
1
vote
0answers
59 views

What is the pseudocode for strcpy? [closed]

gets(name); strcpy(describe1, "Hello ! :D\n"); strcpy(describe2, "Welcome to travel fun\n\t\t\t\t\t\t\t\t\t- Travelling made special -\n");
2
votes
1answer
26 views

How can I change the layout of comment in a pseudocode?

I'm writing a pseudocode with algorithm package. Now algorithmicx package produce a comment with the triangle on the right of the line which is referred (this is the default layout). I need to change ...
1
vote
0answers
49 views

How to mark line numbers of an algorithm with asterisk?

I'm working with IEEEtran and algorithm2e package. I have a pseudocode with numbered lines. I want to mark some of my line numbers (not the lines themselves) with an asterisk mark. How can I do that? ...
11
votes
2answers
9k views

What is the best looking pseudo code package?

I have stumbled across various pseudo code packages but can't seem to find that's simple and eye-candy and practical. What I'm looking for: Visually attractive structure (eye-candy) ( easy to look ...
4
votes
1answer
4k views

Questions about algpseudocode

I'm using the following packages: \usepackage{algpseudocode} \usepackage{algorithm} but I don't understand what package is algpseudocode, since I can't find the documentation. I have followed this ...
0
votes
0answers
28 views

individual algorithm environment with continuous numbering with normal algorithms

i am searching an algorithm environment in Latex. Im familiar with listings, algorithm and so on. But I want to create smth that looks like this: Initial step. Do the initial step General step. Do ...
1
vote
1answer
34 views

Coloring of @param and @return with Listings

Here is a MWE of what I have, along with a screenshot \documentclass[paper=a4, fontsize=11pt]{scrartcl} \usepackage{color,soul} % For text coloring and highlighting ...
3
votes
1answer
43 views

Repeat block without until (or blank line) using algorithm2e

I'm trying to format a "repeat forever" block using algorithm2e. I've found the \Repeat command but this prints an until at the end of my block. I can hide the word until using: ...
2
votes
1answer
54 views

No spacing between words in the pseudocode package

I am using the pseudocode package for an algorithm. (Here is the documentation: Pseudo Code Package Documentation) There is no spacing between normal text inside the pseudocode block. I have to ...
2
votes
1answer
78 views

Several errors in LaTeX algorithm environment

Hello guys i am new to LaTeX, i have written an algorithm in algorithm environment which is as follows: \documentclass{report} \usepackage{amsmath} \usepackage{algorithm} ...
1
vote
1answer
277 views

Insert Pseudo-Code as Figure

this is my first post on tex.stackexchange, so please forgive any violations on proper question-asking. I'm currently writting a thesis about a project that contains a lot of coding. I would like to ...
0
votes
0answers
78 views

Adding a 'break' command to algpseudocode pseudocode

I want to add a \Break command to algpseudocode, which will display the word 'break' in the same font as 'return' is displayed. I've read the algpseudocode manual, but it only seems to explain how to ...
0
votes
1answer
106 views

Latex pseudo code

I'm thinking to present some pseudocode in an article by using Latex, and ideally I would like to have something similar to what is shown in the figure below. I searched and tried out some packages, ...
80
votes
5answers
55k views

What is a good package for displaying algorithms?

I found this page with some examples: http://en.wikibooks.org/wiki/LaTeX/Algorithms_and_Pseudocode I'm wondering which one to use. Any suggestions? I'm using other packages too so whichever is less ...
4
votes
1answer
70 views

Program package confliction

I want to write pseudo-codes in my survey using program package. Since I'm writing in other languages rather than English, I have to alter the names of those environments, like theorem and proof, etc ...
3
votes
2answers
71 views

Forcing algorithm2e to typeset using Times New Roman

I am writing a book using a sans serif font, and I have a need for typesetting pseudocode. The pseudocode, however, is typeset with sans serif font as well, yet I need the Times New Roman for that ...
2
votes
0answers
100 views

How to write the signature of a method in LaTex?

I'm writing an article in LaTex about programming and I need to write the signature of a C++ method using a specific format, only the statement of the method, not the body. for example: void ...
11
votes
1answer
25k views

do-while loop in pseudo code

The algorithmic package lets me make a while loop as \begin{algorithmic} \While{$u\neq v$} \State Something \EndWhile \end{algorithmic} which results in a while(u is not v) do ...
0
votes
1answer
92 views

Custom pseudocode style

I want to write a custom pseudocode in latex in a similar style as the exemple below: . I didn't manage to get what I want using existing pseudocode package, is there another way to get this kind of ...
1
vote
1answer
260 views

(WYSIWYG) tools for typesetting pseudocode in LaTeX? [closed]

Is there a simple tool (preferably WYSIWYG) that can be used to create pseudocode for LaTex documents?
10
votes
2answers
5k views

Which package to use for writing algorithms?

I am looking for a package that will allow me to write pseudocode of algorithms. The pseudocode may include mathematical symbols, like \forall, \in and subscripts. But I would like also to "talk" ...
5
votes
1answer
2k views

Problems with \EndIf and \EndFor

I'm using the algpseudocode package and I want to write a pseudocode. This is my code \documentclass[conference]{IEEEtran} \usepackage[spanish, es-tabla]{babel} \usepackage{graphicx, times, amsmath, ...
1
vote
0answers
126 views

Expression-oriented pseudo code [closed]

I'm looking for a package that lets me write pseudocode in an expression-oriented way. Expression-oriented is a programming style that heavily uses expressions, as opposed to statements. Functional ...
0
votes
1answer
53 views

Replicate pseudocode

I was looking for some LaTeX code to replicate the result shown on the image below. This image is taken from the book "Temporal Verification of Reactive Systems - safety"
3
votes
1answer
234 views

Package to use for documenting a struct

There exists a number of pseudo-code packages for LaTeX. Can any of these describe things like a linked-list node in C: struct Node { Node* parent; // other stuff }; or do I have to invent ...
22
votes
3answers
824 views

How to write pseudocode similar to code presented in “Beautiful Code” by J. R. Heard

I came across an astonishing piece of text, which is called "Beautiful Code, Compelling Evidence" by J. R. Heard. I was wondering if there is a package or something that allows me to present my code ...
2
votes
1answer
111 views

Bigger rows with fractions in pseudocode

I had previous question how to write pseudocode in latex. I would like to use fractions in pseudocode, but rows with fractions are a little small. Anybody know how to make rows with fractions a little ...
1
vote
1answer
387 views

Define function in pseudocode

Could you help me please how can I write a piece of pseudocode with function in latex? \begin{algorithmic} \STATE $\mathrm{maxWeight} \leftarrow \mathrm{value of e.weight where e has maximum ...
16
votes
1answer
91k views

How to write a not equal to sign in Latex pseudocode

How do I write not equal to sign (equivalent of != in C) in Latex pseudocode.
5
votes
1answer
10k views

How to format a pseudocode algorithm

I would like to know how to format a pseudocode algorithm like the one shown in the picture below. I would like to see an example of Tex/Latex code that would mimic the style, formatting and design of ...
0
votes
0answers
222 views

Including Mathematica Code, in book type document

I want to include some Mathematica code in my tex file. For that I'm using this solution. As an example: \documentclass[12pt,a4paper]{book} \usepackage{graphicx} \usepackage{bm} ...
1
vote
1answer
88 views

How to make my comments in the code grey in the latex doc?

I have to insert some mathematica code in my latex document. For that, I'm using the answer given here by user Ronny. Is it possible to add sth that would make my comments look grey in the resulting ...
1
vote
1answer
714 views

Pseudo code algorithm not showing in a frame

I am using this code to show a pseudocode: \usepackage{algorithm2e} ... \begin{algorithm}[H] \SetAlgoLined \KwResult{Write here the result } initialization\; \While{While condition}{ ...
4
votes
1answer
6k views

do-while loop in algorithm2e

I am using \usepackage[norelsize, linesnumbered, ruled, lined, boxed, commentsnumbered]{algorithm2e} \RestyleAlgo{boxruled} It seems that algorithm2e has the default repeat-until construct. But I ...
1
vote
0answers
546 views

Formatting - Algorithm

I have following pseudocode: I want to write it as an algorithm but not able to format it properly. Following is my attempt: \documentclass{article} \usepackage{algorithm,amsmath,algpseudocode} ...
3
votes
1answer
183 views

Package algorithm

I am using algorithm package in order to create a pseudocode. But I would like to modify the way it appears some lines. Here is my code: \documentclass[twoside,12pt]{book} \usepackage{algorithm} ...
2
votes
2answers
199 views

Complicated Pseudocode in Latex - Need assistance

I am trying to create a complicated pseudocode as shown below: My attempt: \documentclass{article} \usepackage{algorithm}% http://ctan.org/pkg/algorithm \usepackage{algpseudocode}% ...
0
votes
4answers
944 views

Formatting in Latex - Pseudocode [duplicate]

I am trying to create a kind of pseudocode in Latex resembling the one shown below . What I tried is: 1. Convert R to a binary region using the threshold $\theta_{0}$\\ 2. Assume N is the sum of ...
0
votes
1answer
198 views

Package algorithmicx choking on line numbers

I'm trying to compile the code from this answer: http://tex.stackexchange.com/a/1376/35161 I keep getting the following error: ! Undefined control sequence. \ALG@cmd@2@alglinenumber ...size ...
5
votes
3answers
350 views

How can I get straight quotes in pseudocode?

The quotes in pseudocode currently look like this: How can I get quotes that look more like a programming environment and less as if I just typed it with MS Word? MWE \documentclass{article} ...
2
votes
1answer
551 views

Beginner: problems with algorithmic, some commands not available?

I am a real beginner in latex, and now I am struggling with using the algorithm package and algpseudocode to write some code. What I did until now is: \usepackage{algorithm} ...
1
vote
1answer
281 views

Changing indentation of pseudocode including line numbers with algorithm and algorithmic

If I have pseudocode as shown below using the algorithm and algorithmic packages, is it possible to indent the pseudocode, including the line numbers, so that it lines up with the indentation of the ...
2
votes
1answer
301 views

Problem in Algorithm Code [closed]

I am trying to complete my research paper in LaTeX but getting following three errors. I have tried so many things from the internet but to no advantage. Could any one help me please? 1) File ...
4
votes
1answer
957 views

How to define frequently used variables in pseudocode?

To generate the above pseudocode, I used the following code: \begin{algorithm} \caption{sample}\label{sample} \begin{algorithmic}[1] \Require $\mathbf{D} \in \mathbb{R}^{M \times N}$ \State ...
0
votes
0answers
22 views

Latex - after pseudocode =0 is added [duplicate]

I have some problems with using pseudocode in LaTeX. After I build the file =0 is added at the end of the file. Any suggestion how can I fix that? \documentclass{article} ...
1
vote
0answers
135 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 ...
3
votes
3answers
192 views

Help me compile this code

\documentclass{article} \usepackage{amsmath} \usepackage{algorithm2e} \begin{document} \begin{algorithm} \caption{CAS}\label{CAS} {$\sum^{N_{C}}_{i=1}$$L_C$} $\gets$ position of ...