![目录编号和标题编号采用阿拉伯语左对齐](https://linux22.com/image/472347/%E7%9B%AE%E5%BD%95%E7%BC%96%E5%8F%B7%E5%92%8C%E6%A0%87%E9%A2%98%E7%BC%96%E5%8F%B7%E9%87%87%E7%94%A8%E9%98%BF%E6%8B%89%E4%BC%AF%E8%AF%AD%E5%B7%A6%E5%AF%B9%E9%BD%90.png)
我需要帮助将目录编号左对齐,并将标题编号改为阿拉伯语而不是像图片中那样的印地语。
谢谢。
\documentclass[a4paper, oneside, 11pt]{book}
\usepackage[top=23mm,bottom=22mm,left=2cm,right=3cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[LAE,LFE,T1]{fontenc}
\usepackage[english,main= arabic]{babel}
\usepackage{gensymb}
\usepackage{graphicx}
\usepackage{caption}
\usepackage[flushleft]{threeparttable}
\usepackage{pdfpages}
\usepackage{fancyhdr}
\usepackage{float}
\pagestyle{fancy}
\fancyfoot{}
\fancyhead[L]{}
\fancyfoot[L]{}
\cfoot{\thepage}
\pagestyle{fancy}
\addto\captionsarabic{%
\renewcommand\chaptername{الفصل}
}
\addto\captionsarabic{\renewcommand{\figurename}{الصورة}}
\addto{\captionsarabic}{\renewcommand*{\contentsname}{قائمة المحتويات}}
\addto\captionsarabic{%
\renewcommand{\listfigurename}{قائمة الصور}%
}
\makeatletter
\renewcommand\thepart
{{\fontencoding{T1}\selectfont\@Roman\c@part}}
\renewcommand\thechapter
{{\fontencoding{T1}\selectfont\@arabic\c@chapter}}
\renewcommand\thesection
{{\fontencoding{T1}\selectfont\thechapter.\@arabic\c@section}}
\renewcommand\thesubsection
{{\fontencoding{T1}\selectfont\thesection.\@arabic\c@subsection}}
\renewcommand\thesubsubsection
{{\fontencoding{T1}\selectfont\thesubsection.\@arabic\c@subsubsection}}
\renewcommand\theparagraph
{{\fontencoding{T1}\selectfont\thesubsubsection.\@arabic\c@paragraph}}
\renewcommand\thesubparagraph
{{\fontencoding{T1}\selectfont\theparagraph.\@arabic\c@subparagraph}}
\makeatother
\newcommand{\arabincludegraphics}[2][]{%
\foreignlanguage{english}{\includegraphics[#1]{#2}}%
}
\captionsetup[figure]{labelfont=bf,textfont={}}
\begin{document}
\tableofcontents
\listoffigures
\chapter{الأول}
\begin{figure}
\centering
\arabincludegraphics[width=1\textwidth]{example-image.jpg}
\caption{شرح}\label{image}
\end{figure}
\section{الأول}
\subsection{الأول}
\subsection{الثاني}
\section{الثاني}
\subsection{الأول}
\subsection{الثاني}
\subsection{الثالث}
\section{الثالث}
\end{document}
答案1
最好使用lualatex
而不是pdflatex
你不会遇到这样的问题。
\documentclass[a4paper, oneside, 11pt]{book}
\usepackage[top=23mm,bottom=22mm,left=2cm,right=3cm]{geometry}
\usepackage[bidi=basic,english]{babel}
\babelprovide[import,main]{arabic}
\babelfont{rm}{Amiri}
\usepackage{gensymb}
\usepackage{graphicx}
\usepackage{caption}
\usepackage[flushleft]{threeparttable}
\usepackage{pdfpages}
\usepackage{fancyhdr}
\usepackage{float}
\fancyfoot{}
\fancyhead[L]{}
\cfoot{\thepage}
\pagestyle{fancy}
\addto\captionsarabic{%
\renewcommand\chaptername{الفصل}}
\addto\captionsarabic{\renewcommand{\figurename}{الصورة}}
\addto{\captionsarabic}{\renewcommand*{\contentsname}{قائمة المحتويات}}
\addto\captionsarabic{%
\renewcommand{\listfigurename}{قائمة الصور}%
}
\captionsetup[figure]{labelfont=bf,textfont={}}
\begin{document}
\tableofcontents
\listoffigures
\chapter{الأول}
\begin{figure}
\centering
\includegraphics[width=1\textwidth]{example-image.jpg}
\caption{شرح}\label{image}
\end{figure}
\section{الأول}
\subsection{الأول}
\subsection{الثاني}
\section{الثاني}
\subsection{الأول}
\subsection{الثاني}
\subsection{الثالث}
\section{الثالث}
\end{document}