
tikz 명령을 사용하여 내 페이지 주위에 테두리를 만들려고 하면 tikz 명령 뒤의 첫 번째 텍스트 줄이 잘못 정렬됩니다(문서가 아랍어(주 언어 설정)로 되어 있음). 여기서 텍스트는 RHS가 아닌 LHS에 정렬됩니다. 또한 단어는 올바르게 입력되었지만 순서가 반대입니다. 테두리를 취소하면 텍스트 출력이 정확합니다. 저는 XELATEX + POLYGLYOSSIA를 사용하고 있습니다. 여기에 단순화된 아랍어 글꼴에 대한 링크가 있습니다(코드를 올바르게 실행하려면 WINDOWS에 설치하세요:https://fontzone.net/font-details/simplified-arabic
코드는 다음과 같습니다.
\documentclass[a4paper,12pt,twoside]{book}
\usepackage{fontspec}
\usepackage{tcolorbox}
\usepackage{url,graphicx}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,arrows,positioning,matrix,quotes, shapes.geometric,calc}
\usepackage{polyglossia}
\setdefaultlanguage[calendar=gregorian,locale=default,numerals=mashriq]{arabic}
\setotherlanguages{english}
\newfontfamily\arabicfont[Script=Arabic,Mapping=arabicdigits]{Simplified Arabic}
\title{jhhjjhhj}
\author{}
\date{}
\begin{document}
\chapter{شكر وتقدير}
\begin{tikzpicture}[remember picture, overlay]
\draw[line width = 4pt] ($(current page.north west) + (1in,-1in)$) rectangle ($(current page.south east) + (-1in,1in)$);
\end{tikzpicture}
\textbf{
يتقدم المؤلف بالشكر لكل من:}
\end{document}
답변1
문제는 두 가지입니다.
tikz
그림을 바로 RTL 텍스트 흐름으로 실행하면 \textbf{}
엉망이 됩니다.
그리고 이 문제를 해결하기 위해 단락 공간을 남겨두면 원하지 않는 수직 공간이 생깁니다.
eso-pic
배송 시 페이지 배경에 테두리를 추가하려면 패키지 에 있는 것과 같은 방법을 사용해야 합니다 .
MWE
이 MWE는 명령을 포함하는 모든 페이지에 테두리를 추가합니다 \insertpageborder
.
\documentclass[a4paper,12pt,twoside]{book}
\usepackage{fontspec}
\usepackage{tcolorbox}
\usepackage{url,graphicx}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,arrows,positioning,matrix,quotes, shapes.geometric,calc}
\usepackage{polyglossia}
\setdefaultlanguage[calendar=gregorian,locale=default,numerals=mashriq]{arabic}
\setotherlanguages{english}
\newfontfamily\arabicfont[Script=Arabic,Mapping=arabicdigits]{Amiri}
\usepackage{eso-pic}
\newcommand{\insertpageborder}{%
\AddToShipoutPictureBG*{%
\begin{tikzpicture}[remember picture, overlay]
\draw[line width = 4pt] ($(current page.north west) + (1in,-1in)$) rectangle ($(current page.south east) + (-1in,1in)$);
\end{tikzpicture}}}
\begin{document}
\chapter{شكر وتقدير}
\insertpageborder
\textbf{يتقدم المؤلف بالشكر لكل من:}
\end{document}