Discussion:
Problems with algorithm2e?
Alberto Simões
2007-10-03 09:12:58 UTC
Permalink
Hi

I am trying to use algorithm2e together with beamer, with some
problems. And I really can't understand what's the problem with it.

Anybody used them together before, or have any idea of what it's wrong it it?
(the algorithm2e code should be alright, as I c&p it from an article I
am writing.

Thanks in Advance,
Alberto

\usepackage[linesnumbered,vlined,portugues]{algorithm2e}
..
\begin{frame}[fragile]
\begin{algorithm}
\dontprintsemicolon\SetKwComment{tcp}{$\triangleright\ $}
...
\end{algorithm}
\end{frame}

and I get

! LaTeX Error: Not in outer par mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.2 \dontprintsemicolon
\SetKwComment{tcp}{$\triangleright\ $}
--
Alberto Simões

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Christophe Fiorio
2007-10-04 08:08:38 UTC
Permalink
Hi,

Beamer doesn't like floating environment, so use algorithm with [H]:

\begin{algorithm}[H]
\dontprintsemicolon\SetKwComment{tcp}{$\triangleright\ $}
...
\end{algorithm}

It should work


Christophe Fiorio
------------------------------------------------------------------------
-------------------
Dpt Informatique, équipe Arith
LIRMM, 161 Rue Ada , 34392 Montpellier Cedex, FRANCE
Tel: +33 467 41 86 41 - Fax: +33 467 41 85 00
http://www.lirmm.fr/~fiorio
------------------------------------------------------------------------
-------------------
Post by Alberto Simões
Hi
I am trying to use algorithm2e together with beamer, with some
problems. And I really can't understand what's the problem with it.
Anybody used them together before, or have any idea of what it's wrong it it?
(the algorithm2e code should be alright, as I c&p it from an article I
am writing.
Thanks in Advance,
Alberto
\usepackage[linesnumbered,vlined,portugues]{algorithm2e}
..
\begin{frame}[fragile]
\begin{algorithm}
\dontprintsemicolon\SetKwComment{tcp}{$\triangleright\ $}
...
\end{algorithm}
\end{frame}
and I get
! LaTeX Error: Not in outer par mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.2 \dontprintsemicolon
\SetKwComment{tcp}{$\triangleright\ $}
--
Alberto Simões
----------------------------------------------------------------------
---
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Latex-beamer-users mailing list
https://lists.sourceforge.net/lists/listinfo/latex-beamer-users
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Alberto Simões
2007-10-05 14:01:46 UTC
Permalink
Yep, it worked. Thanks a lot

Cheers
Alberto
Post by Christophe Fiorio
Hi,
\begin{algorithm}[H]
\dontprintsemicolon\SetKwComment{tcp}{$\triangleright\ $}
...
\end{algorithm}
It should work
Christophe Fiorio
------------------------------------------------------------------------
-------------------
Dpt Informatique, équipe Arith
LIRMM, 161 Rue Ada , 34392 Montpellier Cedex, FRANCE
Tel: +33 467 41 86 41 - Fax: +33 467 41 85 00
http://www.lirmm.fr/~fiorio
------------------------------------------------------------------------
-------------------
Post by Alberto Simões
Hi
I am trying to use algorithm2e together with beamer, with some
problems. And I really can't understand what's the problem with it.
Anybody used them together before, or have any idea of what it's wrong it it?
(the algorithm2e code should be alright, as I c&p it from an article I
am writing.
Thanks in Advance,
Alberto
\usepackage[linesnumbered,vlined,portugues]{algorithm2e}
..
\begin{frame}[fragile]
\begin{algorithm}
\dontprintsemicolon\SetKwComment{tcp}{$\triangleright\ $}
...
\end{algorithm}
\end{frame}
and I get
! LaTeX Error: Not in outer par mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.2 \dontprintsemicolon
\SetKwComment{tcp}{$\triangleright\ $}
--
Alberto Simões
----------------------------------------------------------------------
---
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Latex-beamer-users mailing list
https://lists.sourceforge.net/lists/listinfo/latex-beamer-users
--
Alberto Simões

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Tiago Rinck Caveden
2009-05-01 15:39:24 UTC
Permalink
Hello!

I found this thread through Google. Thanks for the [H] tip, it helped me.
But now I have another problem :(

If I write any simple algorithm, like a statement or simple while with
nothing special in its condition, it works fine. But if I try to put
anything like a \textlnot or math mode in the while condition, I have the
"Undefined control sequence" error for the command that closes the frame
(being it a \end{frame} or a } of a \frame, I tested for both)

For example, the following frame doesn't compile:

\frame{
\frametitle{The algorithm as we have it so far}

\begin{block}{In pseudo-language}

\begin{algorithm}[H]
\begin{algorithmic}

\WHILE{\textlnot}
\STATE {bla}
\ENDWHILE

\end{algorithmic}
\end{algorithm}
\end{block}
}


Does anyone has any idea of what's going on?

Thank you!
Post by Christophe Fiorio
Hi,
\begin{algorithm}[H]
\dontprintsemicolon\SetKwComment{tcp}{$\triangleright\ $}
...
\end{algorithm}
It should work
Christophe Fiorio
------------------------------------------------------------------------
-------------------
Dpt Informatique, équipe Arith
LIRMM, 161 Rue Ada , 34392 Montpellier Cedex, FRANCE
Tel: +33 467 41 86 41 - Fax: +33 467 41 85 00
http://www.lirmm.fr/~fiorio
------------------------------------------------------------------------
-------------------
Post by Alberto Simões
Hi
I am trying to use algorithm2e together with beamer, with some
problems. And I really can't understand what's the problem with it.
Anybody used them together before, or have any idea of what it's wrong it it?
(the algorithm2e code should be alright, as I c&p it from an article I
am writing.
Thanks in Advance,
Alberto
\usepackage[linesnumbered,vlined,portugues]{algorithm2e}
..
\begin{frame}[fragile]
\begin{algorithm}
\dontprintsemicolon\SetKwComment{tcp}{$\triangleright\ $}
...
\end{algorithm}
\end{frame}
and I get
! LaTeX Error: Not in outer par mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.2 \dontprintsemicolon
\SetKwComment{tcp}{$\triangleright\ $}
--
Alberto Simões
----------------------------------------------------------------------
---
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Latex-beamer-users mailing list
https://lists.sourceforge.net/lists/listinfo/latex-beamer-users
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Latex-beamer-users mailing list
https://lists.sourceforge.net/lists/listinfo/latex-beamer-users
--
View this message in context: http://www.nabble.com/Problems-with-algorithm2e--tp13016517p23334984.html
Sent from the latex-beamer-users mailing list archive at Nabble.com.
Rich Shepard
2009-05-01 16:08:32 UTC
Permalink
Post by Tiago Rinck Caveden
If I write any simple algorithm, like a statement or simple while with
nothing special in its condition, it works fine. But if I try to put
anything like a \textlnot or math mode in the while condition, I have the
"Undefined control sequence" error for the command that closes the frame
(being it a \end{frame} or a } of a \frame, I tested for both)
Is your algorithm written in fonttt, that is, monospaced? If so, I suspect
that your problem comes from trying to typeset proportional-space math
within the algorithm.

If you have literal code consider writing the equations in the same style
and typeface.

On a similar theme, yesterday I discovered that in a book class document I
could get away with entering \ldots, but that caused the same error as
above, "Undefined control sequence" when used in a beamer class document.
When I changed the beamer class doc so the LaTeX read \ldots{} it happily
compiled.

Rich
--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
Tiago Rinck Caveden
2009-05-01 16:34:45 UTC
Permalink
Post by Rich Shepard
Is your algorithm written in fonttt, that is, monospaced?
No. Well, at least I haven't done anything to make it be.

For the record, I forgot to mention that I'm a newbie in LaTeX. :-S
Post by Rich Shepard
If you have literal code consider writing the equations in the same style
and typeface.
I didn't do anything to change style and typeface, at least not explicitly.
Or using symbols implies that?

Thanks!
--
Tiago Rinck Caveden
http://caveden.multiply.com
Loading...