我需要帮助将目录编号左对齐,并将标题编号改为阿拉伯语而不是像图片中那样的印地语。
谢谢。
\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}