I am using the caption package to format figure and table captions. However, this breaks for longtable tables when the package bidi is loaded.
Here is a minimal example:
\documentclass{scrartcl}
\usepackage{lmodern}
\usepackage[xetex,pdfborder={0 0 0}]{hyperref}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage[format=hang,labelfont=bf,font={small,rm},labelsep=quad]{caption}
\usepackage{bidi}
\title{A Test}
\author{Author}
\date{\today}
\begin{document}
\maketitle
This is a paragraph.
\begin{figure}
\centering
\includegraphics[width=\textwidth]{Image_1.jpg}
\caption{An image}
\end{figure}
\begin{table}
\centering
\caption{A simple table}
\begin{tabular}{ll}
\toprule
A cell & and another one \\
and a third & and a fourth \\
\bottomrule
\end{tabular}
\end{table}
\begin{longtable}{ll}
\caption{A long table}\\
\toprule
A cell & and another one \\
and a third & and a fourth \\
\bottomrule
\end{longtable}
\end{document}
This is the result:
The captions formatting works for regular table and figure captions, and it also works for longtable as long as the bidi package is not loaded.
Any ideas how to fix this?
bidi
and had already screamed out loud. It overwriteslongtable
code, too, so what should I (as maintainer of thecaption
package) do about it? Overwrite it again (\AtBeginDocument) ifbidi
is loaded? Furthermore it uses internal code of thecaption
package which will change in the near future. Its author does not follows rule #1 when writing LaTeX packages: Only use internal code of dead (=unmaintained) LaTeX package. Otherwise contact the package author and figure out a proper interface.