以下代码(摘自我之前的帖子) 没有xepersian
包时可以正常工作,但是当我添加xepersian
包时它不显示徽标!(使用 TexLive 2022 就可以了)
\documentclass{beamer}
\definecolor{devryblue}{RGB}{5, 51, 92}
\makeatletter
\colorlet{beamer@blendedblue}{devryblue}
\makeatother
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetheme{Madrid}
%\usepackage{default}
\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember picture,overlay]
\coordinate (logo) at ([xshift=-1.5cm,yshift=-1cm]current page.north east);
\fill[devryblue] (logo) circle (.9cm);
\clip (logo) circle (.75cm);
\node at (logo) {\includegraphics[width=2.1cm]{example-image}};
\end{tikzpicture}}
\usepackage{xepersian}
\setsansfont{Times New Roman}
\settextfont{Times New Roman}
\setdigitfont{Times New Roman}
\begin{document}
\section{title}
\begin{frame}
\frametitle{title}
\tableofcontents
\end{frame}
\begin{frame}
\frametitle{title}
\framesubtitle{My Title}
some text about Latex
\end{frame}
\end{document}
答案1
问题是,bidi
通过加载的包xepersian
会将框架标题模板从默认的左对齐更改为右对齐的框架标题——并且它不会在加载包时执行此操作,而只会在文档已启动后执行。这意味着您必须将自己的更改推迟到此之后:
% !TeX TS-program = xelatex
\documentclass{beamer}
\definecolor{devryblue}{RGB}{5, 51, 92}
\makeatletter
\colorlet{beamer@blendedblue}{devryblue}
\makeatother
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetheme{Madrid}
%\usepackage{default}
\usepackage{xepersian}
\setsansfont{Times New Roman}
\settextfont{Times New Roman}
\setdigitfont{Times New Roman}
\begin{document}
\section{title}
\addtobeamertemplate{frametitle}{}{%
\begin{tikzpicture}[remember picture,overlay]
\coordinate (logo) at ([xshift=-1.5cm,yshift=-1cm]current page.north east);
\fill[devryblue] (logo) circle (.9cm);
\clip (logo) circle (.75cm);
\node at (logo) {\includegraphics[width=2.1cm]{example-image}};
\end{tikzpicture}}
\begin{frame}
\frametitle{title}
\tableofcontents
\end{frame}
\begin{frame}
\frametitle{title}
\framesubtitle{My Title}
some text about Latex
\end{frame}
\end{document}