1

I have problem for my book.

(1) The text in the left/right side is too long. How to make it into two lines?

(2) I cannot change the opacity into 0.2 only for rose background picture. How to change it?

This is my code.

\documentclass[a4paper,twoside,12pt]{book}
\usepackage[margin=3cm]{geometry}
\usepackage{graphicx, rotating}
\usepackage[svgnames]{xcolor}
\usepackage{tikz}
\usepackage{eso-pic, ifoddpage, transparent}
\usepackage{lipsum,background}

\backgroundsetup{ scale=1, color=black, opacity=0.2, angle=0, contents={% \includegraphics[width=15cm,height=15cm,keepaspectratio]{rose.jpg} }% }

\AddToShipoutPictureBG{\checkoddpage\ifoddpage \AtPageLowerLeft{\hspace{\dimexpr\paperwidth-2.4cm} \rotatebox{90}{\makebox[\paperheight]{\textcolor{Red!70}{\small\textbf{This book is used for practicum of the Numerical Ordinary Differential Equation Mathematics Department. Please don't copy, upload, or sell this book.}}}}}% \else\AtPageUpperLeft{\hspace{1.8cm} \rotatebox{-90}{\makebox[\paperheight]{\textcolor{SteelBlue!70}{\small\textbf{This book is used for practicum of the Numerical Ordinary Differential Equation Mathematics Department. Please don't copy, upload, or sell this book.}}}}}\fi% }%

\begin{document} \chapter{ONE} \section{ABC} \lipsum

\newpage \section{DEF} \lipsum

\newpage \section{GHI} \lipsum \end{document}

See e.g. http://prof83f86.pic6.websiteonline.cn/upload/LG359.jpg

How to solve it?

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036

1 Answers1

2

(1) My answer to your previous question automatically splits the text into two lines if it get too long.

(2) The picture can be added as a node with [opacity=...]

\documentclass[a4paper,twoside,12pt]{book}
\usepackage[left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{xcolor}
\usepackage{tikz}

\usepackage{background}
\usepackage{tikzpagenodes}
\usepackage{ifthen}

\backgroundsetup%
{   angle=0,
    opacity=1,
    scale=1,
    contents=%
    {
    \ifthenelse{\isodd{\thepage}}{%
       \begin{tikzpicture}[remember picture,overlay]
            \node[draw=black,text=blue,rotate=-90, above=1cm, text width=\textheight, align=center,font=\bfseries, inner sep=0.3cm] at (current page text area.east) {Please don't copy and sell this book. Make the text too long to split over two lines. Make the text too long to split over two lines.};
            \node[opacity=0.2] at (current page.center) {\includegraphics[width=6cm]{CY1zv}};          
        \end{tikzpicture}
      }{
             \begin{tikzpicture}[remember picture,overlay]
                  \node[draw=black,text=blue,rotate=90, above=1cm, text width=\textheight,align=center,font=\bfseries, inner sep=0.3cm] at (current page text area.west) {Please don't copy and sell this book. Make the text too long to split over two lines. Make the text too long to split over two lines.}; 
                  \node[opacity=0.2] at (current page.center) {\includegraphics[width=6cm]{CY1zv}};         
              \end{tikzpicture}
       }
    }
}

\begin{document}
    \chapter{ONE}
    \section{ABC}
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test 
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test

\newpage
\section{DEF}
Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test 
\end{document}

enter image description here

nigel
  • 188