阿拉伯语/多语种/双向语与 `abnt` 包不兼容

阿拉伯语/多语种/双向语与 `abnt` 包不兼容

使用bidi重新定义章节标题和图形计数器,恢复chngcntr默认book类行为。我尝试更改包的顺序,即使在文件中.sty,也无济于事。

\documentclass{book}
\usepackage{mwe}
\usepackage{abnt}
\usepackage{graphicx}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage[locale=mashriq]{arabic}
\newfontfamily{\arabicfont}[Script=Arabic]{Scheherazade}

\begin{document}
\chapter*{Introduction}

\chapter{Figure tests}
\textarabic{\today}

\begin{figure}
    \centering
    \includegraphics{example-image-a}
    \caption{Caption}
\end{figure}

\addtocounter{figure}{9}
\begin{figure}
    \centering
    \includegraphics{example-image-a}
    \caption{Caption}
\end{figure}


\end{document}

答案1

从您的问题来看,仍然不完全清楚所有更改的内容,但仔细研究后abnt.sty发现,它主要对章节格式进行了两项更改。因此,我认为以下内容可以满足您的要求。

\documentclass{book}
\usepackage{mwe}
\usepackage{abnt}
\usepackage{graphicx}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage[locale=mashriq]{arabic}
\newfontfamily{\arabicfont}[Script=Arabic]{Scheherazade}
\makeatletter
\def\@makechapterhead#1{%
    %\vspace*{50\p@}% <----------------- Space from top of page to Chapter #
    {\parindent \z@ \raggedright \normalfont
        \ifnum \c@secnumdepth >\m@ne
        \huge\bfseries \thechapter\ \enspace %\. <-- Chapter #
        %\par\nobreak
        %\vskip 20\p@% <-------------- Space between Chapter # and title
        \fi
        \interlinepenalty\@M
        \Huge \bfseries #1\par\nobreak% <------------------ Chapter title
        \vskip 40\p@% <------------------ Space between chapter title and first paragraph
}}

\def\@makeschapterhead#1{%
    %\vspace*{50\p@}%
    {\parindent \z@ \centering
        \normalfont
        \interlinepenalty\@M
        \Huge \bfseries  #1\par\nobreak
        \vskip 40\p@
}}
\makeatother
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}
\begin{document}
\chapter*{Introduction}

\chapter{Figure tests}
\textarabic{\today}

\begin{figure}
    \centering
    \includegraphics{example-image-a}
    \caption{Caption}
\end{figure}

\addtocounter{figure}{9}
\begin{figure}
    \centering
    \includegraphics{example-image-a}
    \caption{Caption}
\end{figure}


\end{document}

相关内容