![阿拉伯语/多语种/双向语与 `abnt` 包不兼容](https://linux22.com/image/383877/%E9%98%BF%E6%8B%89%E4%BC%AF%E8%AF%AD%2F%E5%A4%9A%E8%AF%AD%E7%A7%8D%2F%E5%8F%8C%E5%90%91%E8%AF%AD%E4%B8%8E%20%60abnt%60%20%E5%8C%85%E4%B8%8D%E5%85%BC%E5%AE%B9.png)
使用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}