准备波斯语/阿拉伯语演示幻灯片时出现问题

准备波斯语/阿拉伯语演示幻灯片时出现问题

我正在尝试使用 beamer 和 xelatex 或 bidi 制作波斯语论文演示幻灯片;我正在使用 texlive,但当我运行以下代码而没有任何错误时,波斯字体没有出现在最终的 PDF 文件中。我该怎么办?

我发现阿拉伯字体也适用于波斯语文件,因此如果您能让这些幻灯片适用于阿拉伯语,那将非常有用。请注意,我是一个基础用户,所以请尽量写得简单易懂,以便我能理解。

\documentclass{beamer}
\usepackage{setspace}

\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}

\newfontfamily\arabicfont[Script=Arabic,Scale=1.1]{Yas}

\usetheme{Rochester}
\usecolortheme{wolverine}

\beamertemplatenavigationsymbolsempty

\setbeamertemplate{footline}[frame number]
\setbeamerfont{page number in head/foot}{size=\large}

\title{{\footnotesize \bf عنوان}}
\author[نویسنده]{نویسنده}
\institute[دانشگاه]{دانشگاه}

\AtBeginSection[]  % The commands within the following {} will be executed at the start of each section.
{
\begin{frame} % Within each "frame" there will be one or more "slides."  
\frametitle{Presentation Outline} % This is the title of the outline.
\tableofcontents[currentsection]  % This will display the table of contents and highlight the current section.
\end{frame}
} % Do not include the preceding set of commands if you prefer not to have a recurring outline displayed during your presentation.

\begin{document}

\begin{frame} 
\titlepage
\end{frame}

            \begin{frame}
    \frametitle{اولین اسلاید}
    %Content goes here
  \end{frame}
  \begin{frame}
    \frametitle{دومین اسلاید}
    \framesubtitle{دومین مطلب}
    %More content goes here
  \end{frame}
% etc
\end{document}

答案1

您希望看到这样的演示

在此处输入图片描述

  • 首先,您必须使用以下字体定义 Sans Serif 字体(用于标题)\newfontfamily\arabicfontsf[]{Name of font}

  • 第二,要将框架标题放在右侧,你可以使用\setbeamertemplate{frametitle}[default][right]

  • 您必须将波斯语文本放在环境内\textarabic{text}或环境中\begin{Arabic} \end{Arabic} (对于长文本)

  • 框架内的文本应放置在minipage环境内,以避免错误对齐

    \documentclass{beamer}
    \usepackage{setspace}
    
    \usepackage{fontspec}
    \usepackage{polyglossia}
    \setmainlanguage{english}
    \setotherlanguage{arabic}
    
    \newfontfamily\arabicfont[Script=Arabic,Scale=1.1]{Amiri}% I have not Yas font
    \newfontfamily\arabicfontsf[Script=Arabic,Scale=1.5]{Amiri}
    
    \usetheme{Rochester}
    \usecolortheme{wolverine}
    
    \beamertemplatenavigationsymbolsempty
    
    \setbeamertemplate{footline}[frame number]
    \setbeamerfont{page number in head/foot}{size=\large}
    
    \setbeamertemplate{frametitle}[default][right]% align the frametitle to the right
    
    
    \title{{\footnotesize \bf \textarabic{عنوان}}}
    \author[\textarabic{نویسنده}]{\textarabic{نویسنده}}
    \institute[\textarabic{دانشگاه}]{\textarabic{دانشگاه}}
    
    \AtBeginSection[]  % The commands within the following {} will be executed at the  start of each section.
    {
    \begin{frame} % Within each "frame" there will be one or more "slides."  
    \frametitle{Presentation Outline} % This is the title of the outline.
    \tableofcontents[currentsection]  % This will display the table of contents and highlight the current section.
    \end{frame}
     } % Do not include the preceding set of commands if you prefer not to have a    recurring outline displayed during your presentation.
    
    \begin{document}
    
    \begin{frame} 
    \titlepage
    \end{frame}
    
    \begin{frame}
    \frametitle{\textarabic{اولین اسلاید}}
    \begin{minipage}{\textwidth}
      %Content goes here
    \end{minipage}
    \end{frame}
    
    \begin{frame}
    \frametitle{\textarabic{دومین اسلاید}}
    \framesubtitle{\textarabic{دومین مطلب}}
    \begin{minipage}{\textwidth}
      %More content goes here
    \end{minipage}
    \end{frame}
    
    \end{document}
    

答案2

请看这个 答案\author。我在你的文档中应用了后者

\usepackage{fontspec}
\usepackage[utf]{arabxetex}%this line added
\usepackage{polyglossia}
\setmainlanguage{english}
%\setotherlanguage{arabic}%this line removed
.
.
.
\author[\textarab{نویسنده}]{\textarab{نویسنده}}

并且“نویسنده”出现在我的输出中。当然,这会产生一些错误,但是有效!!!

相关内容