Hi there!
I appreciate this forum a lot and it has always been very useful to me. Here is a question I have:
- I am using a one column page.
- I need to write an algorithm (probably using algorithm and/or algorithmic packages) in "two" columns.
- I want only one caption and one label for the whole algorithm. (i.e., it is one algorithm, but written in two columns to save space).
It should look like the following:
--------------------------------------------------------
Algorithm 1 <algorithm caption>
--------------------------------------------------------
1: while(1) cond do 5: blah blah blah
2: blah blah blah 6: end if(2)
3: if(2) cond then 7: end while(1)
4: blah blah blah 8: return
--------------------------------------------------------
Would you help me do that please?
The purpose is to save space in one-column page.
Thank you and best regards!
Math & Science ⇒ Writing an algorithm in two columns
NEW: TikZ book now 40% off at Amazon.com for a short time.

Writing an algorithm in two columns
Try using the multicol package to switch from one to two columns. The second and third packages are just to provide text to show the different column layout
Code: Select all
\documentclass{article}
\usepackage{multicol}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{multicols}{2}
\blindtext
\end{multicols}
\blindtext
\end{document}
Re: Writing an algorithm in two columns
Wow!! That's exactly what I need. amazing!
Thanks php1ic!
-Seeker
Thanks php1ic!
-Seeker
Re: Writing an algorithm in two columns
No problem, welcome to the board.
Once your problem is solved, the convention is to edit the subject of your initial post to include the green tick/check symbol.
Once your problem is solved, the convention is to edit the subject of your initial post to include the green tick/check symbol.