章节开头图片是整页图片。我需要mask
半页图片,前端想放一些文字。我期待输出(见截图)。如何在中实现这一点LaTeX/XeLaTeX
。我搜索过,只找到了figure caption
不寻常的图形和标题位置。
1半页图像是后端。
a) 将章节号和章节标题放在半页图像的前端。
半页图像之后,黄色框是后端。
2半页图像是后端。
a) 列表文本放在前端文本的后半部分前面。
我的 MWE 是:
\documentclass[11pt,twoside,openany,svgnames,x11names]{book}
\usepackage{wallpaper}
\usepackage{changepage}
\usepackage[explicit]{titlesec}
\usepackage{fancyhdr}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning}
\usepackage{lipsum}
\usepackage{geometry}
\geometry{
paperwidth=216mm, paperheight=303mm,
left=23mm,
right=18mm,
top=23mm, bottom=23mm,
headheight=\baselineskip,
headsep=7mm,
footskip=10mm
}
\definecolor{chapopcolor}{cmyk}{.18,0,1,0}
\newcommand\chapterillustration{}
\titleformat{\chapter}{}{}{0pt}{
\ThisULCornerWallPaper{1}{\chapterillustration}
\tikz[overlay,remember picture]
\fill[chapopcolor,opacity=1]
(current page.north west) rectangle
([yshift=-3cm] current page.north east);
\strictpagecheck\checkoddpage
\ifoddpage{
\begin{tikzpicture}[overlay,remember picture]
\node[anchor=south west,
xshift=20mm,yshift=-30mm,
font=\sffamily\bfseries\huge]
at (current page.north west)
{\fontsize{16}{18}\selectfont\textcolor{white}{\chaptername}\ \thechapter};
\node[text=blue,
font=\fontsize{32}{34}\selectfont,
inner ysep=12pt, inner xsep=20pt,
rounded rectangle,anchor=east,
xshift=-20mm,yshift=-30mm]
at (current page.north east) {#1};
\end{tikzpicture}
}
\else {
\ThisLLCornerWallPaper{.35}{fern_mo_01}
\begin{tikzpicture}[overlay,remember picture]
\node[anchor=south east,
xshift=-20mm,yshift=-30mm,
font=\sffamily\bfseries\huge]
at (current page.north east)
{\chaptername\ \thechapter};
\node[fill=Sienna!80!black,text=white,
font=\Huge\bfseries,
inner sep=12pt, inner xsep=20pt,
rounded rectangle,anchor=west,
xshift=20mm,yshift=-30mm]
at ( current page.north west) {#1};
\end{tikzpicture}
}
\fi
}
\titlespacing*{\chapter}{0pt}{0pt}{135mm}
\begin{document}
\pagestyle{headings}
\renewcommand\chapterillustration{six-computers-chips-circuits}
\chapter{Chapter TeXt Here}
\section*{What you will learn}
\section*{Asian curriculum}
\begin{itemize}
\item[1A] Number Systems
\item[1B] Place value
\item[1C] Addition and subtraction
\item[1D] Addition and subtraction
\item[1E] Multiplication
\item[1F] Multiplying larger numbers
\item[1G] Division
\item[1I] Estimating and rounding Order of operations
\end{itemize}
\section*{Statistics and Probability}
\begin{itemize}
\item Data measures Determine mean, median, and range
and use these measures to compare
data sets explaining reasoning
\item Data investigation
Investigate questions involving the
collection of univariate and simple
bivariate data
\item Sample space
Construct sample spaces for single-
step experiments
\item Relative frequency
Calculate relative frequencies, and recognise variation between results
\end{itemize}
\end{document}
答案1
这是基于Peter Grill 的回答回答你之前的问题。
请注意,我不太确定它应该是什么样子,因为您发布的第一张图片和第二张图片都不对应于 MWE 的内容。此外,我仍然完全不知道您的描述是什么意思,而您甚至没有尝试澄清这一点。
编辑:MWE 和“巴西”形象之间的不正当交叉
\documentclass[11pt,twoside,openany,svgnames,x11names,a4paper]{book}% paper added to match image used for testing
\usepackage{afterpage}
\usepackage[explicit]{titlesec}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning}
\usepackage{enumitem}
\usepackage{geometry}
\geometry{
% paperwidth=216mm, paperheight=303mm,% changed just for illustration so the background image fits the page
left=23mm,
right=18mm,
top=23mm, bottom=23mm,
headheight=\baselineskip,
headsep=7mm,
footskip=10mm,
}
\definecolor{chapopcolor}{cmyk}{.18,0,1,0}
\newcommand\chapterillustration{}
\titleformat{\chapter}{}{}{0pt}{
\thispagestyle{empty}%
\begin{tikzpicture}[overlay,remember picture]
\node [anchor=south west, chapter pic] at (current page.south west) {\includegraphics[scale=1.414,angle=90]{\chapterillustration}};
\fill[chapopcolor,opacity=1] ([yshift=15mm] current page.west) rectangle ([yshift=-30mm] current page.east);
\fill[chapopcolor,opacity=.75] ([yshift=-30mm] current page.west) rectangle (current page.south east);
\node (chapter name) [anchor=south east, chapter name] at (current page.east) {\chaptername};
\node [chapter number] {\thechapter};
\end{tikzpicture}
\afterpage{%
\clearpage
\thispagestyle{empty}%
\begin{tikzpicture}[overlay,remember picture]
\node [anchor=south east, chapter pic] at (current page.south east) {\includegraphics[scale=1.414,angle=90]{\chapterillustration}};
\fill[chapopcolor,opacity=1] ([yshift=15mm] current page.west) rectangle ([yshift=-30mm] current page.east);
\fill[chapopcolor,opacity=.75] ([yshift=-30mm] current page.west) rectangle (current page.south east);
\node (chapter text) [chapter text, anchor=south west] at ([xshift=50mm] current page.west) {#1};
\end{tikzpicture}
\vspace*{135mm}%\dimexpr.5\textheight+30mm}
\section*{}%
}%
}
\titlespacing*{\chapter}{0pt}{0pt}{135mm}
\tikzset{
chapter pic/.style={
inner sep=0pt,
outer sep=0pt,
opacity=.5
},
chapter name/.style={
xshift=-25mm,
yshift=30mm,
font=\sffamily\bfseries\Huge,
text=white},
chapter number/.style={
right=0pt of chapter name,
font=\sffamily\bfseries\Huge,
white,
scale=2.5
},
chapter text/.style={
fill=Sienna!80!black,
text=white,
font=\Huge\bfseries,
inner ysep=12pt,
inner xsep=20pt,
rounded rectangle,
xshift=-20mm,
yshift=7.5mm
},
}
\newlist{topiclist}{enumerate}{1}
\setlist[topiclist]{format=\color{blue}\sffamily\bfseries, label=\arabic*}
\newlist{curriculumlist}{enumerate}{1}
\setlist[curriculumlist]{format=\color{blue}\sffamily\bfseries, label=\thechapter\Alph*}
\newenvironment{curriculum}[1]{%
\begin{minipage}[t]{.8\linewidth}
\subsection*{\color{blue}#1}
\begin{curriculumlist}
}{%
\end{curriculumlist}
\end{minipage}
}
\newenvironment{topics}[1]{%
\begin{minipage}[t]{.8\linewidth}\raggedright
\subsection*{\color{blue}#1}
\begin{topiclist}
}{%
\end{topiclist}
\end{minipage}
}
\begin{document}
\pagestyle{headings}
\renewcommand\chapterillustration{enfys}
\chapter{Chapter TeXt Here}
\section*{What you will learn}
% ref. https://tex.stackexchange.com/a/213707/
% Peter Grill's answer
\begin{curriculum}{Asian curriculum}
\item Number Systems
\item Place value
\item Addition and subtraction
\item Addition and subtraction
\item Multiplication
\item Multiplying larger numbers
\item Division
\item Estimating and rounding Order of operations
\end{curriculum}
\clearpage
\begin{topics}{Statistics and Probability}
\item Data measures Determine mean, median, and range and use these measures to compare data sets explaining reasoning
\item Data investigation
Investigate questions involving the collection of univariate and simple bivariate data
\item Sample space
Construct sample spaces for single-step experiments
\item Relative frequency
Calculate relative frequencies, and recognize variation between results
\end{topics}
\end{document}
原文:基于 MWE 和最初发布的图片
\documentclass[11pt,twoside,openany,svgnames,x11names,a4paper]{book}% paper added to match image used for testing
\usepackage{wallpaper}
\usepackage[explicit]{titlesec}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning}
\usepackage{changepage,enumitem}
\usepackage{geometry}
\geometry{
% paperwidth=216mm, paperheight=303mm,% changed just for illustration so the background image fits the page
left=23mm,
right=18mm,
top=23mm, bottom=23mm,
headheight=\baselineskip,
headsep=7mm,
footskip=10mm
}
\definecolor{chapopcolor}{cmyk}{.18,0,1,0}
\newcommand\chapterillustration{}
\titleformat{\chapter}{}{}{0pt}{
\ThisULCornerWallPaper{1}{\chapterillustration}
\tikz[overlay,remember picture]
{
\fill[chapopcolor,opacity=1] ([yshift=15mm] current page.west) rectangle ([yshift=-15mm] current page.east);
\fill[chapopcolor,opacity=.75] ([yshift=-15mm] current page.west) rectangle (current page.south east);
}
\strictpagecheck\checkoddpage
\ifoddpage{
\begin{tikzpicture}[overlay,remember picture]
\node (chapter name) [anchor=south west, chapter name] at (current page.west) {\chaptername};
\node [chapter number] {\thechapter};
\node (chapter text) [chapter text, anchor=south east] at (current page.east) {#1};
\end{tikzpicture}
}
\else {
\begin{tikzpicture}[overlay,remember picture]
\node (chapter name) [anchor=south east, chapter name] at (current page.east) {\chaptername};
\node [chapter number] {\thechapter};
\node (chapter text) [chapter text, anchor=south west] at ( current page.west) {#1};
\end{tikzpicture}
}
\fi
}
\titlespacing*{\chapter}{0pt}{0pt}{135mm}
\tikzset{
chapter name/.style={
xshift=5mm,
yshift=30mm,
font=\sffamily\bfseries\Huge,
text=white},
chapter number/.style={
right=0pt of chapter name,
font=\sffamily\bfseries\Huge,
white,
scale=2.5
},
chapter text/.style={
fill=Sienna!80!black,
text=white,
font=\Huge\bfseries,
inner ysep=12pt,
inner xsep=20pt,
rounded rectangle,
xshift=-20mm,
yshift=7.5mm
},
}
\newlist{topiclist}{enumerate}{1}
\setlist[topiclist]{format=\color{blue}\sffamily\bfseries, label=\arabic*}
\newlist{curriculumlist}{enumerate}{1}
\setlist[curriculumlist]{format=\color{blue}\sffamily\bfseries, label=\thechapter\Alph*}
\newenvironment{curriculum}[1]{%
\section*{\color{blue}#1}
\begin{minipage}[t]{0.4\linewidth}
\begin{curriculumlist}
}{%
\end{curriculumlist}
\end{minipage}
}
\newenvironment{topics}[1]{%
\begin{minipage}[t]{0.4\linewidth}\raggedright
\subsection*{\color{blue}#1}
\begin{topiclist}
}{%
\end{topiclist}
\end{minipage}
}
\begin{document}
\pagestyle{headings}
\renewcommand\chapterillustration{enfys}
\chapter{Chapter TeXt Here}
\section*{What you will learn}
% ref. https://tex.stackexchange.com/a/213707/
% Peter Grill's answer
\begin{curriculum}{Asian curriculum}
\item Number Systems
\item Place value
\item Addition and subtraction
\item Addition and subtraction
\item Multiplication
\item Multiplying larger numbers
\item Division
\item Estimating and rounding Order of operations
\end{curriculum}
\begin{topics}{Statistics and Probability}
\item Data measures Determine mean, median, and range and use these measures to compare data sets explaining reasoning
\item Data investigation
Investigate questions involving the collection of univariate and simple bivariate data
\item Sample space
Construct sample spaces for single-step experiments
\item Relative frequency
Calculate relative frequencies, and recognize variation between results
\end{topics}
\end{document}