Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to include a big "Draft" text on the background in some files imported by the import package in this way:

\subimport{}{test.text}

How can you include such a big "Draft" text to the background of some imported files?. This is a MWE:

\documentclass{article}
\usepackage{import}
\usepackage{lipsum} % for dummy text
\begin{document}
\lipsum[1-5]  % main dummy text  
\newpage
\subimport{}{test.tex} % subdocument that must have the a big "Draft" in the background 
\end{document}

The test.tex file is:

\lipsum[1-10]
share|improve this question
    
After read twice, I guess that the question is simply insert "Draft" in the background of only the imported pages with the import package. Added a MWE and vote to reopen. –  Fran Feb 24 at 0:39
1  
@Masi, Use the package background and insert some like \backgroundsetup{contents=Draft,color=blue!30} before of \subimport and \backgroundsetup{contents={}} for parts with normal text. –  Fran Feb 24 at 0:51
    
@Fran I honestly have no idea how you managed to understand that from the original question. I salute you for your edit, but it may just be a shot in the dark. In any case, no offense, but I don't think the OP's behaviour (cryptic question, little research, no MWE, etc.) should be encouraged... –  Jubobs Feb 24 at 8:13
    
@Jubbobs You're right. Clairvoyance is a risky job when you're wrong and even when you hit. :-) But the alternative was to leave it closed and punish the entire community, when I was convinced that I knew the answer. A closed question as unclear only is useful to waste time if you find it. Moreover, I think sometimes it's good to lead by example. Otherwise, it would not make sense the edit button in the questions of others. –  Fran Feb 24 at 20:45
add comment

1 Answer 1

up vote 4 down vote accepted

You can use the background package; using \backgroundsetup{contents={}} you remove the background material for the "normal text" pages and with \backgroundsetup{contents={Draft}} you activate the material for the included pages (\newpage, or better yet, \clearpage must be used before changing the material):

\documentclass{article}
\usepackage{background}
\usepackage{import}
\usepackage{lipsum} % for dummy text
\begin{document}
\backgroundsetup{contents={}}
\lipsum[1-5]  % main dummy text  
\clearpage
\backgroundsetup{contents={Draft}}
\subimport{}{test.tex} % subdocument that must have the a big "Draft" in the background
\clearpage 
\backgroundsetup{contents={}}
\newpage
\lipsum[1-5]  % main dummy text  
\end{document}

enter image description here

Of course, using the key-value interface, you can change the color, position, opacity of the "Draft" string.

share|improve this answer
    
As addition: Some other possible packages without trying to be complete: draftmark and its much more powerful (but also complex) successor xwatermark. –  Speravir Feb 24 at 3:29
    
@Speravir For information, I tried to use xwatermark in the past to get a semi-transparent watermark on top of my content, but it ended up being covered by my listings. I had to use a combination of tikz and atbegshi to get what I wanted. –  Jubobs Feb 24 at 8:24
    
@Jubobs in those cases you can use the starred version \newwatermark* from xwatermark. –  Gonzalo Medina Feb 24 at 15:00
    
Another issue with xwatermark is that it relies on fancyhdr, so with scrpage2 and very probably its successor scrlayer-scrpage you will get error messages. –  Speravir Feb 24 at 20:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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