3

I follow the suggest solution to place a watermark over images. This works very well. But for my doc I have specified a different main font namely

\setmainfont{Liberation Sans}

But somehow this is ignored by the package xwatermarkenter image description here

while for the package background it works fine enter image description here

The angle and the position I can play around and handle by myself. But is there an easy solution available to use the set mainfonts and draw over images?

LeO
  • 1,451

1 Answers1

3

OK, you are using LuaTeX, right? But xwatermark needs a "NFSS family name" (where "NFSS" stands for New Font Selection Scheme), see here: https://tex.stackexchange.com/a/288461/4736

So we get:

\documentclass{article}
\usepackage[printwatermark]{xwatermark}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}

\newfontfamily\verbatimfont[NFSSFamily=myverbatimfont]{Arial}

\newwatermark*[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0,fontfamily=myverbatimfont]{DRAFT}

\begin{document}

\lipsum[1-2]
\begin{figure}[!ht]
\centering
\includegraphics[width=3cm]{example-image-a}
\end{figure}
\lipsum[1-2]
\end{document}

xwatermark example

Keks Dose
  • 30,892
  • Thx for the hint. I'm confused because NFSS font name could be any kind of font or just specific ones? Because your example shows it with Àrialˋ I wonder if it could be ˋLinux Libertine 0ˋas well. Is it a matter that a definition is missing or is it due to the fonts internal specification? If it is the first one - I could define any font, right? If it is the second option than where to find a list of available fonts? – LeO Jun 16 '19 at 09:25
  • @LeO I'm not sure what you ask. You can take the name of any font which is installed on your system. Why not Libertine? – Keks Dose Jun 16 '19 at 10:37
  • Ahh, ok... I wasn't sure if there is a limitation to (the name of) the font. Especially since you mentioned the NFSS feature. But now its clear - I just need to define it. Thx – LeO Jun 16 '19 at 13:08