Text Formattingverbatim inside savebox, newwatermark...

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

verbatim inside savebox, newwatermark...

Post by erwann »

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

Code: Select all

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

verbatim inside savebox, newwatermark...

Post by kaiserkarl13 »

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:

Code: Select all

\documentclass{article}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{xwatermark}
\newwatermark*[allpages,color=red!50,angle=45,scale=2,xpos=0,ypos=0]
{% Better?
    Copyright \copyright 2018 \href{mailto:name@gmail.com}{\texttt{name@gmail.com}}
}
\begin{document}
hello
\end{document}
You're going to want to adjust the parameters, because scale=2 is too big.
erwann
Posts: 75
Joined: Thu Aug 25, 2016 2:24 am

verbatim inside savebox, newwatermark...

Post by erwann »

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)
Post Reply