0

Wrote the following code (keeping it small to highlight the problem) using book class. Facing two issues with this code (same issue seen with both 'texstudio' & 'led' on windows10) :

  1. "Draft" is getting printed on each page. How can i remove it ?
  2. In between the two pages shown below, i am seeing a blank page with "draft" written on it. How to get rid of the blank page ?
\documentclass[12pt]{book}

\usepackage{graphicx}
\usepackage{background}

\begin{document}

\frontmatter
  \begin{titlepage} 
     \begin{center}
        {\Huge\bf book title}\\[5mm]
        {\Large\bf By author-name}
     \end{center}   
  \end{titlepage}   

\mainmatter 
\backgroundsetup{
    scale=1,
    angle=0,
    opacity=0.1,  %% adjust
    contents={\includegraphics[width=\paperwidth,height=\paperheight]{a.jpg}}
}
  \begin{enumerate}
  \begin{LARGE}
    \item line-1    
    \item line-2
  \end{LARGE}   
  \end{enumerate}   

\end{document}  

enter image description here

enter image description here

3

To remove the word draft remove the background package. Also don't use \bf, this is obsolete

\documentclass[12pt]{book}

\usepackage{graphicx}
%\usepackage{background}

\begin{document}

\frontmatter
  \begin{titlepage} 
     \begin{center}
        {\Huge\bfseries book title}\\[5mm]
        {\Large\bfseries By author-name}
     \end{center}   
  \end{titlepage}   

\mainmatter 
  \begin{enumerate}
  \LARGE
  \item line-1    
  \item line-2 
  \end{enumerate}   

\end{document}  

To keep the background package around:

\documentclass[12pt]{book}

\usepackage{graphicx}
\usepackage[contents={}]{background}

\begin{document}

\frontmatter
  \begin{titlepage} 
     \begin{center}
        {\Huge\bfseries book title}\\[5mm]
        {\Large\bfseries By author-name}
     \end{center}   
  \end{titlepage}   
\mainmatter 
\backgroundsetup{%
    scale=1,
    angle=0,
    opacity=0.1,  %% adjust
    contents={\includegraphics[width=\paperwidth,height=\paperheight]{example-image}}
}
  \begin{enumerate}
    \LARGE
    \item line-1    
    \item line-2
  \end{enumerate}   

\end{document}  

Different approach with the eso-pic package:

\documentclass[12pt]{book}

\usepackage{graphicx}
\usepackage{eso-pic}

\begin{document}

\frontmatter
  \begin{titlepage} 
     \begin{center}
        {\Huge\bfseries book title}\\[5mm]
        {\Large\bfseries By author-name}
     \end{center}   
  \end{titlepage}   
\mainmatter 
\AddToShipoutPictureBG{\includegraphics[width=\paperwidth,height=\paperheight]{example-image}}
  \begin{enumerate}
    \LARGE
    \item line-1    
    \item line-2
  \end{enumerate}   

\end{document}  

Or using tiks:

\documentclass[12pt]{book}

\usepackage{graphicx}
\usepackage{tikz}

\begin{document}

\frontmatter
  \begin{titlepage} 
     \begin{center}
        {\Huge\bfseries book title}\\[5mm]
        {\Large\bfseries By author-name}
     \end{center}   
  \end{titlepage}   
\mainmatter 

\begin{tikzpicture}[remember picture, overlay]
\pgfsetfillopacity{0.1}
\node at (current page.center) {\includegraphics[width=\paperwidth,height=\paperheight]{example-image}};
\pgfsetfillopacity{1}
\end{tikzpicture}
  \begin{enumerate}
    \LARGE
    \item line-1    
    \item line-2
  \end{enumerate}   

\end{document}  
  • Thanks for the info. Sorry i forgot to include the code where i am using 'background' pkg to include a background image on each page. Added the code above now. If background pkg is the issue, is there any alternate way to include a background image on each page ? – mezda Jul 7 at 14:17
  • 1
    @mezda If you need to keep the background package, you can change the default text, see my edited answer. – I love cake Jul 7 at 14:24
  • 1
    @mezda also added an alternative package – I love cake Jul 7 at 14:27
  • Thanks a ton. That helped solve the first problem. Now 'draft' is no longer coming. But still the blank page is coming. Do you have any idea on how to get rid of that ? – mezda Jul 7 at 14:35
  • 2
    @mezda The blank page is supposed to be there because you use a documentclass which is two-sided by default. If you don't like, use \documentclass[12pt,oneside]{book} or article class – I love cake Jul 7 at 14:39

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.