2

I want to type some text with XeLaTeX like this picture on one page. Sorry I don't have any good minimal code.

\documentclass{report}
\usepackage{xepersian}
\settextfont{Yas}
\begin{document}
تقدیم به بهترین هم‌نشینم حضرت مولوی
\end{document}

Link for "Yas" font enter image description here

3
  • I'm not sure I fully understand the question, do you want Persian/Arabic text on a yellow gradient background?
    – Marijn
    Aug 12, 2019 at 19:41
  • Yes I want. Place of text isn't matter. Just I want the final code compile correctly like always with xelatex and xepersian package. Thanks a lot Aug 12, 2019 at 19:54
  • Notice the xepersian package must be last package. Sincerely Aug 12, 2019 at 20:15

2 Answers 2

6

Like this?

\documentclass{report}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{xepersian}
\settextfont{Yas}

\begin{document}
 \begin{tikzpicture}[remember picture,overlay]
    \node [fill, rectangle, top color=yellow, bottom color=white, anchor=north, minimum width=\paperwidth, minimum height=\paperheight] (box) at (current page.north){};
  \end{tikzpicture}

تقدیم به بهترین هم‌نشینم حضرت مولوی
تقدیم به بهترین هم‌نشینم حضرت مولوی
تقدیم به بهترین هم‌نشینم حضرت مولوی
تقدیم به بهترین هم‌نشینم حضرت مولوی
\newpage
تقدیم به بهترین هم‌نشینم حضرت مولوی
تقدیم به بهترین هم‌نشینم حضرت مولوی
تقدیم به بهترین هم‌نشینم حضرت مولوی
تقدیم به بهترین هم‌نشینم حضرت مولوی

\end{document}

enter image description here

3

If you want the gradient on every page then you can use the everypage package.

MWE, adapted from Background color gradient for entire document:

\documentclass[x11names]{report}
\usepackage{everypage}
\usepackage{tikz}
\usepackage{xepersian}
\AddEverypageHook{%
\begin{tikzpicture}[remember picture,overlay]%
\path [top color = Gold2,middle color = Gold2!30, bottom color = white] (current page.north east)rectangle (current page.south west);%
\end{tikzpicture}%
}%
\settextfont{Amiri}
\begin{document}\Huge
تقدیم به بهترین هم‌نشینم حضرت مولوی
\end{document}
\begin{document}

Result:

enter image description here

2
  • @Marjin, do you know how can I set the strength of the colour? And how fast or slow it fades?
    – Agent 0
    Feb 8, 2022 at 9:54
  • @ForgottenApe you can change the values for top color, middle color, bottom color. If you want a 'stronger' color then you can set the top color to be darker. If you want a faster fade then you can set the middle color to be lighter. See the xcolor manual for explanation on how to mix colors like Gold2!30, particularly section 2.3.2 Meaning of standard color expressions on page 16 and the examples in Figure 5 Standard color expressions on page 37.
    – Marijn
    Feb 8, 2022 at 11:48

You must log in to answer this question.

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