# algpseudocode side effect

All tables in my document seem to be affected after I've started using package algpseudocode. Pretty much every table now always starts with two additional lines. These lines are utilized properly when writing an algorithm as they serve as the placeholder for the algorithm's caption. However, this affects all other tables and it looks especially bad in captionless tables.

Has anyone noticed this issue before? Any suggestions on how it can be solved?

\documentclass{article}
%\usepackage{algorithm}
%\usepackage{algpseudocode}
\usepackage{float} \restylefloat{table}
\begin{document}
This is a test
\begin{table}
\begin{tabular}{| l | l | l | l |} \hline a & b & c & d \\ \hline \end{tabular}
\end{table}
\end{document}

• Can you produce a small example that illustrates your problem? This example should start with \documentclass and include the packages in questions. – dustin Aug 12 '13 at 10:45
• Yes. So the code is this one: <code>\documentclass{article} %\usepackage{algorithm} %\usepackage{algpseudocode} \usepackage{float} \restylefloat{table} \begin{document} This is a test \begin{table} \begin{tabular}{| l | l | l | l |} \hline a & b & c & d \\ \hline \end{tabular} \end{table} \end{document}</code> Removing the comments toggles the line I was talking about. However, as I realized the line is caused by the usage of the \restylefloat{table} which is responsible for placing the caption in the top of the table. – user1466889 Aug 12 '13 at 12:24
• Add this to the post instead of a comment. – dustin Aug 12 '13 at 12:29
• algorithm issues a \floatstyle command that's still in force when you do \restylefloat{table}. What's the purpose of it? – egreg Aug 12 '13 at 13:32

the algorithm package passes a styling option (by default, ruled) to the float package which makes all floats get a ruled style.

You can use

\usepackage[plain]{algorithm}


so it uses the plain option instead, or if you want algorithms ruled you could just not use

 \restylefloat{table}


so table floats do not pick up the new style.

(Note that the algpseudocode is not the cause of the problem, you see the effect if you just use algorithm)