16

I want to write 2 or 3 lines in watermark

\usepackage{draftwatermark}
\SetWatermarkText{Mika Ike}
\SetWatermarkScale{0.25}
\SetWatermarkColor[gray]{0.88}

How can I write "Mika Ike" and under this line "mikaike@mikaike.mikaike" and a third lined with "At My house" ?

Is it possible?

And... to use a image but with a hight level os transparency to see that image softly at background.

\usepackage{draftwatermark}
\SetWatermarkText{\includegraphics{fig1.jpg}}
\SetWatermarkScale{0.25}
\SetWatermarkColor[gray]{0.88}

Do you think this is the best package for watermarks? or do you know other better than this?.

Could you tell me about other packages.

  • Have you tried Mika Ike\\mikaike@mikaike.mikaike\\At My house? Also, one question per post, please. – Sean Allred Jul 29 '13 at 13:35
  • @SeanAllred Yes, I tried. But I have no good results!!! all the text in one one line. – Mika Ike Jul 29 '13 at 13:38
  • Use a \parbox – egreg Jul 29 '13 at 15:15
20

Using the draftwatermark package, you can use a \parbox, or a minipage, to have the text spanning several lines:

\documentclass{article}
\usepackage[a6paper]{geometry}
\usepackage{draftwatermark}
\usepackage{url}
\usepackage{lipsum}

\SetWatermarkText{\parbox{12cm}{%
  Mika Ike \\
  \url{mikaike@mikaike.mikaike} \\ 
  At My house}}
\SetWatermarkScale{.5}
\SetWatermarkColor{red}

\begin{document}

\lipsum[4]\lipsum[4]
\lipsum[4]\lipsum[4]

\end{document}

enter image description here

In the case of opacity for images, the draftwatermark package apparently doesn't provide many possibilities.

As an alternative, I'd suggest you to use the background package; since this package internally uses TikZ, you can easily control the attributes (opacity, color, position, etc.) for the background material. A little example:

\documentclass{article}
\usepackage[a6paper]{geometry}
\usepackage[scale=2.5,opacity=1,color=red]{background}
\usepackage{url}
\usepackage{varwidth}
\usepackage{lipsum}

\backgroundsetup{
contents={\begin{varwidth}{8cm}{%
  Mika Ike \\
  \url{mikaike@mikaike.mikaike} \\ 
  At My house}\end{varwidth}}
}

\begin{document}

\lipsum[4]\lipsum[4]
\lipsum[4]\lipsum[4]

\end{document}

The varwidth environment was used to have a box of adjustable width allowing multiple lines of text; a minipage or a \parbox could also have been used instead.

enter image description here

And, using an image:

\documentclass{article}
\usepackage[a6paper]{geometry}
\usepackage[scale=1,opacity=0.75,angle=0]{background}
\usepackage{url}
\usepackage{varwidth}
\usepackage{lipsum}

\backgroundsetup{
contents={\includegraphics[height=\textheight,width=\textwidth,keepaspectratio]{ctanlion}}
}

\begin{document}

\lipsum[4]\lipsum[4]
\lipsum[4]\lipsum[4]

\end{document}

enter image description here

CTAN lion drawing by Duane Bibby.

  • I don't think the background package was the important part of this answer; I also tried it and, without varwidth, the problem persisted. Particularly, this solution also works with \SetBgContents from the same package, and various other methods (eg TikZ). (Very nice solution, though!!!) – Sean Allred Jul 29 '13 at 13:48
  • @SeanAllred I added a little remark about the use of varwidth. \SetBgContents was the old syntax from the first version of the package (which still can be used), before I adopted a key=value approach. – Gonzalo Medina Jul 29 '13 at 14:06
5

One solution is to use \shortstack{} which can be found in the manual of the draftwatermark package.

Example:

\documentclass{article}
\usepackage{lipsum}
\usepackage{draftwatermark}
\SetWatermarkText{
  \shortstack{
        \includegraphics[scale=0.8]{ctan_lion_600.png} 
  }
}
\SetWatermarkScale{0.15}

\begin{document}
\lipsum[1]
\lipsum[2]
\lipsum[3]
\lipsum[4]
\end{document}

Example:

\documentclass{article}
\usepackage{lipsum}
\usepackage{draftwatermark}
\SetWatermarkText{
  \shortstack{
        this is the first line  \\[1em]  second line 
  }
}
\SetWatermarkScale{2}
\SetWatermarkColor[gray]{0.5}

\begin{document}
\lipsum[1]
\lipsum[2]
\lipsum[3]
\lipsum[4]
\end{document}

enter image description here enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.