Math & Science ⇒ Writing an algorithm in two columns
Writing an algorithm in two columns
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!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Writing an algorithm in two columns
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
Thanks php1ic!
-Seeker
Re: Writing an algorithm in two columns
Once your problem is solved, the convention is to edit the subject of your initial post to include the green tick/check symbol.