3

I don't know if this package is the best for my purpose, but I'm using algorithmicx (see here the documentation) to write algorithms (in pseudcode) inside my work. At now, I've just a problem: input-parameter' names for my procedure are too long, thus text exceeds the box, ruining the layout.

This is the code:

\begin{algorithm}
\caption{Algorithm to fetch overlapped objects from input lists.}
\begin{algorithmic}[1]
\Procedure {CHECK\_OVERLAP}{$List\_Global\_RE\_To\_Ev\_Objs\_A_k$,$List\_Global\_RE\_To\_Ev\_Objs\_B_k$}
\EndProcedure
\Statex
\end{algorithmic}
\end{algorithm}

And related output:

Algorithm's body

What should I do to fix this problem?

4
  • 1
    Let me quote from mathmode: LaTeX can break an inline formula only when a relation symbol (=,<,>,...) or a binary operation symbol (+, −, . . .) exists and at least one of these symbols appears at the outer level of a formula. Thus $a+b+c$ can be broken across lines, but ${a+b+c}$ not. May 10, 2013 at 11:19
  • Hence, is there nothing I can do?!
    – vdenotaris
    May 10, 2013 at 11:24
  • Why do you put anything in mathmode? You can also use textit or emph. May 10, 2013 at 11:29
  • Yes, you're right. I noticed it just now. Anyway, thank you so much.
    – vdenotaris
    May 10, 2013 at 11:38

1 Answer 1

5

The solution is very simple: it's enough add a space between commas.

\begin{algorithm}
\caption{Algorithm to fetch overlapped objects from input lists.}
\begin{algorithmic}[1]
\Procedure {CHECK\_OVERLAP}{$List\_Global\_RE\_To\_Ev\_Objs\_A_k$, $List\_Global\_RE\_To\_Ev\_Objs\_B_k$}
\EndProcedure
\Statex
\end{algorithmic}
\end{algorithm}

I'm sorry for such a (stupid) question. However I hope this answer will save someone else's time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .