## LaTeX forum ⇒ Text Formatting ⇒ verbatim inside savebox, newwatermark... Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
erwann
Posts: 72
Joined: Thu Aug 25, 2016 2:24 am

### verbatim inside savebox, newwatermark...  Topic is solved

Hello, how do I get verbatim to work inside savebox, newwatermark?

1. \newwatermark*[allpages,color=red!50,angle=45,scale=2,xpos=0,ypos=0]
2. {
3. % What I would like, but generates error
4. % \verb|Copyright (2018) <!-- e --><a href="mailto:name@gmail.com">name@gmail.com</a><!-- e -->|
5. % Poor workaround:
6. $\mathrm{Copyright (2018) <!-- e --><a href="mailto:name@gmail.com">name@gmail.com</a><!-- e -->}$
7. }
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)

Tags:

kaiserkarl13
Posts: 602
Joined: Tue Mar 25, 2008 5:02 pm
You don't. The \verb command and the verbatim environment must be able to be rendered immediately; they cannot appear in footnotes, headers, section headings, captions, and so forth.

If you want fixed-width fonts in such contexts, use the \texttt command. By the way, next time give a minimum working example so we don't have to spend ten minutes trying to figure out which package provides the newwatermark command.

I made the following minimal working example of something that actually generates a document:
1. \documentclass{article}
2. \usepackage{textcomp}
3. \usepackage{xcolor}
4. \usepackage{xwatermark}
5. \newwatermark*[allpages,color=red!50,angle=45,scale=2,xpos=0,ypos=0]
6. {% Better?
8. }
9. \begin{document}
10. hello
11. \end{document}

You're going to want to adjust the parameters, because scale=2 is too big.

erwann
Posts: 72
Joined: Thu Aug 25, 2016 2:24 am
By the way, next time give a minimum working example so we don't have to spend ten minutes trying to figure out which package provides the newwatermark command.

Sorry. I thought someone would know off the top of his head, I would have been happy with just try "texttt".
x_86 / Linux Mint 18.3 / texlive 2015.20160320-1ubuntu0.1 / TeXworks 0.5r1361 (Debian)