带有页眉、页脚和水印的 tcolorbox

带有页眉、页脚和水印的 tcolorbox

以下是 MWE:

\documentclass[table]{standalone}
\usepackage{polyglossia, lipsum}
\usepackage[most]{tcolorbox}

\newtcolorbox{mybox}[2][]{%
  enhanced,
  before upper=\setlength{\parskip}{\bigskipamount},
  boxrule=2mm,
  bottomrule=9mm,
  watermark zoom=1,
  watermark color=black,
  watermark opacity=1,
  clip watermark,
  watermark text={\rotatebox{45}{Watermark}},
  overlay={%
    \node[white, font=\small, anchor=south, text width=\textwidth] at (frame.south) {%
        Footer \\ With Two Lines};},
  title=#2,#1}

\newcommand{\xxbody}{
\lipsum[1]
}

\newcommand{\xxheading}{
  Header \\ With Two Lines
}

\begin{document}

\begin{mybox}{\LARGE \xxheading{}}

  \xxbody{}

\end{mybox}

\end{document}

有趣的是,按照原样使用代码,我得到了页眉和页脚。但没有水印。通过注释掉覆盖层来关闭页脚,然后就会出现水印。

我如何获取所有三个元素——页眉、页脚和水印?

这是这个问题的后续这里

答案1

在此处输入图片描述

如果您遵循此建议:

\documentclass[table]{standalone}
\usepackage{polyglossia,lipsum}
\usepackage[most]{tcolorbox}

\newtcolorbox{mybox}[2][]{%
  enhanced,
  before upper=\setlength{\parskip}{\bigskipamount},
  boxrule=2mm,
  bottomrule=9mm,
  watermark zoom=1,
  watermark color=black,
  watermark opacity=.51,
  clip watermark,
  watermark text={\rotatebox{45}{Watermark}},
  overlay app={%
    \node[white, font=\small, anchor=south, text width=\textwidth] at (frame.south) {%
        Footer \\ With Two Lines};
    },
  title=#2,
  #1}

\newcommand{\xxbody}{
\lipsum[1]
}

\newcommand{\xxheading}{
  Header \\ With Two Lines
}

\begin{document}

\begin{mybox}{\LARGE \xxheading{}}

  \xxbody{}

\end{mybox}

\end{document}

在此处输入图片描述

相关内容