아랍어 템플릿의 목차 오류

아랍어 템플릿의 목차 오류
\documentclass[12pt,a4paper]{mathbook_arabic}
 
 %\newfontfamily\arabicfont[Script=Arabic]{Arial}
   \addto\captionsarabic{\renewcommand{\contentsname}{الفهرس}}
  
  % \newfontfamily\arabicfonttt[Script=Arabic]{Arial}
 
\usepackage{listings}
 \usepackage{mathrsfs}
 
 
 
  
  
\definecolor{bleu}{cmyk}{0.59,0.11,0,0.59}
\definecolor{vert}{cmyk}{0.78,0,0.74,0.45}
       
 
\begin{document}

 
\tableofcontents

\chapter*{Intro}
some textes 
\chapter{ch1}


  
  
  
 
  
  
     
 
 
 \end{document}

내가 이것을 컴파일할 때 발생한 오류는 다음과 같습니다.

@dottedtocline 사용을 검사하는 동안 파일이 종료되었습니다. \par l.68 \목차

답변1

Overleaf의 템플릿에 연결해 주셔서 감사합니다. TeX Live 2020에서 버그를 재현할 수는 없지만 다른 버그가 발생합니다. \newfontfamily\arabicfonttt라인 107 of mathbook_arabic.styshould 입니다 \newfontfamily\arabicfontsf. 그런 다음 \newfontfamily\arabicfonttt다음 줄에서 다시 선언합니다 . 이전 버전에서는 fontspec이를 허용했지만 최신 버전에서는 이를 버그로 표시합니다.

해당 템플릿에는 해당 책에 관련된 내용이 많이 포함되어 있어 약간 구식이 되었습니다. 원하는 템플릿을 자유롭게 사용할 수 있다면 이와 같은 것으로 시작하여 필요에 따라 수정하는 것이 좋습니다.

\documentclass[a4paper]{book} % Or article, scrbook, etc.
\tracinglostchars=2 % Warn if the current font does not have a character.

%% The previous sample you were using loaded the cmyk color space and manually
%% declared color names in French.  This loads the standard color names used in
%% CSS, SVGs and HTML, e.g. Blue and DarkCyan.  You can add HTML to allow hex
%% values.
\usepackage[svgnames]{xcolor}

%% Requires LuaHBTeX, or LuaLaTeX from 2020 or later.
\usepackage[bidi=basic, layout=sectioning]{babel}
\usepackage{unicode-math}
\usepackage{microtype}

%% You will certainly want to set more options than this, either here or with
%% \hypersetup.
\usepackage[unicode,
            colorlinks]{hyperref}

%% Can substitute import=ar-DZ, import=ar-MA or import=ar-SY for import.
%% To change the numbers from Western to localized, add the maparabic option.
%% Can also change other counters, e.g. alph=alphabetic, Alph=abjad.
\babelprovide[import, main, onchar=ids fonts]{arabic}
\babelprovide[onchar=ids fonts]{english}

\defaultfontfeatures{Scale=MatchLowercase, Ligatures=TeX, Renderer=HarfBuzz}

%% You can change these to your fonts of choice.

\babelfont{rm}
          [Scale=1.0, Ligatures=Common, Script=Default, Language=Default]{Libertinus Serif}
\babelfont[arabic]{rm}
          {Amiri}
\babelfont{sf}
          [Ligatures=Common, Script=Default, Language=Default]{Libertinus Sans}
\babelfont[arabic]{sf}
          [Language=Default]{Noto Sans Arabic}
\babelfont{tt}
          [Script=Default, Language=Default]{Libertinus Mono}
\babelfont[arabic]{tt}
          {ALM Fixed}

\setmathfont{Libertinus Math}

\babeltags{english=english}
%% \babeltags would fail to redefine \arabic, so provide `\textArabic`, etc.
%% You are unlikely to need them, because babel will switch to Arabic whenever
%% you use the Arabic script.
\babeltags{Arabic=arabic}

\begin{document}
\chapter{A Chapter}

للُّغَة العَرَبِيّة هي أكثر اللغات السامية تحدثاً، وإحدى أكثر اللغات انتشاراً في العالم، يتحدثها أكثر من 467 مليون نسمة،

\begin{english}
Arabic (اَلْعَرَبِيَّةُ, al-ʿarabiyyah, [al ʕaraˈbijːa] or عَرَبِيّ‎, ʿarabīy, [ˈʕarabiː]
or [ʕaraˈbij]) is a Semitic language that first emerged in the 1st to 4th
centuries CE.
\end{english}

\end{document}

이 버전의 템플릿은 라틴어 스크립트를 입력할 때마다 자동으로 영어로 전환되고 아랍어 스크립트를 입력할 때마다 아랍어로 자동 전환됩니다. 이 예에서는 하나의 언어 태그를 사용합니다. 이는 복사하여 붙여넣은 소스의 IPA 기호가 둘 다 아니지만 왼쪽에서 오른쪽으로 영어 글꼴로 표시되어야 하기 때문입니다. Babel에게 그들을 영어로 간주하라고 말하는 것이 가능할 것입니다. 다음과 같이 누락된 모든 문자에 대해 재정의를 추가할 수 있습니다.

\babelcharproperty{`ʕ}{locale}{english}

제가 선택한 주요 글꼴은 Khaled Hosny의 Amiri와 Libertinus Sans였으며, 둘 다 이전 디자인을 기반으로 하며 서로를 매우 잘 보완합니다.

원하는 글꼴로 변경할 수 있습니다. 예를 들어 일부 OS와 함께 제공되는 이전 버전 대신 Windows 10과 함께 배포된 Arial의 새 버전이 있는 경우 \babelfont{sf}및 그 뒤의 세 줄을 \babelfont{sf}{Arial}. 글꼴은 자동으로 크기를 조정하고 올바른 OpenType 기능을 선택 Script합니다 Language. (실제로 이 Language=기능은 가짜 경고를 제공하므로 \babelfont{sf}[Language=Default]{Arial}이를 억제하는 데 사용할 수 있습니다.)

수학의 경우, 나는 그의 Libertinus Math를 unicode-math. 즉, amssymb. \boldmath및 를 지원합니다 \boldsymbol. 그것이 당신이 원하는 것이 아니라면 대신에 다음 줄을 바꿀 수 \usepackage{unicode-math)있습니다 \setmathfont.

\usepackage{fontspec}
\usepackage[libertine]{newtxmath}
\usepackage{bm}

나는 페이지, 제목, 장, 목차 등의 기본 형식을 변경하지 않지만 및 와 같은 원하는 패키지를 사용하여 이 작업을 수행할 수 tocloft있습니다 fancyhdr.

관련 정보