字幕格式不适用于双向

字幕格式不适用于双向

我正在使用标题包来格式化图形和表格标题。然而,这打破了长桌包时的表比迪烟已加载。

这是一个简单的例子:

\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}

结果如下:

渲染的 PDF 输出

标题格式适用于常规表格和图形标题,只要未加载 bidi 包,它也适用于 longtable。

任何想法如何解决这一问题?

答案1

您正在使用 KOMA-Script 类scrartcl。因此,您可以使用其功能根据需要格式化字幕:

\documentclass{scrartcl}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{booktabs}

\usepackage[pdfborder={0 0 0}]{hyperref}
\usepackage{bookmark}% <- added
\usepackage{bidi}

\KOMAoptions{captions=tableabove}% <- to get the correct spacing between caption and table
\addtokomafont{caption}{\normalfont\small}
\addtokomafont{captionlabel}{\bfseries}
\renewcommand*{\captionformat}{\quad}

\title{A Test}
\author{Author}
\date{\today}

\begin{document}

\maketitle

This is a paragraph.

\begin{figure}
\centering
\rule{\textwidth}{1cm}
\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}

结果:

在此处输入图片描述

答案2

更改软件包的顺序:

\documentclass{scrartcl}
\usepackage{lmodern}
\usepackage[xetex,pdfborder={0 0 0}]{hyperref}
\usepackage{graphicx}

\usepackage{booktabs}
\usepackage[format=hang,labelfont=bf,font={small,rm},labelsep=quad]{caption}
\usepackage{longtable}
\usepackage{bidi}


\title{A Test}
\author{Author}
\date{\today}

\begin{document}

\maketitle

This is a paragraph.

\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}

在此处输入图片描述

相关内容