LaTeX forum ⇒ Text FormattingPlace text between algorithms and adjust

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
rumi
Posts: 2
Joined: Tue Dec 27, 2016 9:00 am

Place text between algorithms and adjust

Postby rumi » Tue Dec 27, 2016 9:09 am

Hi,
I am having issue with adjusting my text beneath specific algorithm, how should i make it work? I am using this code:
  1. \begin{algorithm}[h]
  2. \caption
  3. \begin{algorithmic}
  4. \Procedure
  5. ...
  6. \EndProcedure
  7. \end{algorithmic}
  8. \end{algorithm}

My text which i need to add beneath it and then next algo..
Last edited by Stefan Kottwitz on Thu Dec 29, 2016 12:09 pm, edited 1 time in total.

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8209
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue Dec 27, 2016 11:32 am

Hi Rumi,

welcome to the forum! What exactly is the issue with the adjustment? Not left aligned? Indented? Not fully justified? Centered?

Stefan
Site admin

rumi
Posts: 2
Joined: Tue Dec 27, 2016 9:00 am

Postby rumi » Thu Dec 29, 2016 7:56 am

Thank u Stefan.. My problem is that I have a two column paper and I want description of each algorithm beneath it i.e rigth after the algorithm. In my case what's happening is, that description of two algorithms gets combined.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8209
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Dec 29, 2016 12:12 pm

Algorithms are intended to float, so LaTeX places them for optimal page breaks and column breaks, to avoid much undesired whitespace when the algorithm doesn't fit to the end of page or column and is moved to the next one.

If you would like to place the algorithm at an exact position in the text, simply use H instead of h, that forces it:

  1. \begin{algorithm}[H]
  2. ...
  3. \end{algorithm}


Btw. next time it would be great if you would post a compilable small example. With the code snippet above, we don't know the document class, or what packages are used, there are algorithm, algorithmic, algorithmicx, algpseudocode, and more.

Stefan
Site admin


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 8 guests