1

I tried to add watermark to my beamer using the followng (that can be found in this post)

\documentclass{beamer}
\usepackage{lipsum}

\usepackage{background}
\backgroundsetup{
    placement=center,
    scale=4,
    contents={DRAFT},
    opacity=1
}
\setbeamertemplate{background}{\BgMaterial}

\begin{document}
\frame{\lipsum[1]}
\end{document}

and works very well. But when I add xepersian package it doesn't work.

\documentclass{beamer}
\usepackage{lipsum, graphics}
\usepackage{background}
\backgroundsetup{
    placement=center,
    scale=4,
    contents={DRAFT},
    opacity=1
}
\setbeamertemplate{background}{\BgMaterial}

\usepackage{xepersian}
\setsansfont[Scale=1.2]{Arial}
\settextfont[Scale=1.2]{Arial}
%\setdigitfont{Arial}
\setmathdigitfont{Arial}
\setmainfont{Arial}


\begin{document}
%\setbeamertemplate{background}{\BgMaterial}
\frame{\lipsum[1]}
\end{document}

I have tried to set backcolor using \setbeamercolor{background canvas}{bg=} and it worked but it prints the content twice top of each other.

Another problem is that it has bad output for Arabic and Persian texts. For example it prints "خداوند" as "خ‌داو‌ن‌د". Same problem happens for draftwatermark.

0

1 Answer 1

1

Beamer has its own background mechanism, no need for the background package.

% !TeX TS-program = xelatex

\documentclass{beamer}
\usepackage{lipsum}
\usepackage{tikz}

\setbeamertemplate{background canvas}{
  \begin{tikzpicture}[remember picture,overlay]
  \node[font=\fontsize{64}{72}\selectfont,rotate=30,red!40] at (current page.center) {خداوند};
  \end{tikzpicture}
}

\usepackage{xepersian}
\setsansfont[Scale=1.2]{Arial}
\settextfont[Scale=1.2]{Arial}
\setdigitfont{Arial}
\setmathdigitfont{Arial}
\setmainfont{Arial}


\begin{document}
\begin{frame}
\lipsum[1]
\end{frame}
\end{document}

enter image description here

6
  • Thanks a lot. That worked. Easy and simple. Two issues: 1- How to change its typeface? 2- How to bring it to the front of blocks (foreground and not background).
    – C.F.G
    Oct 3, 2023 at 2:43
  • 1) make whatever typeface changes in font=... Oct 3, 2023 at 9:44
  • 2) if you want it in the foreground you can use \addtobeamertemplate{footline}{ \begin{tikzpicture}[remember picture,overlay] \node[font=\fontsize{64}{72}\selectfont,rotate=30,red,opacity=0.3] at (current page.center) {خداوند}; \end{tikzpicture} }{} Oct 3, 2023 at 9:45
  • I tried to change font by defining \setfontfamily{\titlefont}{font name} then using it in font=\titlefont (for tikzpicture and / or for \node) but nothing happened!
    – C.F.G
    Oct 3, 2023 at 10:09
  • font=\titlefont works fine for me: i.sstatic.net/rcKnd.png Maybe you could ask a new question showing the complete code you tried? Oct 3, 2023 at 10:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .