如何设置背景图片的不透明度并在右侧/左侧制作两行长文本?

如何设置背景图片的不透明度并在右侧/左侧制作两行长文本?

我的书有问题。

(1)左右两侧的文字太长,如何分成两行?

(2)只有玫瑰背景图片的不透明度无法改为 0.2。该如何更改?

这是我的代码。

\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} 

例如http://prof83f86.pic6.websiteonline.cn/upload/LG359.jpg

如何解决?

答案1

(1)对于您上一个问题的回答,如果文本太长,会自动将其分成两行。

(2)图片可以作为节点添加[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}

在此处输入图片描述

相关内容