3
votes
2answers
38 views

break an long line in an algorithm

I have a long line in an algorithm and want to break it into two lines. For similar case in equations, split can be used. How do I do this within an algorithm? \documentclass{article} ...
4
votes
1answer
59 views

How to make a hbox several lines under the specified place?

Recently I asked How to colourfuly highlight some lines of an algorithm using algorithm2e? I wanted to acheive this effect using the algorithm2e package: Thanks to JLDiaz's answer I know how to do ...
2
votes
1answer
60 views

How to manage long lines of inputs in function declaration, or inside the code, in clrscode3e

This is a part of my code: \begin{codebox} \Procname{$\proc{\textbf{Connect_two_SamplePoints}}(Graph,S1, S2,connectionCostMat,cost)$} \li \Comment S1 and S2 are sample points \li cost[S1][S2] $=$ ...
8
votes
2answers
297 views

How to automatically keep the indentation level when a line has to be broken

I'm using the algpseudocode package with two custom commands, \Let and \LongState to handle automatic indentation of (broken) long lines in the spirit of Werner's answer, which uses \parbox to wrap ...
1
vote
1answer
225 views

Algorithm code width problem

I have a problem in the width of the algorithm which I wrote as shown below, and I need to write it in a better way but I can't, any help? This is my code: \begin{algorithmic} \WHILE{$GenC[i] ...
3
votes
1answer
373 views

How to remove newline character after case statement in algorithm2e?

I don't want any newline character after case statement. How can I do that? This is my code: \begin{algorithm}[t] \SetInd{0.5em}{0.5em} \KwIn{Data $\mathsf{D}$} \KwOut{List of Simple Hints} ...
8
votes
1answer
2k views

Adjust the indentation whithin the algorithmicx-package when a line is broken

I have this code \documentclass{article} \usepackage{algorithm} \usepackage{algpseudocode} \begin{document} \begin{algorithm} \caption{Minimal Working Example for my Problem} ...
3
votes
1answer
598 views

Pseudocode overflow out of column

I am writing pseudocode using the algorithmicx package in IEEEtran class (double column). My problem is, some of the statement in the code are quite long which I expected to wrap to next line. ...
1
vote
1answer
506 views

Algorithmic package for loop and comment at the same line

I want to have the following output using algorithmic package: for i = 1 : z do // number of rows x = 1 end for I use the following tex code: \begin{algorithmic} \FOR{$p=1:r$} // number of ...
2
votes
1answer
2k views

Loop conditions in multiple lines using algorithmic package

I am working on a paper in double-column format, and I am using the algorithmic package to typeset my algorithms. One of my while loops' condition is a bit long hence doesn't fit into the column. ...
15
votes
3answers
7k views

Include a line break in algorithmic while maintaining indentation

I have this code: \DeclareCaptionFormat{algor}{% \hrulefill\par\offinterlineskip\vskip1pt% \textbf{#1#2}#3\offinterlineskip\hrulefill} ...
8
votes
1answer
1k views

How to print in algorithmic package for some If condition or For loop in one line?

How to print \FOR{$j:=0,\ldots,i-1$} \STATE{$\C_{ij}:=\C_{ii}\cdot\C_{ij}$}; \ENDFOR in one line instead of two line?