Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Hi I started using floatrow and noticed that it is breaking functionality of my algorithm code, both the algorithm header and footer have disappeared. Here is a picture of before and after: enter image description here

Here are the packages I am using:

\usepackage[rawfloats=true]{floatrow}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{appendix}
\usepackage{caption}
\usepackage{cite}
\usepackage{xcolor}
\usepackage{color}
\usepackage{footnote}
\usepackage[top=1.0in, bottom=1.0in, left=1.0in, right=1.0in]{geometry}
\usepackage{graphicx}
\usepackage{pifont}
\usepackage{subfig}
\usepackage{times}
\usepackage[hyphens]{url}
\usepackage{comment}
\usepackage{xspace}
\usepackage{enumitem}

And code from my algorithm block:

\begin{algorithm}[t]
\begin{algorithmic}[1]
\Function{$P$}{$e$, $e'$, $t$, $T$}
    \If{$e' < e$}
        \Return 1.0 
    \Else
        \State\Return $exp^{-4.6 * {(e' / e)}^2 * ((T - t) / T)}$
    \EndIf
\EndFunction
\end{algorithmic}
\caption{Simulated Annealing}
\end{algorithm}

Any suggestions for a fix are appreciated.

share|improve this question
    
Are you sure that this is exactly what you want to do {exp^{-4.6 * {(e' / e)}^2 * ((T - t) / T)}}. If I were in yur shoes I would do \exp{-4.6 * {(e' / e)}^2 * ((T - t) / T)} or e^{-4.6 * {(e' / e)}^2 * ((T - t) / T)}. –  Thanos Sep 22 '12 at 6:23

1 Answer 1

Do not use the rawfloats=true option for floatrow; you can use \RawFloats either locally (inside some specific floating environment(s)) or in the form \RawFloats[<type>] in the preamble of your document for all floats of the given <type>. Here's an example showing the expected behaviour:

\documentclass{article}
\usepackage{floatrow}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{appendix}
\usepackage{caption}
\usepackage{cite}
\usepackage{xcolor}
\usepackage{color}
\usepackage{footnote}
\usepackage[top=1.0in, bottom=1.0in, left=1.0in, right=1.0in]{geometry}
\usepackage{graphicx}
\usepackage{pifont}
\usepackage{subfig}
\usepackage{times}
\usepackage[hyphens]{url}
\usepackage{comment}
\usepackage{xspace}
\usepackage{enumitem}

\begin{document}

\begin{algorithm}[t]
\begin{algorithmic}[1]
\Function{$P$}{$e$, $e'$, $t$, $T$}
    \If{$e' < e$}
        \Return 1.0 
    \Else
        \State\Return $exp^{-4.6 * {(e' / e)}^2 * ((T - t) / T)}$
    \EndIf
\EndFunction
\end{algorithmic}
\caption{Simulated Annealing}
\end{algorithm}

\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.