I'm having some problem creating a new function.
I found in another topic a method to create a watermark on pages, and to make my work easier, I created a function when called, inserts the watermark on my sheets. So far I have this code.
\usepackage{eso-pic}
\usepackage{rotating}
\usepackage{transparent}
\newcommand{\watermark}[1]{
\AddToShipoutPicture{
\put(0,0){
\parbox[b][\paperheight]{\paperwidth}{
\vfill
\centering
{\transparent{0.15}\fontsize{150pt}{1.5pt}\fontfamily{lmtt}\selectfont \begin{turn}{45} \textbf{#1}\end{turn}}
\vfill}}}
}
However, I want to optimize this command even more, passing through the mandatory command the text to be displayed, and optional parameters the following data: "rotation, transparency and font size". But I don't know how to create a command with all these optional and mandatory parameters.
Thank you in advance.
draftwatermark? – egreg Feb 06 '22 at 10:28key=valuemethod is more powerful and flexible; the\newcommandmethod can have 9 parameters, only the first parameter can be optional (although nesting of\newcommands is possible) (c) In expl3, multiple optional parameters are allowed, but are positional, not named (although named parameters can be coded up in and out of expl3 (there was a TeX.se question about naming parameters so they could be typed in any order)). – Cicada Feb 07 '22 at 14:18