我正在做我的硕士论文LaTex
,我使用以下代码。我遇到了一个问题目录,其页码采用阿拉伯语。
我尝试将其切换为图片列表,但我遇到了同样的问题。我无法让它们中的任何一个都使用罗马数字,我尝试了很多方法都没有成功。编号顺序看起来像“i、ii、iii、iv、v、vi、7、8”,其中 7-8 是表格和列表页,然后是章节页,通常是“1、2 等”。
\documentclass[12pt,a4paper,twoside]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[width=150mm,top=25mm,bottom=25mm]{geometry}
\usepackage[Bjornstrup]{fncychap}
\pagestyle{plain}
\usepackage[innercaption]{sidecap}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{textcomp}
\usepackage[arabic,main=english]{babel}
\renewcommand{\baselinestretch}{1.5}
\usepackage{tocloft}
\begin{document}
\nocite{*}
\frontmatter
\savegeometry{Mem}
\newgeometry{top=5in}
\addcontentsline{toc}{chapter}{Acknowledgment}
\centerline{\textsc{Acknowledgment}}
First
\clearpage
\loadgeometry{Mem}
\addcontentsline{toc}{chapter}{Notation}
\centerline{\textsc{Notation:}}
Note
\clearpage
\newgeometry{top=5in}
\addcontentsline{toc}{chapter}{Abstract}
\begin{center}
\Large{\textsc{Abstract}}
\end{center}
Abs
\clearpage
\addcontentsline{toc}{chapter}{Arabic Abstract}
\begin{otherlanguage}{arabic}
\begin{center}
\Large{الملخص}
\end{center}
\begin{center}
\large{وبنيته وبعض البنيات الجزئية فيه.}
\end{center}
\end{otherlanguage}
\clearpage
\newgeometry{top=3in}
\addcontentsline{toc}{chapter}{Foreword}
\begin{center}
\textsc{Foreword}
\end{center}
Fore
\loadgeometry{Mem}
Fore
\clearpage
\tableofcontents \addcontentsline{toc}{chapter}{Table of Contents}
\listoffigures \addcontentsline{toc}{chapter}{List of Figures}
\cleardoublepage
\cleardoublepage
\mainmatter
\newgeometry{top=4in}
\chapter{Preliminaries and Basic Concepts about Algebras}
blah
\bibliography{ref}
\bibliographystyle{acm}
\end{document}
答案1
如果你可以切换到现代引擎
如果您可以升级到 LuaLaTeX,那么切换到 Unicode 将解决许多黑客难题。它似乎解决了这个错误。
\documentclass[12pt,a4paper,twoside]{book}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{unicode-math}
\usepackage[width=150mm,top=25mm,bottom=25mm]{geometry}
\usepackage[Bjornstrup]{fncychap}
\usepackage[innercaption]{sidecap}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{tocloft}
\usepackage[bidi=basic, layout=sectioning.tabular, english]{babel}
\babelprovide[import=ar]{arabic}
\defaultfontfeatures{ Scale=MatchLowercase,
Ligatures=TeX }
\babelfont{rm}
[Ligatures=Common, Scale=1.0]{Libertinus Serif}
\babelfont[arabic]{rm}
{Amiri}
\babelfont{sf}
[Ligatures=Common]{Libertinus Sans}
\babelfont{tt}
{Libertinus Mono}
\babelfont[arabic]{tt}
{ALM Fixed}
\setmathfont{Libertinus Math}
\renewcommand{\baselinestretch}{1.5}
\pagestyle{plain}
\begin{document}
\nocite{*}
\frontmatter
\savegeometry{Mem}
\newgeometry{top=5in}
\addcontentsline{toc}{chapter}{Acknowledgment}
\centerline{\textsc{Acknowledgment}}
First
\clearpage
\loadgeometry{Mem}
\addcontentsline{toc}{chapter}{Notation}
\centerline{\textsc{Notation:}}
Note
\clearpage
\newgeometry{top=5in}
\addcontentsline{toc}{chapter}{Abstract}
\begin{center}
\Large{\textsc{Abstract}}
\end{center}
Abs
\clearpage
\addcontentsline{toc}{chapter}{Arabic Abstract}
\begin{otherlanguage}{arabic}
\begin{center}
\Large{الملخص}
\end{center}
\begin{center}
\large{وبنيته وبعض البنيات الجزئية فيه.}
\end{center}
\end{otherlanguage}
\clearpage
\newgeometry{top=3in}
\addcontentsline{toc}{chapter}{Foreword}
\begin{center}
\textsc{Foreword}
\end{center}
Fore
\loadgeometry{Mem}
Fore
\clearpage
\tableofcontents \addcontentsline{toc}{chapter}{Table of Contents}
\listoffigures \addcontentsline{toc}{chapter}{List of Figures}
\cleardoublepage
\cleardoublepage
\mainmatter
\newgeometry{top=4in}
\chapter{Preliminaries and Basic Concepts about Algebras}
blah
\bibliography{ref}
\bibliographystyle{acm}
\end{document}
坚持使用 PDFTeX
此错误的原因似乎是(从切换到阿拉伯语时arabicore.sty
调用)以不尊重的方式重新定义页面样式。序言中的以下重新定义使您的原始 MWE 对我有用:arabic.sty
babel
plain
\pagenumbering
\makeatletter
\def\ps@plain{\let\@mkboth\@gobbletwo
\let\@oddhead\@empty\def\@oddfoot{\reset@font\hfil\if@rlmain
\I{\thepage}\else\textLR{\thepage}\fi
\hfil}\let\@evenhead\@empty\let\@evenfoot\@oddfoot}
\makeatother